summaryrefslogtreecommitdiff
path: root/rbutil
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil')
-rw-r--r--rbutil/rbutilqt/configure.cpp112
-rw-r--r--rbutil/rbutilqt/configure.h4
-rw-r--r--rbutil/rbutilqt/configurefrm.ui142
-rw-r--r--rbutil/rbutilqt/rbutil.ini109
-rw-r--r--rbutil/rbutilqt/rbutilqt.cpp62
-rw-r--r--rbutil/rbutilqt/rbutilqt.h3
-rw-r--r--rbutil/rbutilqt/rbutilqtfrm.ui243
7 files changed, 382 insertions, 293 deletions
diff --git a/rbutil/rbutilqt/configure.cpp b/rbutil/rbutilqt/configure.cpp
index e92234527b..cef996ec56 100644
--- a/rbutil/rbutilqt/configure.cpp
+++ b/rbutil/rbutilqt/configure.cpp
@@ -60,15 +60,15 @@ Config::Config(QWidget *parent) : QDialog(parent)
60 connect(ui.buttonCancel, SIGNAL(clicked()), this, SLOT(abort())); 60 connect(ui.buttonCancel, SIGNAL(clicked()), this, SLOT(abort()));
61 connect(ui.radioNoProxy, SIGNAL(toggled(bool)), this, SLOT(setNoProxy(bool))); 61 connect(ui.radioNoProxy, SIGNAL(toggled(bool)), this, SLOT(setNoProxy(bool)));
62 connect(ui.radioSystemProxy, SIGNAL(toggled(bool)), this, SLOT(setSystemProxy(bool))); 62 connect(ui.radioSystemProxy, SIGNAL(toggled(bool)), this, SLOT(setSystemProxy(bool)));
63 connect(ui.browseMountPoint, SIGNAL(clicked()), this, SLOT(browseFolder()));
63 64
64 // disable unimplemented stuff 65 // disable unimplemented stuff
65 ui.buttonCacheBrowse->setEnabled(false); 66 ui.buttonCacheBrowse->setEnabled(false);
66 ui.cacheDisable->setEnabled(false); 67 ui.cacheDisable->setEnabled(false);
67 ui.cacheOfflineMode->setEnabled(false); 68 ui.cacheOfflineMode->setEnabled(false);
68 ui.buttonCacheClear->setEnabled(false); 69 ui.buttonCacheClear->setEnabled(false);
69 ui.scrobblerUser->setEnabled(false); 70
70 ui.scrobblerPass->setEnabled(false); 71 ui.buttonAutodetect->setEnabled(false);
71 ui.scrobblerTimezone->setEnabled(false);
72} 72}
73 73
74 74
@@ -115,6 +115,7 @@ void Config::abort()
115void Config::setUserSettings(QSettings *user) 115void Config::setUserSettings(QSettings *user)
116{ 116{
117 userSettings = user; 117 userSettings = user;
118 // set proxy
118 QUrl proxy = userSettings->value("defaults/proxy").toString(); 119 QUrl proxy = userSettings->value("defaults/proxy").toString();
119 120
120 ui.proxyPort->setText(QString("%1").arg(proxy.port())); 121 ui.proxyPort->setText(QString("%1").arg(proxy.port()));
@@ -145,6 +146,94 @@ void Config::setUserSettings(QSettings *user)
145 if(a.size() > 0) 146 if(a.size() > 0)
146 ui.listLanguages->setCurrentItem(a.at(0)); 147 ui.listLanguages->setCurrentItem(a.at(0));
147 148
149 // devices tab
150 ui.mountPoint->setText(userSettings->value("defaults/mountpoint").toString());
151
152}
153
154
155void Config::setDevices(QSettings *dev)
156{
157 devices = dev;
158 // setup devices table
159 qDebug() << "Config::setDevices()";
160 devices->beginGroup("platforms");
161 QStringList a = devices->childKeys();
162 devices->endGroup();
163
164 QMap <QString, QString> manuf;
165 QMap <QString, QString> devcs;
166 for(int it = 0; it < a.size(); it++) {
167 QString curdev;
168 devices->beginGroup("platforms");
169 curdev = devices->value(a.at(it), "null").toString();
170 devices->endGroup();
171 QString curname;
172 devices->beginGroup(curdev);
173 curname = devices->value("name", "null").toString();
174 QString curbrand = devices->value("brand", "").toString();
175 devices->endGroup();
176 manuf.insertMulti(curbrand, curdev);
177 devcs.insert(curdev, curname);
178 }
179
180 QString platform;
181 platform = devcs.value(userSettings->value("defaults/platform").toString());
182
183 // set up devices table
184 ui.treeDevices->header()->hide();
185 ui.treeDevices->expandAll();
186 ui.treeDevices->setColumnCount(1);
187 QList<QTreeWidgetItem *> items;
188
189 // get manufacturers
190 QStringList brands = manuf.uniqueKeys();
191 QTreeWidgetItem *w;
192 QTreeWidgetItem *w2;
193 QTreeWidgetItem *w3;
194 for(int c = 0; c < brands.size(); c++) {
195 qDebug() << brands.at(c);
196 w = new QTreeWidgetItem();
197 w->setFlags(Qt::ItemIsEnabled);
198 w->setText(0, brands.at(c));
199// w->setData(0, Qt::DecorationRole, <icon>);
200 items.append(w);
201
202 // go through platforms again for sake of order
203 for(int it = 0; it < a.size(); it++) {
204 QString curdev;
205 devices->beginGroup("platforms");
206 curdev = devices->value(a.at(it), "null").toString();
207 devices->endGroup();
208 QString curname;
209 devices->beginGroup(curdev);
210 curname = devices->value("name", "null").toString();
211 QString curbrand = devices->value("brand", "").toString();
212 devices->endGroup();
213 if(curbrand != brands.at(c)) continue;
214 qDebug() << "adding:" << brands.at(c) << curname << curdev;
215 w2 = new QTreeWidgetItem(w, QStringList(curname));
216 w2->setData(0, Qt::UserRole, curdev);
217 if(platform.contains(curname)) {
218 w2->setSelected(true);
219 w->setExpanded(true);
220 w3 = w2; // save pointer to hilight old selection
221 }
222 items.append(w2);
223 }
224 }
225 ui.treeDevices->insertTopLevelItems(0, items);
226 ui.treeDevices->setCurrentItem(w3); // hilight old selection
227 connect(ui.treeDevices, SIGNAL(itemSelectionChanged()), this, SLOT(updatePlatform()));
228}
229
230
231void Config::updatePlatform()
232{
233 qDebug() << "updatePlatform()";
234 QString nplat;
235 nplat = ui.treeDevices->selectedItems().at(0)->data(0, Qt::UserRole).toString();
236 userSettings->setValue("defaults/platform", nplat);
148} 237}
149 238
150 239
@@ -227,3 +316,20 @@ void Config::updateLanguage()
227} 316}
228 317
229 318
319void Config::browseFolder()
320{
321 QFileDialog browser(this);
322 if(QFileInfo(ui.mountPoint->text()).isDir())
323 browser.setDirectory(ui.mountPoint->text());
324 else
325 browser.setDirectory("/media");
326 browser.setReadOnly(true);
327 browser.setFileMode(QFileDialog::DirectoryOnly);
328 browser.setAcceptMode(QFileDialog::AcceptOpen);
329 if(browser.exec()) {
330 qDebug() << browser.directory();
331 QStringList files = browser.selectedFiles();
332 ui.mountPoint->setText(files.at(0));
333 userSettings->setValue("defaults/mountpoint", files.at(0));
334 }
335}
diff --git a/rbutil/rbutilqt/configure.h b/rbutil/rbutilqt/configure.h
index 20ae4092bf..dee1e0659a 100644
--- a/rbutil/rbutilqt/configure.h
+++ b/rbutil/rbutilqt/configure.h
@@ -29,6 +29,7 @@ class Config : public QDialog
29 public: 29 public:
30 Config(QWidget *parent = 0); 30 Config(QWidget *parent = 0);
31 void setUserSettings(QSettings*); 31 void setUserSettings(QSettings*);
32 void setDevices(QSettings*);
32 33
33 signals: 34 signals:
34 void settingsUpdated(void); 35 void settingsUpdated(void);
@@ -40,6 +41,7 @@ class Config : public QDialog
40 private: 41 private:
41 Ui::ConfigForm ui; 42 Ui::ConfigForm ui;
42 QSettings *userSettings; 43 QSettings *userSettings;
44 QSettings *devices;
43 QStringList findLanguageFiles(void); 45 QStringList findLanguageFiles(void);
44 QString languageName(const QString&); 46 QString languageName(const QString&);
45 QMap<QString, QString> lang; 47 QMap<QString, QString> lang;
@@ -51,6 +53,8 @@ class Config : public QDialog
51 void setNoProxy(bool); 53 void setNoProxy(bool);
52 void setSystemProxy(bool); 54 void setSystemProxy(bool);
53 void updateLanguage(void); 55 void updateLanguage(void);
56 void browseFolder(void);
57 void updatePlatform(void);
54}; 58};
55 59
56#endif 60#endif
diff --git a/rbutil/rbutilqt/configurefrm.ui b/rbutil/rbutilqt/configurefrm.ui
index 8310c71ae7..da0a1c1574 100644
--- a/rbutil/rbutilqt/configurefrm.ui
+++ b/rbutil/rbutilqt/configurefrm.ui
@@ -5,8 +5,8 @@
5 <rect> 5 <rect>
6 <x>0</x> 6 <x>0</x>
7 <y>0</y> 7 <y>0</y>
8 <width>476</width> 8 <width>500</width>
9 <height>384</height> 9 <height>400</height>
10 </rect> 10 </rect>
11 </property> 11 </property>
12 <property name="windowTitle" > 12 <property name="windowTitle" >
@@ -58,6 +58,79 @@
58 <property name="currentIndex" > 58 <property name="currentIndex" >
59 <number>0</number> 59 <number>0</number>
60 </property> 60 </property>
61 <widget class="QWidget" name="tabDevice" >
62 <attribute name="title" >
63 <string>&amp;Device</string>
64 </attribute>
65 <layout class="QGridLayout" >
66 <item row="0" column="0" >
67 <widget class="QLabel" name="labelMountPoint" >
68 <property name="text" >
69 <string>Select your device in the &amp;filesystem</string>
70 </property>
71 <property name="buddy" >
72 <cstring>mountPoint</cstring>
73 </property>
74 </widget>
75 </item>
76 <item row="1" column="0" colspan="2" >
77 <layout class="QHBoxLayout" >
78 <item>
79 <widget class="QLineEdit" name="mountPoint" />
80 </item>
81 <item>
82 <widget class="QPushButton" name="browseMountPoint" >
83 <property name="text" >
84 <string>&amp;Browse</string>
85 </property>
86 <property name="icon" >
87 <iconset resource="rbutilqt.qrc" >:/icons/icons/system-search.png</iconset>
88 </property>
89 </widget>
90 </item>
91 </layout>
92 </item>
93 <item row="2" column="0" >
94 <widget class="QLabel" name="labelPlayer" >
95 <property name="text" >
96 <string>&amp;Select your audio player</string>
97 </property>
98 <property name="buddy" >
99 <cstring>treeDevices</cstring>
100 </property>
101 </widget>
102 </item>
103 <item row="3" column="0" colspan="2" >
104 <widget class="QTreeWidget" name="treeDevices" >
105 <column>
106 <property name="text" >
107 <string>1</string>
108 </property>
109 </column>
110 </widget>
111 </item>
112 <item row="4" column="0" >
113 <spacer>
114 <property name="orientation" >
115 <enum>Qt::Horizontal</enum>
116 </property>
117 <property name="sizeHint" >
118 <size>
119 <width>40</width>
120 <height>20</height>
121 </size>
122 </property>
123 </spacer>
124 </item>
125 <item row="4" column="1" >
126 <widget class="QPushButton" name="buttonAutodetect" >
127 <property name="text" >
128 <string>&amp;Autodetect</string>
129 </property>
130 </widget>
131 </item>
132 </layout>
133 </widget>
61 <widget class="QWidget" name="tabProxy" > 134 <widget class="QWidget" name="tabProxy" >
62 <attribute name="title" > 135 <attribute name="title" >
63 <string>&amp;Proxy</string> 136 <string>&amp;Proxy</string>
@@ -183,7 +256,7 @@
183 </widget> 256 </widget>
184 <widget class="QWidget" name="tabCache" > 257 <widget class="QWidget" name="tabCache" >
185 <attribute name="title" > 258 <attribute name="title" >
186 <string>C&amp;ache</string> 259 <string>Cac&amp;he</string>
187 </attribute> 260 </attribute>
188 <attribute name="toolTip" > 261 <attribute name="toolTip" >
189 <string>Download cache settings</string> 262 <string>Download cache settings</string>
@@ -286,69 +359,6 @@
286 </item> 359 </item>
287 </layout> 360 </layout>
288 </widget> 361 </widget>
289 <widget class="QWidget" name="tabScrobbler" >
290 <attribute name="title" >
291 <string>&amp;Scrobbler</string>
292 </attribute>
293 <layout class="QGridLayout" >
294 <item row="0" column="0" >
295 <widget class="QLabel" name="label_8" >
296 <property name="text" >
297 <string>&amp;Username</string>
298 </property>
299 <property name="buddy" >
300 <cstring>scrobblerUser</cstring>
301 </property>
302 </widget>
303 </item>
304 <item row="0" column="1" >
305 <widget class="QLineEdit" name="scrobblerUser" />
306 </item>
307 <item row="1" column="0" >
308 <widget class="QLabel" name="label_9" >
309 <property name="text" >
310 <string>P&amp;assword</string>
311 </property>
312 <property name="buddy" >
313 <cstring>scrobblerPass</cstring>
314 </property>
315 </widget>
316 </item>
317 <item row="1" column="1" >
318 <widget class="QLineEdit" name="scrobblerPass" >
319 <property name="echoMode" >
320 <enum>QLineEdit::Password</enum>
321 </property>
322 </widget>
323 </item>
324 <item row="2" column="0" >
325 <widget class="QLabel" name="label_10" >
326 <property name="text" >
327 <string>&amp;Timezone</string>
328 </property>
329 <property name="buddy" >
330 <cstring>scrobblerTimezone</cstring>
331 </property>
332 </widget>
333 </item>
334 <item row="2" column="1" >
335 <widget class="QComboBox" name="scrobblerTimezone" />
336 </item>
337 <item row="4" column="1" >
338 <spacer>
339 <property name="orientation" >
340 <enum>Qt::Vertical</enum>
341 </property>
342 <property name="sizeHint" >
343 <size>
344 <width>20</width>
345 <height>40</height>
346 </size>
347 </property>
348 </spacer>
349 </item>
350 </layout>
351 </widget>
352 </widget> 362 </widget>
353 </item> 363 </item>
354 </layout> 364 </layout>
diff --git a/rbutil/rbutilqt/rbutil.ini b/rbutil/rbutilqt/rbutil.ini
index 4542c3bbc5..c3d962952a 100644
--- a/rbutil/rbutilqt/rbutil.ini
+++ b/rbutil/rbutilqt/rbutil.ini
@@ -3,6 +3,7 @@ download_url=http://www.rockbox.org/download/
3daily_url=http://download.rockbox.org/daily/ 3daily_url=http://download.rockbox.org/daily/
4bleeding_url=http://build.rockbox.org/dist/build- 4bleeding_url=http://build.rockbox.org/dist/build-
5server_conf_url=http://www.rockbox.org/daily/build-info 5server_conf_url=http://www.rockbox.org/daily/build-info
6bleeding_info=http://build.rockbox.org/cvsmod/build-info
6font_url=http://www.rockbox.org/daily/fonts/rockbox-fonts.zip 7font_url=http://www.rockbox.org/daily/fonts/rockbox-fonts.zip
7last_release=2.5 8last_release=2.5
8prog_name=rockbox 9prog_name=rockbox
@@ -41,7 +42,7 @@ platform40=gigabeatf
41platform50=sansae200 42platform50=sansae200
42 43
43[player] 44[player]
44name="Archos Jukebox Player 6000 / Jukebox Studio 5/10/20" 45name="Jukebox Player 6000 / Jukebox Studio 5/10/20"
45platform=player 46platform=player
46released=yes 47released=yes
47needsbootloader=no 48needsbootloader=no
@@ -49,10 +50,10 @@ bootloadermethod=
49bootloadername= 50bootloadername=
50resolution=11x2x1 51resolution=11x2x1
51manualname= 52manualname=
52brand=archos 53brand=Archos
53 54
54[recorder] 55[recorder]
55name="Archos Jukebox Recorder 10 / 20" 56name="Jukebox Recorder 10 / 20"
56platform=recorder 57platform=recorder
57released=yes 58released=yes
58needsbootloader=no 59needsbootloader=no
@@ -60,10 +61,10 @@ bootloadermethod=
60bootloadername= 61bootloadername=
61resolution=112x64x1 62resolution=112x64x1
62manualname= 63manualname=
63brand=archos 64brand=Archos
64 65
65[recorder8mb] 66[recorder8mb]
66name="Archos Jukebox Recorder 10 / 20 (with 8mb memory)" 67name="Jukebox Recorder 10 / 20 (with 8mb memory)"
67platform=recorder8mb 68platform=recorder8mb
68released=no 69released=no
69needsbootloader=no 70needsbootloader=no
@@ -71,10 +72,10 @@ bootloadermethod=
71bootloadername= 72bootloadername=
72resolution=112x64x1 73resolution=112x64x1
73manualname=rockbox-recorder 74manualname=rockbox-recorder
74brand=archos 75brand=Archos
75 76
76[recorderv2] 77[recorderv2]
77name="Archos Jukebox Recorder v2 (20GB)" 78name="Jukebox Recorder v2 (20GB)"
78platform=recorderv2 79platform=recorderv2
79released=yes 80released=yes
80needsbootloader=no 81needsbootloader=no
@@ -82,10 +83,10 @@ bootloadermethod=
82bootloadername= 83bootloadername=
83resolution=112x64x1 84resolution=112x64x1
84manualname= 85manualname=
85brand=archos 86brand=Archos
86 87
87[fmrecorder] 88[fmrecorder]
88name="Archos Jukebox Recorder FM" 89name="Jukebox Recorder FM"
89platform=fmrecorder 90platform=fmrecorder
90released=yes 91released=yes
91needsbootloader=no 92needsbootloader=no
@@ -93,10 +94,10 @@ bootloadermethod=
93bootloadername= 94bootloadername=
94resolution=112x64x1 95resolution=112x64x1
95manualname= 96manualname=
96brand=archos 97brand=Archos
97 98
98[fmrecorder8mb] 99[fmrecorder8mb]
99name="Archos Jukebox Recorder FM (with 8mb memory)" 100name="Jukebox Recorder FM (with 8mb memory)"
100platform=fmrecorder8mb 101platform=fmrecorder8mb
101released=no 102released=no
102needsbootloader=no 103needsbootloader=no
@@ -104,10 +105,10 @@ bootloadermethod=
104bootloadername= 105bootloadername=
105resolution=112x64x1 106resolution=112x64x1
106manualname=rockbox-fmrecorder 107manualname=rockbox-fmrecorder
107brand=archos 108brand=Archos
108 109
109[ondiosp] 110[ondiosp]
110name="Archos Ondio SP" 111name="Ondio SP"
111platform=ondiosp 112platform=ondiosp
112released=yes 113released=yes
113needsbootloader=no 114needsbootloader=no
@@ -115,10 +116,10 @@ bootloadermethod=
115bootloadername= 116bootloadername=
116resolution=112x64x1 117resolution=112x64x1
117manualname= 118manualname=
118brand=archos 119brand=Archos
119 120
120[ondiofm] 121[ondiofm]
121name="Archos Ondio FM" 122name="Ondio FM"
122platform=ondiofm 123platform=ondiofm
123released=yes 124released=yes
124needsbootloader=no 125needsbootloader=no
@@ -126,10 +127,10 @@ bootloadermethod=
126bootloadername= 127bootloadername=
127resolution=112x64x1 128resolution=112x64x1
128manualname= 129manualname=
129brand=archos 130brand=Archos
130 131
131[h100] 132[h100]
132name="Iriver iHP100 / iHP110" 133name="iHP100 / iHP110"
133platform=h100 134platform=h100
134released=no 135released=no
135needsbootloader=yes 136needsbootloader=yes
@@ -137,10 +138,10 @@ bootloadermethod=fwpatcher
137bootloadername=bootloader-h100.bin 138bootloadername=bootloader-h100.bin
138resolution=160x128x2 139resolution=160x128x2
139manualname=rockbox-h100 140manualname=rockbox-h100
140brand=iriver 141brand=Iriver
141 142
142[h120] 143[h120]
143name="Iriver iHP120 / iHP140 / H120 / H140" 144name="iHP120 / iHP140 / H120 / H140"
144platform=h120 145platform=h120
145released=no 146released=no
146needsbootloader=yes 147needsbootloader=yes
@@ -148,10 +149,10 @@ bootloadermethod=fwpatcher
148bootloadername=bootloader-h120.bin 149bootloadername=bootloader-h120.bin
149resolution=160x128x2 150resolution=160x128x2
150manualname=rockbox-h100 151manualname=rockbox-h100
151brand=iriver 152brand=Iriver
152 153
153[h300] 154[h300]
154name="Iriver H320 / H340" 155name="H320 / H340"
155platform=h300 156platform=h300
156released=no 157released=no
157needsbootloader=yes 158needsbootloader=yes
@@ -159,10 +160,10 @@ bootloadermethod=fwpatcher
159bootloadername=bootloader-h300.bin 160bootloadername=bootloader-h300.bin
160resolution=220x176x16 161resolution=220x176x16
161manualname=rockbox-h300 162manualname=rockbox-h300
162brand=iriver 163brand=Iriver
163 164
164[h10_5gbums] 165[h10_5gbums]
165name="Iriver H10 (5 / 6GB) UMS" 166name="H10 (5 / 6GB) UMS"
166platform=h10_5gb 167platform=h10_5gb
167released=no 168released=no
168needsbootloader=yes 169needsbootloader=yes
@@ -170,10 +171,10 @@ bootloadermethod=h10
170bootloadername=H10.mi4 171bootloadername=H10.mi4
171resolution=128x128x16 172resolution=128x128x16
172manualname= 173manualname=
173brand=iriver 174brand=Iriver
174 175
175[h10_5gbmtp] 176[h10_5gbmtp]
176name="Iriver H10 (5 / 6GB) MTP" 177name="H10 (5 / 6GB) MTP"
177platform=h10_5gb 178platform=h10_5gb
178released=no 179released=no
179needsbootloader=yes 180needsbootloader=yes
@@ -181,10 +182,10 @@ bootloadermethod=h10
181bootloadername=H10_5GB-MTP/H10.mi4 182bootloadername=H10_5GB-MTP/H10.mi4
182resolution=128x128x16 183resolution=128x128x16
183manualname= 184manualname=
184brand=iriver 185brand=Iriver
185 186
186[h10] 187[h10]
187name="Iriver H10 (20GB)" 188name="H10 (20GB)"
188platform=h10 189platform=h10
189released=no 190released=no
190needsbootloader=yes 191needsbootloader=yes
@@ -192,10 +193,10 @@ bootloadermethod=h10
192bootloadername=H10_20GC.mi4 193bootloadername=H10_20GC.mi4
193resolution=160x128x16 194resolution=160x128x16
194manualname= 195manualname=
195brand=iriver 196brand=Iriver
196 197
197[ipod1g2g] 198[ipod1g2g]
198name="Apple Ipod (1st / 2nd gen)" 199name="Ipod (1st / 2nd gen)"
199platform=ipod1g2g 200platform=ipod1g2g
200released=no 201released=no
201needsbootloader=yes 202needsbootloader=yes
@@ -203,10 +204,10 @@ bootloadermethod=ipodpatcher
203bootloadername=ipod1g2g 204bootloadername=ipod1g2g
204resolution=160x128x2 205resolution=160x128x2
205manualname= 206manualname=
206brand=apple 207brand=Apple
207 208
208[ipodcolor] 209[ipodcolor]
209name="Apple Ipod Colour / Photo / U2 (4th gen)" 210name="Ipod Colour / Photo / U2 (4th gen)"
210platform=ipodcolor 211platform=ipodcolor
211released=no 212released=no
212needsbootloader=yes 213needsbootloader=yes
@@ -214,10 +215,10 @@ bootloadermethod=ipodpatcher
214bootloadername=ipodcolor 215bootloadername=ipodcolor
215resolution=220x176x16 216resolution=220x176x16
216manualname= 217manualname=
217brand=apple 218brand=Apple
218 219
219[ipodnano] 220[ipodnano]
220name="Apple Ipod Nano (1st gen)" 221name="Ipod Nano (1st gen)"
221platform=ipodnano 222platform=ipodnano
222released=no 223released=no
223needsbootloader=yes 224needsbootloader=yes
@@ -225,10 +226,10 @@ bootloadermethod=ipodpatcher
225bootloadername=ipodnano 226bootloadername=ipodnano
226resolution=176x132x16 227resolution=176x132x16
227manualname= 228manualname=
228brand=apple 229brand=Apple
229 230
230[ipod4gray] 231[ipod4gray]
231name="Apple Ipod (4th gen, greyscale)" 232name="Ipod (4th gen, greyscale)"
232platform=ipod4gray 233platform=ipod4gray
233released=no 234released=no
234needsbootloader=yes 235needsbootloader=yes
@@ -236,10 +237,10 @@ bootloadermethod=ipodpatcher
236bootloadername=ipod4g 237bootloadername=ipod4g
237resolution=160x128x2 238resolution=160x128x2
238manualname= 239manualname=
239brand=apple 240brand=Apple
240 241
241[ipodvideo] 242[ipodvideo]
242name="Apple Ipod Video (5th gen)" 243name="Ipod Video (5th gen)"
243platform=ipodvideo 244platform=ipodvideo
244released=no 245released=no
245needsbootloader=yes 246needsbootloader=yes
@@ -247,10 +248,10 @@ bootloadermethod=ipodpatcher
247bootloadername=ipodvideo 248bootloadername=ipodvideo
248resolution=320x240x16 249resolution=320x240x16
249manualname= 250manualname=
250brand=apple 251brand=Apple
251 252
252[ipod3g] 253[ipod3g]
253name="Apple Ipod (3rd gen)" 254name="Ipod (3rd gen)"
254platform=ipod3g 255platform=ipod3g
255released=no 256released=no
256needsbootloader=yes 257needsbootloader=yes
@@ -258,10 +259,10 @@ bootloadermethod=ipodpatcher
258bootloadername=ipod3g 259bootloadername=ipod3g
259resolution=160x128x2 260resolution=160x128x2
260manualname= 261manualname=
261brand=apple 262brand=Apple
262 263
263[ipodmini1g] 264[ipodmini1g]
264name="Apple Ipod Mini (1st gen)" 265name="Ipod Mini (1st gen)"
265platform=ipodmini1g 266platform=ipodmini1g
266released=no 267released=no
267needsbootloader=yes 268needsbootloader=yes
@@ -269,10 +270,10 @@ bootloadermethod=ipodpatcher
269bootloadername=ipodmini 270bootloadername=ipodmini
270resolution=138x110x2 271resolution=138x110x2
271manualname=rockbox-ipodmini2g 272manualname=rockbox-ipodmini2g
272brand=apple 273brand=Apple
273 274
274[ipodmini2g] 275[ipodmini2g]
275name="Apple Ipod Mini (2nd gen)" 276name="Ipod Mini (2nd gen)"
276platform=ipodmini2g 277platform=ipodmini2g
277released=no 278released=no
278needsbootloader=yes 279needsbootloader=yes
@@ -280,10 +281,10 @@ bootloadermethod=ipodpatcher
280bootloadername=ipodmini2g 281bootloadername=ipodmini2g
281resolution=138x110x2 282resolution=138x110x2
282manualname=rockbox-ipodmini2g 283manualname=rockbox-ipodmini2g
283brand=apple 284brand=Apple
284 285
285[iaudiox5] 286[iaudiox5]
286name="Cowon iAudio X5 / X5L" 287name="iAudio X5 / X5L"
287platform=iaudiox5 288platform=iaudiox5
288released=no 289released=no
289needsbootloader=yes 290needsbootloader=yes
@@ -291,10 +292,10 @@ bootloadermethod=iaudio
291bootloadername=x5_fw.bin 292bootloadername=x5_fw.bin
292resolution=160x128x16 293resolution=160x128x16
293manualname= 294manualname=
294brand=iaudio 295brand=Cowon
295 296
296[iaudiox5v] 297[iaudiox5v]
297name="Cowon iAudio X5V" 298name="iAudio X5V"
298platform=iaudiox5 299platform=iaudiox5
299released=no 300released=no
300needsbootloader=yes 301needsbootloader=yes
@@ -302,10 +303,10 @@ bootloadermethod=iaudio
302bootloadername=x5v_fw.bin 303bootloadername=x5v_fw.bin
303resolution=160x128x2 304resolution=160x128x2
304manualname= 305manualname=
305brand=iaudio 306brand=Cowon
306 307
307[iaudiom5] 308[iaudiom5]
308name="Cowon iAudio M5 / M5L" 309name="iAudio M5 / M5L"
309platform=iaudiom5 310platform=iaudiom5
310released=no 311released=no
311needsbootloader=yes 312needsbootloader=yes
@@ -313,20 +314,20 @@ bootloadermethod=iaudio
313bootloadername=m5_fw.bin 314bootloadername=m5_fw.bin
314resolution=160x128x16 315resolution=160x128x16
315manualname= 316manualname=
316brand=iaudio 317brand=Cowon
317 318
318[gigabeatf] 319[gigabeatf]
319name="Toshiba Gigabeat F / X" 320name="Gigabeat F / X"
320platform=gigabeatf 321platform=gigabeatf
321needsbootloader=yes 322needsbootloader=yes
322bootloadermethod=gigabeatf 323bootloadermethod=gigabeatf
323bootloadername=FWIMG01.DAT 324bootloadername=FWIMG01.DAT
324resolution=240x320x16 325resolution=240x320x16
325manualname= 326manualname=
326brand=toshiba 327brand=Toshiba
327 328
328[sansae200] 329[sansae200]
329name="Sandisk Sansa E200" 330name="Sansa E200"
330platform=sansae200 331platform=sansae200
331released=no 332released=no
332needsbootloader=yes 333needsbootloader=yes
@@ -334,5 +335,5 @@ bootloadermethod=sansapatcher
334bootloadername=PP5022.mi4 335bootloadername=PP5022.mi4
335resolution=176x220x16 336resolution=176x220x16
336manualname= 337manualname=
337brand=sandisk 338brand=Sandisk
338 339
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp
index 14f34824f7..2e82b31335 100644
--- a/rbutil/rbutilqt/rbutilqt.cpp
+++ b/rbutil/rbutilqt/rbutilqt.cpp
@@ -50,7 +50,6 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
50 } 50 }
51 51
52 ui.setupUi(this); 52 ui.setupUi(this);
53 initDeviceNames();
54 53
55 // portable installation: 54 // portable installation:
56 // check for a configuration file in the program folder. 55 // check for a configuration file in the program folder.
@@ -66,21 +65,16 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
66 QSettings::UserScope, "rockbox.org", "RockboxUtility"); 65 QSettings::UserScope, "rockbox.org", "RockboxUtility");
67 qDebug() << "config: system"; 66 qDebug() << "config: system";
68 } 67 }
69
70 userSettings->beginGroup("defaults");
71 platform = userSettings->value("platform").toString();
72 userSettings->endGroup();
73 ui.comboBoxDevice->setCurrentIndex(ui.comboBoxDevice->findData(platform));
74 updateDevice(ui.comboBoxDevice->currentIndex());
75 68
76 // manual tab 69 // manual tab
77 ui.buttonDownloadManual->setEnabled(false); 70 ui.buttonDownloadManual->setEnabled(false);
78 updateManual(); 71 updateManual();
72 updateDevice();
79 73
80 connect(ui.actionAbout_Qt, SIGNAL(triggered()), qApp, SLOT(aboutQt())); 74 connect(ui.actionAbout_Qt, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
81 connect(ui.action_About, SIGNAL(triggered()), this, SLOT(about())); 75 connect(ui.action_About, SIGNAL(triggered()), this, SLOT(about()));
82 connect(ui.action_Configure, SIGNAL(triggered()), this, SLOT(configDialog())); 76 connect(ui.action_Configure, SIGNAL(triggered()), this, SLOT(configDialog()));
83 connect(ui.comboBoxDevice, SIGNAL(currentIndexChanged(int)), this, SLOT(updateDevice(int))); 77 connect(ui.buttonChangeDevice, SIGNAL(clicked()), this, SLOT(configDialog()));
84 connect(ui.buttonRockbox, SIGNAL(clicked()), this, SLOT(install())); 78 connect(ui.buttonRockbox, SIGNAL(clicked()), this, SLOT(install()));
85 connect(ui.buttonBootloader, SIGNAL(clicked()), this, SLOT(installBl())); 79 connect(ui.buttonBootloader, SIGNAL(clicked()), this, SLOT(installBl()));
86 connect(ui.buttonFonts, SIGNAL(clicked()), this, SLOT(installFonts())); 80 connect(ui.buttonFonts, SIGNAL(clicked()), this, SLOT(installFonts()));
@@ -92,7 +86,6 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
92 ui.buttonRemoveRockbox->setEnabled(false); 86 ui.buttonRemoveRockbox->setEnabled(false);
93 ui.buttonRemoveBootloader->setEnabled(false); 87 ui.buttonRemoveBootloader->setEnabled(false);
94 ui.buttonComplete->setEnabled(false); 88 ui.buttonComplete->setEnabled(false);
95 ui.buttonDetect->setEnabled(false);
96 89
97 initIpodpatcher(); 90 initIpodpatcher();
98 downloadInfo(); 91 downloadInfo();
@@ -130,7 +123,8 @@ void RbUtilQt::downloadDone(bool error)
130void RbUtilQt::downloadDone(int id, bool error) 123void RbUtilQt::downloadDone(int id, bool error)
131{ 124{
132 QString errorString; 125 QString errorString;
133 errorString = tr("Network error: %1. Please check your network and proxy settings.").arg(daily->errorString()); 126 errorString = tr("Network error: %1. Please check your network and proxy settings.")
127 .arg(daily->errorString());
134 if(error) QMessageBox::about(this, "Network Error", errorString); 128 if(error) QMessageBox::about(this, "Network Error", errorString);
135 qDebug() << "downloadDone:" << id << error; 129 qDebug() << "downloadDone:" << id << error;
136} 130}
@@ -168,38 +162,25 @@ void RbUtilQt::configDialog()
168{ 162{
169 Config *cw = new Config(this); 163 Config *cw = new Config(this);
170 cw->setUserSettings(userSettings); 164 cw->setUserSettings(userSettings);
165 cw->setDevices(devices);
171 cw->show(); 166 cw->show();
172 connect(cw, SIGNAL(settingsUpdated()), this, SLOT(downloadInfo())); 167 connect(cw, SIGNAL(settingsUpdated()), this, SLOT(downloadInfo()));
168 connect(cw, SIGNAL(settingsUpdated()), this, SLOT(updateSettings()));
173} 169}
174 170
175 171
176void RbUtilQt::initDeviceNames() 172void RbUtilQt::updateSettings()
177{ 173{
178 qDebug() << "RbUtilQt::initDeviceNames()"; 174 qDebug() << "updateSettings()";
179 devices->beginGroup("platforms"); 175 updateDevice();
180 QStringList a = devices->childKeys(); 176 updateManual();
181 devices->endGroup();
182
183 for(int it = 0; it < a.size(); it++) {
184 QString curdev;
185 devices->beginGroup("platforms");
186 curdev = devices->value(a.at(it), "null").toString();
187 devices->endGroup();
188 QString curname;
189 devices->beginGroup(curdev);
190 curname = devices->value("name", "null").toString();
191 devices->endGroup();
192 ui.comboBoxDevice->addItem(curname, curdev);
193 }
194} 177}
195 178
196 179
197void RbUtilQt::updateDevice(int index) 180void RbUtilQt::updateDevice()
198{ 181{
199 platform = ui.comboBoxDevice->itemData(index).toString(); 182 platform = userSettings->value("defaults/platform").toString();
200 userSettings->setValue("defaults/platform", platform); 183 // buttons
201 userSettings->sync();
202
203 devices->beginGroup(platform); 184 devices->beginGroup(platform);
204 if(devices->value("needsbootloader", "") == "no") { 185 if(devices->value("needsbootloader", "") == "no") {
205 ui.buttonBootloader->setEnabled(false); 186 ui.buttonBootloader->setEnabled(false);
@@ -220,10 +201,15 @@ void RbUtilQt::updateDevice(int index)
220 } 201 }
221 } 202 }
222 devices->endGroup(); 203 devices->endGroup();
223 204 // displayed device info
224 qDebug() << "new device selected:" << platform; 205 platform = userSettings->value("defaults/platform").toString();
225 // update manual from here to make sure new device is already selected 206 QString mountpoint = userSettings->value("defaults/mountpoint").toString();
226 updateManual(); 207 devices->beginGroup(platform);
208 QString brand = devices->value("brand").toString();
209 QString name = devices->value("name").toString();
210 devices->endGroup();
211 ui.labelDevice->setText(tr("<b>%1 %2</b> at <b>%3</b>")
212 .arg(brand, name, mountpoint));
227} 213}
228 214
229 215
@@ -285,6 +271,7 @@ void RbUtilQt::install()
285 installWindow->show(); 271 installWindow->show();
286} 272}
287 273
274
288void RbUtilQt::installBl() 275void RbUtilQt::installBl()
289{ 276{
290 InstallBl *installWindow = new InstallBl(this); 277 InstallBl *installWindow = new InstallBl(this);
@@ -301,6 +288,7 @@ void RbUtilQt::installBl()
301 installWindow->show(); 288 installWindow->show();
302} 289}
303 290
291
304void RbUtilQt::installFonts() 292void RbUtilQt::installFonts()
305{ 293{
306 InstallZipWindow* installWindow = new InstallZipWindow(this); 294 InstallZipWindow* installWindow = new InstallZipWindow(this);
@@ -320,6 +308,7 @@ void RbUtilQt::installFonts()
320 308
321} 309}
322 310
311
323void RbUtilQt::installDoom() 312void RbUtilQt::installDoom()
324{ 313{
325 InstallZipWindow* installWindow = new InstallZipWindow(this); 314 InstallZipWindow* installWindow = new InstallZipWindow(this);
@@ -338,3 +327,4 @@ void RbUtilQt::installDoom()
338 installWindow->show(); 327 installWindow->show();
339 328
340} 329}
330
diff --git a/rbutil/rbutilqt/rbutilqt.h b/rbutil/rbutilqt/rbutilqt.h
index 86bde0cd99..dc22077511 100644
--- a/rbutil/rbutilqt/rbutilqt.h
+++ b/rbutil/rbutilqt/rbutilqt.h
@@ -48,7 +48,8 @@ class RbUtilQt : public QMainWindow
48 private slots: 48 private slots:
49 void about(void); 49 void about(void);
50 void configDialog(void); 50 void configDialog(void);
51 void updateDevice(int); 51 void updateDevice(void);
52 void updateSettings(void);
52 void install(void); 53 void install(void);
53 void installBl(void); 54 void installBl(void);
54 void installFonts(void); 55 void installFonts(void);
diff --git a/rbutil/rbutilqt/rbutilqtfrm.ui b/rbutil/rbutilqt/rbutilqtfrm.ui
index 3a5c6f7a7f..0d4cf7f7fe 100644
--- a/rbutil/rbutilqt/rbutilqtfrm.ui
+++ b/rbutil/rbutilqt/rbutilqtfrm.ui
@@ -5,8 +5,8 @@
5 <rect> 5 <rect>
6 <x>0</x> 6 <x>0</x>
7 <y>0</y> 7 <y>0</y>
8 <width>577</width> 8 <width>600</width>
9 <height>511</height> 9 <height>550</height>
10 </rect> 10 </rect>
11 </property> 11 </property>
12 <property name="windowTitle" > 12 <property name="windowTitle" >
@@ -17,24 +17,113 @@
17 </property> 17 </property>
18 <widget class="QWidget" name="centralwidget" > 18 <widget class="QWidget" name="centralwidget" >
19 <layout class="QGridLayout" > 19 <layout class="QGridLayout" >
20 <property name="leftMargin" > 20 <item row="0" column="0" >
21 <number>9</number> 21 <layout class="QHBoxLayout" >
22 </property> 22 <property name="spacing" >
23 <property name="topMargin" > 23 <number>6</number>
24 <number>9</number> 24 </property>
25 </property> 25 <property name="leftMargin" >
26 <property name="rightMargin" > 26 <number>0</number>
27 <number>9</number> 27 </property>
28 </property> 28 <property name="topMargin" >
29 <property name="bottomMargin" > 29 <number>0</number>
30 <number>9</number> 30 </property>
31 </property> 31 <property name="rightMargin" >
32 <property name="horizontalSpacing" > 32 <number>0</number>
33 <number>6</number> 33 </property>
34 </property> 34 <property name="bottomMargin" >
35 <property name="verticalSpacing" > 35 <number>0</number>
36 <number>6</number> 36 </property>
37 </property> 37 <item>
38 <spacer>
39 <property name="orientation" >
40 <enum>Qt::Horizontal</enum>
41 </property>
42 <property name="sizeHint" >
43 <size>
44 <width>40</width>
45 <height>20</height>
46 </size>
47 </property>
48 </spacer>
49 </item>
50 <item>
51 <widget class="QLabel" name="logoLabel" >
52 <property name="text" >
53 <string comment="Welcome to Rockbox Utility, the installation and housekeeping tool for Rockbox." />
54 </property>
55 <property name="pixmap" >
56 <pixmap resource="rbutilqt.qrc" >:/icons/icons/rblogo.xpm</pixmap>
57 </property>
58 </widget>
59 </item>
60 <item>
61 <spacer>
62 <property name="orientation" >
63 <enum>Qt::Horizontal</enum>
64 </property>
65 <property name="sizeHint" >
66 <size>
67 <width>40</width>
68 <height>20</height>
69 </size>
70 </property>
71 </spacer>
72 </item>
73 </layout>
74 </item>
75 <item row="1" column="0" >
76 <widget class="QGroupBox" name="groupBox_3" >
77 <property name="title" >
78 <string>Device</string>
79 </property>
80 <layout class="QGridLayout" >
81 <item row="0" column="0" >
82 <widget class="QLabel" name="labelDeviceTitle" >
83 <property name="sizePolicy" >
84 <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
85 <horstretch>0</horstretch>
86 <verstretch>0</verstretch>
87 </sizepolicy>
88 </property>
89 <property name="text" >
90 <string>Selected device:</string>
91 </property>
92 </widget>
93 </item>
94 <item row="0" column="1" >
95 <widget class="QLabel" name="labelDevice" >
96 <property name="text" >
97 <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
98p, li { white-space: pre-wrap; }
99&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
100&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-weight:600;">none&lt;/span> at &lt;span style=" font-weight:600;">unknown&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
101 </property>
102 </widget>
103 </item>
104 <item row="0" column="2" >
105 <spacer>
106 <property name="orientation" >
107 <enum>Qt::Horizontal</enum>
108 </property>
109 <property name="sizeHint" >
110 <size>
111 <width>40</width>
112 <height>20</height>
113 </size>
114 </property>
115 </spacer>
116 </item>
117 <item row="0" column="3" >
118 <widget class="QPushButton" name="buttonChangeDevice" >
119 <property name="text" >
120 <string>&amp;Change</string>
121 </property>
122 </widget>
123 </item>
124 </layout>
125 </widget>
126 </item>
38 <item row="2" column="0" > 127 <item row="2" column="0" >
39 <widget class="QTabWidget" name="tabWidget" > 128 <widget class="QTabWidget" name="tabWidget" >
40 <property name="currentIndex" > 129 <property name="currentIndex" >
@@ -575,116 +664,6 @@ p, li { white-space: pre-wrap; }
575 </widget> 664 </widget>
576 </widget> 665 </widget>
577 </item> 666 </item>
578 <item row="0" column="0" >
579 <layout class="QHBoxLayout" >
580 <property name="spacing" >
581 <number>6</number>
582 </property>
583 <property name="leftMargin" >
584 <number>0</number>
585 </property>
586 <property name="topMargin" >
587 <number>0</number>
588 </property>
589 <property name="rightMargin" >
590 <number>0</number>
591 </property>
592 <property name="bottomMargin" >
593 <number>0</number>
594 </property>
595 <item>
596 <spacer>
597 <property name="orientation" >
598 <enum>Qt::Horizontal</enum>
599 </property>
600 <property name="sizeHint" >
601 <size>
602 <width>40</width>
603 <height>20</height>
604 </size>
605 </property>
606 </spacer>
607 </item>
608 <item>
609 <widget class="QLabel" name="logoLabel" >
610 <property name="text" >
611 <string comment="Welcome to Rockbox Utility, the installation and housekeeping tool for Rockbox." />
612 </property>
613 <property name="pixmap" >
614 <pixmap resource="rbutilqt.qrc" >:/icons/icons/rblogo.xpm</pixmap>
615 </property>
616 </widget>
617 </item>
618 <item>
619 <spacer>
620 <property name="orientation" >
621 <enum>Qt::Horizontal</enum>
622 </property>
623 <property name="sizeHint" >
624 <size>
625 <width>40</width>
626 <height>20</height>
627 </size>
628 </property>
629 </spacer>
630 </item>
631 </layout>
632 </item>
633 <item row="1" column="0" >
634 <layout class="QHBoxLayout" >
635 <property name="spacing" >
636 <number>6</number>
637 </property>
638 <property name="leftMargin" >
639 <number>0</number>
640 </property>
641 <property name="topMargin" >
642 <number>0</number>
643 </property>
644 <property name="rightMargin" >
645 <number>0</number>
646 </property>
647 <property name="bottomMargin" >
648 <number>0</number>
649 </property>
650 <item>
651 <widget class="QLabel" name="labelDevice" >
652 <property name="sizePolicy" >
653 <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
654 <horstretch>0</horstretch>
655 <verstretch>0</verstretch>
656 </sizepolicy>
657 </property>
658 <property name="text" >
659 <string>&amp;Device</string>
660 </property>
661 <property name="buddy" >
662 <cstring>comboBoxDevice</cstring>
663 </property>
664 </widget>
665 </item>
666 <item>
667 <widget class="QComboBox" name="comboBoxDevice" >
668 <property name="sizePolicy" >
669 <sizepolicy vsizetype="Preferred" hsizetype="MinimumExpanding" >
670 <horstretch>0</horstretch>
671 <verstretch>0</verstretch>
672 </sizepolicy>
673 </property>
674 <property name="accessibleDescription" >
675 <string>Device selection combo box</string>
676 </property>
677 </widget>
678 </item>
679 <item>
680 <widget class="QPushButton" name="buttonDetect" >
681 <property name="text" >
682 <string>&amp;Autodetect</string>
683 </property>
684 </widget>
685 </item>
686 </layout>
687 </item>
688 </layout> 667 </layout>
689 </widget> 668 </widget>
690 <widget class="QMenuBar" name="menubar" > 669 <widget class="QMenuBar" name="menubar" >
@@ -692,7 +671,7 @@ p, li { white-space: pre-wrap; }
692 <rect> 671 <rect>
693 <x>0</x> 672 <x>0</x>
694 <y>0</y> 673 <y>0</y>
695 <width>577</width> 674 <width>600</width>
696 <height>29</height> 675 <height>29</height>
697 </rect> 676 </rect>
698 </property> 677 </property>
@@ -752,8 +731,6 @@ p, li { white-space: pre-wrap; }
752 </action> 731 </action>
753 </widget> 732 </widget>
754 <tabstops> 733 <tabstops>
755 <tabstop>comboBoxDevice</tabstop>
756 <tabstop>buttonDetect</tabstop>
757 <tabstop>tabWidget</tabstop> 734 <tabstop>tabWidget</tabstop>
758 <tabstop>buttonComplete</tabstop> 735 <tabstop>buttonComplete</tabstop>
759 <tabstop>buttonSmall</tabstop> 736 <tabstop>buttonSmall</tabstop>