Theme Editor: Enabled loading project files from the project panel

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26732 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Robert Bieber 2010-06-09 21:37:15 +00:00
parent 1cc95c541b
commit fc94a92ad1
6 changed files with 65 additions and 20 deletions

View file

@ -20,6 +20,7 @@
****************************************************************************/
#include "editorwindow.h"
#include "projectmodel.h"
#include "ui_editorwindow.h"
#include <QDesktopWidget>
@ -39,6 +40,14 @@ EditorWindow::EditorWindow(QWidget *parent) :
setupMenus();
}
void EditorWindow::loadTabFromFile(QString fileName)
{
/* Adding a new document for each file name */
SkinDocument* doc = new SkinDocument(parseStatus, fileName);
addTab(doc);
}
void EditorWindow::loadSettings()
{
@ -225,9 +234,7 @@ void EditorWindow::openFile()
QString current = fileNames[i];
/* Adding a new document for each file name */
SkinDocument* doc = new SkinDocument(parseStatus, current);
addTab(doc);
loadTabFromFile(current);
/* And setting the new default directory */
current.chop(current.length() - current.lastIndexOf('/') - 1);
@ -254,8 +261,12 @@ void EditorWindow::openProject()
if(project)
delete project;
project = new ProjectModel(fileName);
project = new ProjectModel(fileName, this);
ui->projectTree->setModel(project);
ui->projectTree->expandAll();
QObject::connect(ui->projectTree, SIGNAL(activated(QModelIndex)),
project, SLOT(activated(QModelIndex)));
fileName.chop(fileName.length() - fileName.lastIndexOf('/') - 1);
settings.setValue("defaultDirectory", fileName);