summaryrefslogtreecommitdiff
path: root/utils/themeeditor/editorwindow.cpp
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-06-05 07:38:29 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-06-05 07:38:29 +0000
commitd41a6810533f5508a18ce7e02cb34b8c37e371cc (patch)
tree3c65417a6b022fdfccc822dbeab43846d56e7b32 /utils/themeeditor/editorwindow.cpp
parent0af886077520658a12a0c0b2d41bc15e5b906239 (diff)
downloadrockbox-d41a6810533f5508a18ce7e02cb34b8c37e371cc.zip
rockbox-d41a6810533f5508a18ce7e02cb34b8c37e371cc.tar.gz
rockbox-d41a6810533f5508a18ce7e02cb34b8c37e371cc.tar.bz2
rockbox-d41a6810533f5508a18ce7e02cb34b8c37e371cc.tar.xz
Theme Editor: Enabled tag closing
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26566 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to '')
-rw-r--r--utils/themeeditor/editorwindow.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/utils/themeeditor/editorwindow.cpp b/utils/themeeditor/editorwindow.cpp
index 4268788..a2fc11a 100644
--- a/utils/themeeditor/editorwindow.cpp
+++ b/utils/themeeditor/editorwindow.cpp
@@ -78,6 +78,12 @@ void EditorWindow::setupUI()
model->setRootPath(QDir::currentPath());
ui->fileTree->setModel(model);
+ /* Connecting the tab bar signals */
+ QObject::connect(ui->editorTabs, SIGNAL(currentChanged(int)),
+ this, SLOT(shiftTab(int)));
+ QObject::connect(ui->editorTabs, SIGNAL(tabCloseRequested(int)),
+ this, SLOT(closeTab(int)));
+
}
void EditorWindow::setupMenus()
@@ -102,6 +108,26 @@ void EditorWindow::newTab()
ui->editorTabs->addTab(doc, doc->getTitle());
}
+void EditorWindow::shiftTab(int index)
+{
+ if(index < 0)
+ ui->parseTree->setModel(0);
+ else
+ ui->parseTree->setModel(dynamic_cast<SkinDocument*>
+ (ui->editorTabs->currentWidget())->getModel());
+}
+
+void EditorWindow::closeTab(int index)
+{
+ SkinDocument* widget = dynamic_cast<SkinDocument*>
+ (ui->editorTabs->widget(index));
+ if(widget->requestClose())
+ {
+ ui->editorTabs->removeTab(index);
+ widget->deleteLater();
+ }
+}
+
void EditorWindow::showPanel()
{
if(sender() == ui->actionFile_Panel)