1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Robert Bieber 2010-06-10 07:06:38 +00:00
parent 2c29abdfde
commit cb26aecf92
2 changed files with 14 additions and 1 deletions

View file

@ -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);

View file

@ -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()); }