summaryrefslogtreecommitdiff
path: root/utils/themeeditor
diff options
context:
space:
mode:
Diffstat (limited to 'utils/themeeditor')
-rw-r--r--utils/themeeditor/editorwindow.cpp14
-rw-r--r--utils/themeeditor/skindocument.h1
2 files changed, 14 insertions, 1 deletions
diff --git a/utils/themeeditor/editorwindow.cpp b/utils/themeeditor/editorwindow.cpp
index 601e4d8..d137897 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<SkinDocument*>
+ (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 c8f9295..e8bd270 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()); }