summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-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)
728 project = new ProjectModel(fileName, this); 728 project = new ProjectModel(fileName, this);
729 ui->projectTree->setModel(project); 729 ui->projectTree->setModel(project);
730 730
731 /* Setting target info if necessary */
732 TargetData targets;
733 QString target = project->getSetting("#target", "");
734 if(target != "" && targets.index(target) >= 0)
735 {
736 int index = targets.index(target);
737
738 QRect screen = targets.screenSize(index);
739 deviceConfig->setData("screenwidth", screen.width());
740 deviceConfig->setData("screenheight", screen.height());
741
742 if(targets.remoteDepth(index) != TargetData::None)
743 {
744 QRect remote = targets.remoteSize(index);
745 deviceConfig->setData("remotewidth", remote.width());
746 deviceConfig->setData("remoteheight", remote.height());
747 }
748
749 deviceConfig->setData("tp", targets.fm(index));
750 deviceConfig->setData("Rp", targets.canRecord(index));
751 }
752
731 if(project->getSetting("#screenwidth") != "") 753 if(project->getSetting("#screenwidth") != "")
732 deviceConfig->setData("screenwidth", 754 deviceConfig->setData("screenwidth",
733 project->getSetting("#screenwidth")); 755 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)
49 QRect rSize(0, 0, 0, 0); 49 QRect rSize(0, 0, 0, 0);
50 ScreenDepth rDepth = None; 50 ScreenDepth rDepth = None;
51 bool fm = false; 51 bool fm = false;
52 bool record = false;
52 53
53 if(id == "") 54 if(id == "")
54 break; 55 break;
@@ -119,13 +120,19 @@ TargetData::TargetData(QString file)
119 if(s.toLower() == "yes") 120 if(s.toLower() == "yes")
120 fm = true; 121 fm = true;
121 } 122 }
123 else if(key.toLower() == "record")
124 {
125 QString s = scanString(data, cursor);
126 if(s.toLower() == "yes")
127 record = true;
128 }
122 } 129 }
123 } 130 }
124 131
125 /* Checking for the closing '}' and adding the entry */ 132 /* Checking for the closing '}' and adding the entry */
126 if(require('}', data, cursor)) 133 if(require('}', data, cursor))
127 { 134 {
128 entries.append(Entry(name, size, depth, rSize, rDepth, fm)); 135 entries.append(Entry(name, size, depth, rSize, rDepth, fm, record));
129 indices.insert(id, index); 136 indices.insert(id, index);
130 index++; 137 index++;
131 } 138 }
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:
52 ScreenDepth screenDepth(int index){ return entries[index].depth; } 52 ScreenDepth screenDepth(int index){ return entries[index].depth; }
53 ScreenDepth remoteDepth(int index){ return entries[index].rDepth; } 53 ScreenDepth remoteDepth(int index){ return entries[index].rDepth; }
54 bool fm(int index){ return entries[index].fm; } 54 bool fm(int index){ return entries[index].fm; }
55 bool canRecord(int index){ return entries[index].record; }
55 56
56private: 57private:
57 struct Entry 58 struct Entry
58 { 59 {
59 Entry(QString name, QRect size, ScreenDepth depth, QRect rSize, 60 Entry(QString name, QRect size, ScreenDepth depth, QRect rSize,
60 ScreenDepth rDepth, bool fm) 61 ScreenDepth rDepth, bool fm, bool record)
61 : name(name), size(size), depth(depth), rSize(rSize), 62 : name(name), size(size), depth(depth), rSize(rSize),
62 rDepth(rDepth), fm(fm){ } 63 rDepth(rDepth), fm(fm), record(record){ }
63 64
64 QString name; 65 QString name;
65 QRect size; 66 QRect size;
@@ -67,6 +68,7 @@ private:
67 QRect rSize; 68 QRect rSize;
68 ScreenDepth rDepth; 69 ScreenDepth rDepth;
69 bool fm; 70 bool fm;
71 bool record;
70 }; 72 };
71 73
72 static const QString reserved; 74 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
4 screen : 160 x 128 @ grey 4 screen : 160 x 128 @ grey
5 fm : no 5 fm : no
6 remote : no 6 remote : no
7 record : yes
7} 8}
8 9
9ipod3 10ipod3
@@ -12,6 +13,7 @@ ipod3
12 screen : 160 x 128 @ grey 13 screen : 160 x 128 @ grey
13 fm : no 14 fm : no
14 remote : no 15 remote : no
16 record : yes
15} 17}
16 18
17ipod4 19ipod4
@@ -20,6 +22,7 @@ ipod4
20 screen : 160 x 128 @ grey 22 screen : 160 x 128 @ grey
21 fm : no 23 fm : no
22 remote : no 24 remote : no
25 record : yes
23} 26}
24 27
25ipodmini12 28ipodmini12
@@ -28,6 +31,7 @@ ipodmini12
28 screen : 138 x 110 @ grey 31 screen : 138 x 110 @ grey
29 fm : no 32 fm : no
30 remote : no 33 remote : no
34 record : yes
31} 35}
32 36
33ipodcolor 37ipodcolor
@@ -36,6 +40,7 @@ ipodcolor
36 screen : 220 x 176 @ rgb 40 screen : 220 x 176 @ rgb
37 fm : no 41 fm : no
38 remote : no 42 remote : no
43 record : yes
39} 44}
40 45
41ipodnano1 46ipodnano1
@@ -44,6 +49,7 @@ ipodnano1
44 screen : 176 x 132 @ rgb 49 screen : 176 x 132 @ rgb
45 fm : no 50 fm : no
46 remote : no 51 remote : no
52 record : yes
47} 53}
48 54
49ipodvideo 55ipodvideo
@@ -52,6 +58,7 @@ ipodvideo
52 screen : 320 x 240 @ rgb 58 screen : 320 x 240 @ rgb
53 fm : no 59 fm : no
54 remote : no 60 remote : no
61 record : yes
55} 62}
56 63
57# Olympus units 64# Olympus units
@@ -62,6 +69,7 @@ mrobe100
62 screen : 160 x 128 @ mono 69 screen : 160 x 128 @ mono
63 fm : no 70 fm : no
64 remote : 79 x 16 @ mono 71 remote : 79 x 16 @ mono
72 record : yes
65} 73}
66 74
67mrobe500 75mrobe500
@@ -70,4 +78,5 @@ mrobe500
70 screen : 640 x 480 @ rgb 78 screen : 640 x 480 @ rgb
71 fm : no 79 fm : no
72 remote : 79 x 16 @ mono 80 remote : 79 x 16 @ mono
81 record : yes
73} 82}