mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 21:22:39 -05:00
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:
parent
1cc95c541b
commit
fc94a92ad1
6 changed files with 65 additions and 20 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue