diff options
| author | Amaury Pouly <amaury.pouly@gmail.com> | 2014-09-27 13:28:44 +0200 |
|---|---|---|
| committer | Amaury Pouly <amaury.pouly@gmail.com> | 2014-12-15 22:52:35 +0100 |
| commit | 3b4e63173d5f762a368d159e21f76e2df3fcf8ab (patch) | |
| tree | 286fcb801ec69ae20e67a00229403310e7de886b /utils/regtools/qeditor/mainwindow.cpp | |
| parent | fe1fed88732ac84f5a4196c5936c99e9750a6525 (diff) | |
| download | rockbox-3b4e63173d5f762a368d159e21f76e2df3fcf8ab.zip rockbox-3b4e63173d5f762a368d159e21f76e2df3fcf8ab.tar.gz rockbox-3b4e63173d5f762a368d159e21f76e2df3fcf8ab.tar.bz2 rockbox-3b4e63173d5f762a368d159e21f76e2df3fcf8ab.tar.xz | |
qeditor: rework mainwindow tab names handling
With the previous code, tab names would be ignored if tab is detached
which can happen early on.
Change-Id: I9eac4202850f3e79a04590a4ba1444850ec6a583
Reviewed-on: http://gerrit.rockbox.org/986
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
Diffstat (limited to 'utils/regtools/qeditor/mainwindow.cpp')
| -rw-r--r-- | utils/regtools/qeditor/mainwindow.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/utils/regtools/qeditor/mainwindow.cpp b/utils/regtools/qeditor/mainwindow.cpp index 07adc71..9cea728d 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() |