diff options
author | Robert Bieber <robby@bieberphoto.com> | 2010-06-05 07:38:29 +0000 |
---|---|---|
committer | Robert Bieber <robby@bieberphoto.com> | 2010-06-05 07:38:29 +0000 |
commit | d41a6810533f5508a18ce7e02cb34b8c37e371cc (patch) | |
tree | 3c65417a6b022fdfccc822dbeab43846d56e7b32 /utils/themeeditor/editorwindow.cpp | |
parent | 0af886077520658a12a0c0b2d41bc15e5b906239 (diff) | |
download | rockbox-d41a6810533f5508a18ce7e02cb34b8c37e371cc.tar.gz rockbox-d41a6810533f5508a18ce7e02cb34b8c37e371cc.zip |
Theme Editor: Enabled tag closing
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26566 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/editorwindow.cpp')
-rw-r--r-- | utils/themeeditor/editorwindow.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/utils/themeeditor/editorwindow.cpp b/utils/themeeditor/editorwindow.cpp index 4268788772..a2fc11afdf 100644 --- a/utils/themeeditor/editorwindow.cpp +++ b/utils/themeeditor/editorwindow.cpp | |||
@@ -78,6 +78,12 @@ void EditorWindow::setupUI() | |||
78 | model->setRootPath(QDir::currentPath()); | 78 | model->setRootPath(QDir::currentPath()); |
79 | ui->fileTree->setModel(model); | 79 | ui->fileTree->setModel(model); |
80 | 80 | ||
81 | /* Connecting the tab bar signals */ | ||
82 | QObject::connect(ui->editorTabs, SIGNAL(currentChanged(int)), | ||
83 | this, SLOT(shiftTab(int))); | ||
84 | QObject::connect(ui->editorTabs, SIGNAL(tabCloseRequested(int)), | ||
85 | this, SLOT(closeTab(int))); | ||
86 | |||
81 | } | 87 | } |
82 | 88 | ||
83 | void EditorWindow::setupMenus() | 89 | void EditorWindow::setupMenus() |
@@ -102,6 +108,26 @@ void EditorWindow::newTab() | |||
102 | ui->editorTabs->addTab(doc, doc->getTitle()); | 108 | ui->editorTabs->addTab(doc, doc->getTitle()); |
103 | } | 109 | } |
104 | 110 | ||
111 | void EditorWindow::shiftTab(int index) | ||
112 | { | ||
113 | if(index < 0) | ||
114 | ui->parseTree->setModel(0); | ||
115 | else | ||
116 | ui->parseTree->setModel(dynamic_cast<SkinDocument*> | ||
117 | (ui->editorTabs->currentWidget())->getModel()); | ||
118 | } | ||
119 | |||
120 | void EditorWindow::closeTab(int index) | ||
121 | { | ||
122 | SkinDocument* widget = dynamic_cast<SkinDocument*> | ||
123 | (ui->editorTabs->widget(index)); | ||
124 | if(widget->requestClose()) | ||
125 | { | ||
126 | ui->editorTabs->removeTab(index); | ||
127 | widget->deleteLater(); | ||
128 | } | ||
129 | } | ||
130 | |||
105 | void EditorWindow::showPanel() | 131 | void EditorWindow::showPanel() |
106 | { | 132 | { |
107 | if(sender() == ui->actionFile_Panel) | 133 | if(sender() == ui->actionFile_Panel) |