summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/regtools/qeditor/mainwindow.cpp15
-rw-r--r--utils/regtools/qeditor/mainwindow.h5
-rw-r--r--utils/regtools/qeditor/regedit.cpp6
-rw-r--r--utils/regtools/qeditor/regtab.cpp1
4 files changed, 20 insertions, 7 deletions
diff --git a/utils/regtools/qeditor/mainwindow.cpp b/utils/regtools/qeditor/mainwindow.cpp
index 07adc71368..9cea728d6e 100644
--- a/utils/regtools/qeditor/mainwindow.cpp
+++ b/utils/regtools/qeditor/mainwindow.cpp
@@ -43,8 +43,15 @@ void DocumentTab::OnModified(bool modified)
m_tab->SetTabModified(this, modified);
}
+void DocumentTab::SetTabWidget(MyTabWidget *tab)
+{
+ m_tab = tab;
+ SetTabName(m_tabname);
+}
+
void DocumentTab::SetTabName(const QString& name)
{
+ m_tabname = name;
if(m_tab)
m_tab->SetTabName(this, name);
}
@@ -201,20 +208,20 @@ void MainWindow::OnLoadDesc()
}
}
-void MainWindow::AddTab(DocumentTab *doc, const QString& title)
+void MainWindow::AddTab(DocumentTab *doc)
{
- m_tab->setCurrentIndex(m_tab->addTab(doc->GetWidget(), title));
+ m_tab->setCurrentIndex(m_tab->addTab(doc->GetWidget(), ""));
doc->SetTabWidget(m_tab);
}
void MainWindow::OnNewRegTab()
{
- AddTab(new RegTab(m_backend, this), "Register Tab");
+ AddTab(new RegTab(m_backend, this));
}
void MainWindow::OnNewRegEdit()
{
- AddTab(new RegEdit(m_backend, this), "Register Editor");
+ AddTab(new RegEdit(m_backend, this));
}
bool MainWindow::Quit()
diff --git a/utils/regtools/qeditor/mainwindow.h b/utils/regtools/qeditor/mainwindow.h
index 67d33244ba..c5da66758e 100644
--- a/utils/regtools/qeditor/mainwindow.h
+++ b/utils/regtools/qeditor/mainwindow.h
@@ -35,12 +35,13 @@ public:
DocumentTab() { m_tab = 0; }
virtual bool Quit() = 0;
virtual QWidget *GetWidget() = 0;
- void SetTabWidget(MyTabWidget *tab) { m_tab = tab; }
+ void SetTabWidget(MyTabWidget *tab);
protected:
void OnModified(bool modified);
void SetTabName(const QString& name);
MyTabWidget *m_tab;
+ QString m_tabname;
};
class MyTabWidget : public QTabWidget
@@ -70,7 +71,7 @@ private:
void closeEvent(QCloseEvent *event);
protected:
- void AddTab(DocumentTab *tab, const QString& title);
+ void AddTab(DocumentTab *tab);
bool Quit();
private slots:
diff --git a/utils/regtools/qeditor/regedit.cpp b/utils/regtools/qeditor/regedit.cpp
index b1f9afd45c..5a32defb58 100644
--- a/utils/regtools/qeditor/regedit.cpp
+++ b/utils/regtools/qeditor/regedit.cpp
@@ -961,6 +961,7 @@ RegEdit::RegEdit(Backend *backend, QWidget *parent)
SetModified(false, false);
m_right_panel = 0;
SetPanel(new EmptyEditPanel(this));
+ UpdateTabName();
connect(m_file_open, SIGNAL(clicked()), this, SLOT(OnOpen()));
connect(m_file_save, SIGNAL(clicked()), this, SLOT(OnSave()));
@@ -1080,7 +1081,10 @@ bool RegEdit::SaveSocFile(const QString& filename)
void RegEdit::UpdateTabName()
{
QFileInfo info(m_cur_socfile.GetFilename());
- SetTabName(info.fileName());
+ if(info.exists())
+ SetTabName(info.fileName());
+ else
+ SetTabName("Register Editor");
}
void RegEdit::LoadSocFile(const QString& filename)
diff --git a/utils/regtools/qeditor/regtab.cpp b/utils/regtools/qeditor/regtab.cpp
index e7621322d7..c92dad49d5 100644
--- a/utils/regtools/qeditor/regtab.cpp
+++ b/utils/regtools/qeditor/regtab.cpp
@@ -178,6 +178,7 @@ RegTab::RegTab(Backend *backend, QWidget *parent)
OnSocListChanged();
SetDataSocName("");
+ UpdateTabName();
}
QWidget *RegTab::GetWidget()