From 7c52284b294cb33bc2e5d747e2e3c14d8ab937ae Mon Sep 17 00:00:00 2001 From: Robert Bieber Date: Wed, 21 Jul 2010 07:45:29 +0000 Subject: Theme Editor: Implemented download and decompression of font pack in the preferences dialog. Dialog will also allow the user to set a directory for a custom target database, but the update button doesn't work yet. Also fixed the file filters for open file/open project actions and resized the preferences dialog git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27509 a1c6a512-1295-4272-9138-f99709370657 --- utils/themeeditor/models/projectmodel.h | 2 +- utils/themeeditor/models/targetdata.cpp | 11 +++++++++-- utils/themeeditor/models/targetdata.h | 9 +++++---- 3 files changed, 15 insertions(+), 7 deletions(-) (limited to 'utils/themeeditor/models') diff --git a/utils/themeeditor/models/projectmodel.h b/utils/themeeditor/models/projectmodel.h index 4cc531b88f..4afca2837e 100644 --- a/utils/themeeditor/models/projectmodel.h +++ b/utils/themeeditor/models/projectmodel.h @@ -35,7 +35,7 @@ public: static QString fileFilter() { - return QObject::tr("Project Files (*.cfg);;All Files (*.*)"); + return QObject::tr("Project Files (*.cfg);;All Files (*)"); } ProjectModel(QString config, EditorWindow* mainWindow, QObject *parent = 0); diff --git a/utils/themeeditor/models/targetdata.cpp b/utils/themeeditor/models/targetdata.cpp index 70d231988b..b44f1e67b3 100644 --- a/utils/themeeditor/models/targetdata.cpp +++ b/utils/themeeditor/models/targetdata.cpp @@ -22,11 +22,17 @@ #include "targetdata.h" #include +#include const QString TargetData::reserved = "{}:#\n"; -TargetData::TargetData(QString file) +TargetData::TargetData() { + QSettings settings; + settings.beginGroup("TargetData"); + QString file = settings.value("targetDbPath", "").toString(); + settings.endGroup(); + if(!QFile::exists(file)) file = ":/targets/targetdb"; @@ -132,7 +138,8 @@ TargetData::TargetData(QString file) /* Checking for the closing '}' and adding the entry */ if(require('}', data, cursor)) { - entries.append(Entry(name, size, depth, rSize, rDepth, fm, record)); + entries.append(Entry(id, name, size, depth, rSize, rDepth, + fm, record)); indices.insert(id, index); index++; } diff --git a/utils/themeeditor/models/targetdata.h b/utils/themeeditor/models/targetdata.h index 09276c5966..89bb78bdc3 100644 --- a/utils/themeeditor/models/targetdata.h +++ b/utils/themeeditor/models/targetdata.h @@ -39,7 +39,7 @@ public: None }; - TargetData(QString file = ""); + TargetData(); virtual ~TargetData(); int count(){ return indices.count(); } @@ -57,11 +57,12 @@ public: private: struct Entry { - Entry(QString name, QRect size, ScreenDepth depth, QRect rSize, - ScreenDepth rDepth, bool fm, bool record) - : name(name), size(size), depth(depth), rSize(rSize), + Entry(QString id, QString name, QRect size, ScreenDepth depth, + QRect rSize, ScreenDepth rDepth, bool fm, bool record) + : id(id), name(name), size(size), depth(depth), rSize(rSize), rDepth(rDepth), fm(fm), record(record){ } + QString id; QString name; QRect size; ScreenDepth depth; -- cgit v1.2.3