summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-06-10 07:06:38 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-06-10 07:06:38 +0000
commitcb26aecf92f73065915416324c6a33ca8cf83bc8 (patch)
tree09dbf07c50da458386655c019ee499b86a43db96 /utils
parent2c29abdfde6965731025122c101ce8659da7ea00 (diff)
downloadrockbox-cb26aecf92f73065915416324c6a33ca8cf83bc8.zip
rockbox-cb26aecf92f73065915416324c6a33ca8cf83bc8.tar.gz
rockbox-cb26aecf92f73065915416324c6a33ca8cf83bc8.tar.bz2
rockbox-cb26aecf92f73065915416324c6a33ca8cf83bc8.tar.xz
Theme Editor: Opening an already opened document no longer spawns a new tab
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26736 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils')
-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()); }