diff --git a/utils/themeeditor/editorwindow.cpp b/utils/themeeditor/editorwindow.cpp index 601e4d85e8..d137897763 100644 --- a/utils/themeeditor/editorwindow.cpp +++ b/utils/themeeditor/editorwindow.cpp @@ -42,7 +42,19 @@ EditorWindow::EditorWindow(QWidget *parent) : void EditorWindow::loadTabFromFile(QString fileName) { - /* Adding a new document for each file name */ + /* Checking to see if the file is already open */ + for(int i = 0; i < ui->editorTabs->count(); i++) + { + SkinDocument* current = dynamic_cast + (ui->editorTabs->widget(i)); + if(current->getFile() == fileName) + { + ui->editorTabs->setCurrentIndex(i); + return; + } + } + + /* Adding a new document*/ SkinDocument* doc = new SkinDocument(parseStatus, fileName); addTab(doc); diff --git a/utils/themeeditor/skindocument.h b/utils/themeeditor/skindocument.h index c8f92955f5..e8bd27067f 100644 --- a/utils/themeeditor/skindocument.h +++ b/utils/themeeditor/skindocument.h @@ -52,6 +52,7 @@ public: void connectPrefs(PreferencesDialog* prefs); ParseTreeModel* getModel(){ return model; } + QString getFile(){ return fileName; } QString getTitle(){ return title; } QString getStatus(){ return parseStatus; } void genCode(){ editor->document()->setPlainText(model->genCode()); }