summaryrefslogtreecommitdiffstats
path: root/utils/regtools/qeditor/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/regtools/qeditor/mainwindow.cpp')
-rw-r--r--utils/regtools/qeditor/mainwindow.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/utils/regtools/qeditor/mainwindow.cpp b/utils/regtools/qeditor/mainwindow.cpp
index b44306d701..8b83be6bae 100644
--- a/utils/regtools/qeditor/mainwindow.cpp
+++ b/utils/regtools/qeditor/mainwindow.cpp
@@ -43,7 +43,7 @@ void DocumentTab::OnModified(bool modified)
m_tab->SetTabModified(this, modified);
}
-void DocumentTab::SetTabWidget(MyTabWidget *tab)
+void DocumentTab::SetTabWidget(DocumentTabWidget *tab)
{
m_tab = tab;
SetTabName(m_tabname);
@@ -57,17 +57,17 @@ void DocumentTab::SetTabName(const QString& name)
}
/**
- * MyTabWidget
+ * DocumentTabWidget
*/
-MyTabWidget::MyTabWidget()
+DocumentTabWidget::DocumentTabWidget()
{
setMovable(true);
setTabsClosable(true);
connect(this, SIGNAL(tabCloseRequested(int)), this, SLOT(OnCloseTab(int)));
}
-void MyTabWidget::SetTabModified(DocumentTab *doc, bool modified)
+void DocumentTabWidget::SetTabModified(DocumentTab *doc, bool modified)
{
int index = indexOf(doc->GetWidget());
if(modified)
@@ -76,12 +76,12 @@ void MyTabWidget::SetTabModified(DocumentTab *doc, bool modified)
setTabIcon(index, QIcon());
}
-void MyTabWidget::SetTabName(DocumentTab *doc, const QString& name)
+void DocumentTabWidget::SetTabName(DocumentTab *doc, const QString& name)
{
setTabText(indexOf(doc->GetWidget()), name);
}
-bool MyTabWidget::CloseTab(int index)
+bool DocumentTabWidget::CloseTab(int index)
{
QWidget *w = this->widget(index);
DocumentTab *doc = dynamic_cast< DocumentTab* >(w);
@@ -95,7 +95,7 @@ bool MyTabWidget::CloseTab(int index)
return false;
}
-void MyTabWidget::OnCloseTab(int index)
+void DocumentTabWidget::OnCloseTab(int index)
{
CloseTab(index);
}
@@ -135,7 +135,9 @@ MainWindow::MainWindow(Backend *backend)
about_menu->addAction(about_act);
about_menu->addAction(about_qt_act);
- m_tab = new MyTabWidget();
+ m_tab = new DocumentTabWidget();
+ m_tab->setTabOpenable(true);
+ m_tab->setTabOpenMenu(new_submenu);
setCentralWidget(m_tab);
@@ -161,8 +163,8 @@ void MainWindow::OnQuit()
void MainWindow::OnAbout()
{
- QString soc_desc_ver = QString("%1.%2.%3").arg(MAJOR_VERSION)
- .arg(MINOR_VERSION).arg(REVISION_VERSION);
+ QString soc_desc_ver = QString("%1.%2.%3").arg(soc_desc::MAJOR_VERSION)
+ .arg(soc_desc::MINOR_VERSION).arg(soc_desc::REVISION_VERSION);
QMessageBox::about(this, "About",
"<h1>QEditor</h1>"
"<h2>Version "APP_VERSION"</h2>"
@@ -193,7 +195,10 @@ void MainWindow::closeEvent(QCloseEvent *event)
void MainWindow::OnLoadDesc()
{
QFileDialog *fd = new QFileDialog(this);
- fd->setFilter("XML files (*.xml);;All files (*)");
+ QStringList filters;
+ filters << "XML files (*.xml)";
+ filters << "All files (*)";
+ fd->setNameFilters(filters);
fd->setFileMode(QFileDialog::ExistingFiles);
fd->setDirectory(Settings::Get()->value("loaddescdir", QDir::currentPath()).toString());
if(fd->exec())