From 3b4e63173d5f762a368d159e21f76e2df3fcf8ab Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Sat, 27 Sep 2014 13:28:44 +0200 Subject: 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 --- utils/regtools/qeditor/mainwindow.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'utils/regtools/qeditor/mainwindow.cpp') 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() -- cgit v1.1