summaryrefslogtreecommitdiff
path: root/utils/themeeditor/editorwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/themeeditor/editorwindow.cpp')
-rw-r--r--utils/themeeditor/editorwindow.cpp39
1 files changed, 37 insertions, 2 deletions
diff --git a/utils/themeeditor/editorwindow.cpp b/utils/themeeditor/editorwindow.cpp
index 3603b24af1..56968a3c05 100644
--- a/utils/themeeditor/editorwindow.cpp
+++ b/utils/themeeditor/editorwindow.cpp
@@ -201,7 +201,7 @@ void EditorWindow::shiftTab(int index)
201{ 201{
202 TabContent* widget = dynamic_cast<TabContent*> 202 TabContent* widget = dynamic_cast<TabContent*>
203 (ui->editorTabs->currentWidget()); 203 (ui->editorTabs->currentWidget());
204 if(index < 0 || widget->type() != TabContent::Skin) 204 if(index < 0)
205 { 205 {
206 ui->parseTree->setModel(0); 206 ui->parseTree->setModel(0);
207 ui->actionSave_Document->setEnabled(false); 207 ui->actionSave_Document->setEnabled(false);
@@ -210,6 +210,13 @@ void EditorWindow::shiftTab(int index)
210 ui->actionToolbarSave->setEnabled(false); 210 ui->actionToolbarSave->setEnabled(false);
211 ui->fromTree->setEnabled(false); 211 ui->fromTree->setEnabled(false);
212 } 212 }
213 else if(widget->type() == TabContent::Config)
214 {
215 ui->actionSave_Document->setEnabled(true);
216 ui->actionSave_Document_As->setEnabled(true);
217 ui->actionClose_Document->setEnabled(true);
218 ui->actionToolbarSave->setEnabled(true);
219 }
213 else 220 else
214 { 221 {
215 /* Syncing the tree view and the status bar */ 222 /* Syncing the tree view and the status bar */
@@ -318,6 +325,34 @@ void EditorWindow::openProject()
318 325
319} 326}
320 327
328void EditorWindow::configFileChanged(QString configFile)
329{
330
331 QSettings settings;
332
333 settings.beginGroup("ProjectModel");
334
335 if(QFile::exists(configFile))
336 {
337
338 if(project)
339 delete project;
340
341 project = new ProjectModel(configFile, this);
342 ui->projectTree->setModel(project);
343
344 QObject::connect(ui->projectTree, SIGNAL(activated(QModelIndex)),
345 project, SLOT(activated(QModelIndex)));
346
347 configFile.chop(configFile.length() - configFile.lastIndexOf('/') - 1);
348 settings.setValue("defaultDirectory", configFile);
349
350 }
351
352 settings.endGroup();
353
354}
355
321void EditorWindow::tabTitleChanged(QString title) 356void EditorWindow::tabTitleChanged(QString title)
322{ 357{
323 TabContent* sender = dynamic_cast<TabContent*>(QObject::sender()); 358 TabContent* sender = dynamic_cast<TabContent*>(QObject::sender());
@@ -342,7 +377,7 @@ void EditorWindow::closeEvent(QCloseEvent* event)
342 /* Closing all the tabs */ 377 /* Closing all the tabs */
343 for(int i = 0; i < ui->editorTabs->count(); i++) 378 for(int i = 0; i < ui->editorTabs->count(); i++)
344 { 379 {
345 if(!dynamic_cast<SkinDocument*> 380 if(!dynamic_cast<TabContent*>
346 (ui->editorTabs->widget(i))->requestClose()) 381 (ui->editorTabs->widget(i))->requestClose())
347 { 382 {
348 event->ignore(); 383 event->ignore();