summaryrefslogtreecommitdiffstats
path: root/utils/themeeditor/projectfiles.cpp
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-06-09 21:37:15 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-06-09 21:37:15 +0000
commitfc94a92ad1c082c206114029fad108b983f59767 (patch)
treee76059edab819244cf2991db6b631f6daa48d795 /utils/themeeditor/projectfiles.cpp
parent1cc95c541bd7bafe5d33ef0145887cb7ddd8a6d7 (diff)
downloadrockbox-fc94a92ad1c082c206114029fad108b983f59767.tar.gz
rockbox-fc94a92ad1c082c206114029fad108b983f59767.tar.bz2
rockbox-fc94a92ad1c082c206114029fad108b983f59767.zip
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
Diffstat (limited to 'utils/themeeditor/projectfiles.cpp')
-rw-r--r--utils/themeeditor/projectfiles.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/utils/themeeditor/projectfiles.cpp b/utils/themeeditor/projectfiles.cpp
index b7168ac47d..f687e23767 100644
--- a/utils/themeeditor/projectfiles.cpp
+++ b/utils/themeeditor/projectfiles.cpp
@@ -22,8 +22,11 @@
#include "projectfiles.h"
ProjectFiles::ProjectFiles(QHash<QString, QString>& settings,
- ProjectNode* parent): parentLink(parent)
+ ProjectModel* model, ProjectNode* parent)
+ : parentLink(parent)
{
+ base = settings.value("themebase");
+
QList<QString> keys;
keys.append("wps");
keys.append("rwps");
@@ -38,7 +41,7 @@ ProjectFiles::ProjectFiles(QHash<QString, QString>& settings,
if(file != "" && file != "-")
{
file.replace("/.rockbox/", "");
- children.append(new ProjectFile(file, this));
+ children.append(new ProjectFile(file, model, this));
}
}
}
@@ -94,10 +97,11 @@ void ProjectFiles::activated()
}
/* Project File functions */
-ProjectFile::ProjectFile(QString file, ProjectNode* parent) :
- parentLink(parent), file(file)
+ProjectFile::ProjectFile(QString file, ProjectModel* model,
+ ProjectNode* parent)
+ :parentLink(parent), file(file)
{
-
+ this->model = model;
}
ProjectFile::~ProjectFile()
@@ -123,5 +127,7 @@ Qt::ItemFlags ProjectFile::flags(int column) const
void ProjectFile::activated()
{
+ QString base = dynamic_cast<ProjectFiles*>(parentLink)->getBase();
+ model->loadFile(base + "/" + file);
}