diff options
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) |