summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utils/themeeditor/gui/editorwindow.cpp22
-rw-r--r--utils/themeeditor/models/targetdata.cpp9
-rw-r--r--utils/themeeditor/models/targetdata.h6
-rw-r--r--utils/themeeditor/resources/targetdb9
4 files changed, 43 insertions, 3 deletions
diff --git a/utils/themeeditor/gui/editorwindow.cpp b/utils/themeeditor/gui/editorwindow.cpp
index b5eea633f9..57de72358a 100644
--- a/utils/themeeditor/gui/editorwindow.cpp
+++ b/utils/themeeditor/gui/editorwindow.cpp
@@ -728,6 +728,28 @@ void EditorWindow::loadProjectFile(QString fileName)
project = new ProjectModel(fileName, this);
ui->projectTree->setModel(project);
+ /* Setting target info if necessary */
+ TargetData targets;
+ QString target = project->getSetting("#target", "");
+ if(target != "" && targets.index(target) >= 0)
+ {
+ int index = targets.index(target);
+
+ QRect screen = targets.screenSize(index);
+ deviceConfig->setData("screenwidth", screen.width());
+ deviceConfig->setData("screenheight", screen.height());
+
+ if(targets.remoteDepth(index) != TargetData::None)
+ {
+ QRect remote = targets.remoteSize(index);
+ deviceConfig->setData("remotewidth", remote.width());
+ deviceConfig->setData("remoteheight", remote.height());
+ }
+
+ deviceConfig->setData("tp", targets.fm(index));
+ deviceConfig->setData("Rp", targets.canRecord(index));
+ }
+
if(project->getSetting("#screenwidth") != "")
deviceConfig->setData("screenwidth",
project->getSetting("#screenwidth"));
diff --git a/utils/themeeditor/models/targetdata.cpp b/utils/themeeditor/models/targetdata.cpp
index a20a4cf18f..70d231988b 100644
--- a/utils/themeeditor/models/targetdata.cpp
+++ b/utils/themeeditor/models/targetdata.cpp
@@ -49,6 +49,7 @@ TargetData::TargetData(QString file)
QRect rSize(0, 0, 0, 0);
ScreenDepth rDepth = None;
bool fm = false;
+ bool record = false;
if(id == "")
break;
@@ -119,13 +120,19 @@ TargetData::TargetData(QString file)
if(s.toLower() == "yes")
fm = true;
}
+ else if(key.toLower() == "record")
+ {
+ QString s = scanString(data, cursor);
+ if(s.toLower() == "yes")
+ record = true;
+ }
}
}
/* Checking for the closing '}' and adding the entry */
if(require('}', data, cursor))
{
- entries.append(Entry(name, size, depth, rSize, rDepth, fm));
+ entries.append(Entry(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 ef7ac5c8a9..09276c5966 100644
--- a/utils/themeeditor/models/targetdata.h
+++ b/utils/themeeditor/models/targetdata.h
@@ -52,14 +52,15 @@ public:
ScreenDepth screenDepth(int index){ return entries[index].depth; }
ScreenDepth remoteDepth(int index){ return entries[index].rDepth; }
bool fm(int index){ return entries[index].fm; }
+ bool canRecord(int index){ return entries[index].record; }
private:
struct Entry
{
Entry(QString name, QRect size, ScreenDepth depth, QRect rSize,
- ScreenDepth rDepth, bool fm)
+ ScreenDepth rDepth, bool fm, bool record)
: name(name), size(size), depth(depth), rSize(rSize),
- rDepth(rDepth), fm(fm){ }
+ rDepth(rDepth), fm(fm), record(record){ }
QString name;
QRect size;
@@ -67,6 +68,7 @@ private:
QRect rSize;
ScreenDepth rDepth;
bool fm;
+ bool record;
};
static const QString reserved;
diff --git a/utils/themeeditor/resources/targetdb b/utils/themeeditor/resources/targetdb
index 414e8f03f3..fa0b33cacc 100644
--- a/utils/themeeditor/resources/targetdb
+++ b/utils/themeeditor/resources/targetdb
@@ -4,6 +4,7 @@ ipod12
screen : 160 x 128 @ grey
fm : no
remote : no
+ record : yes
}
ipod3
@@ -12,6 +13,7 @@ ipod3
screen : 160 x 128 @ grey
fm : no
remote : no
+ record : yes
}
ipod4
@@ -20,6 +22,7 @@ ipod4
screen : 160 x 128 @ grey
fm : no
remote : no
+ record : yes
}
ipodmini12
@@ -28,6 +31,7 @@ ipodmini12
screen : 138 x 110 @ grey
fm : no
remote : no
+ record : yes
}
ipodcolor
@@ -36,6 +40,7 @@ ipodcolor
screen : 220 x 176 @ rgb
fm : no
remote : no
+ record : yes
}
ipodnano1
@@ -44,6 +49,7 @@ ipodnano1
screen : 176 x 132 @ rgb
fm : no
remote : no
+ record : yes
}
ipodvideo
@@ -52,6 +58,7 @@ ipodvideo
screen : 320 x 240 @ rgb
fm : no
remote : no
+ record : yes
}
# Olympus units
@@ -62,6 +69,7 @@ mrobe100
screen : 160 x 128 @ mono
fm : no
remote : 79 x 16 @ mono
+ record : yes
}
mrobe500
@@ -70,4 +78,5 @@ mrobe500
screen : 640 x 480 @ rgb
fm : no
remote : 79 x 16 @ mono
+ record : yes
}