Move device and mountpoint selection to configuration to eliminate the need of asking for the mountpoint in every installation window. Use a QListWidget to make the devices list nicer. Remove scrobbler settings as this will most likely get implemented as plugin.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14149 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dominik Riebeling 2007-08-02 21:29:31 +00:00
parent c21abddaae
commit 7a62bb04d8
7 changed files with 382 additions and 293 deletions

View file

@ -60,15 +60,15 @@ Config::Config(QWidget *parent) : QDialog(parent)
connect(ui.buttonCancel, SIGNAL(clicked()), this, SLOT(abort())); connect(ui.buttonCancel, SIGNAL(clicked()), this, SLOT(abort()));
connect(ui.radioNoProxy, SIGNAL(toggled(bool)), this, SLOT(setNoProxy(bool))); connect(ui.radioNoProxy, SIGNAL(toggled(bool)), this, SLOT(setNoProxy(bool)));
connect(ui.radioSystemProxy, SIGNAL(toggled(bool)), this, SLOT(setSystemProxy(bool))); connect(ui.radioSystemProxy, SIGNAL(toggled(bool)), this, SLOT(setSystemProxy(bool)));
connect(ui.browseMountPoint, SIGNAL(clicked()), this, SLOT(browseFolder()));
// disable unimplemented stuff // disable unimplemented stuff
ui.buttonCacheBrowse->setEnabled(false); ui.buttonCacheBrowse->setEnabled(false);
ui.cacheDisable->setEnabled(false); ui.cacheDisable->setEnabled(false);
ui.cacheOfflineMode->setEnabled(false); ui.cacheOfflineMode->setEnabled(false);
ui.buttonCacheClear->setEnabled(false); ui.buttonCacheClear->setEnabled(false);
ui.scrobblerUser->setEnabled(false);
ui.scrobblerPass->setEnabled(false); ui.buttonAutodetect->setEnabled(false);
ui.scrobblerTimezone->setEnabled(false);
} }
@ -115,6 +115,7 @@ void Config::abort()
void Config::setUserSettings(QSettings *user) void Config::setUserSettings(QSettings *user)
{ {
userSettings = user; userSettings = user;
// set proxy
QUrl proxy = userSettings->value("defaults/proxy").toString(); QUrl proxy = userSettings->value("defaults/proxy").toString();
ui.proxyPort->setText(QString("%1").arg(proxy.port())); ui.proxyPort->setText(QString("%1").arg(proxy.port()));
@ -145,6 +146,94 @@ void Config::setUserSettings(QSettings *user)
if(a.size() > 0) if(a.size() > 0)
ui.listLanguages->setCurrentItem(a.at(0)); ui.listLanguages->setCurrentItem(a.at(0));
// devices tab
ui.mountPoint->setText(userSettings->value("defaults/mountpoint").toString());
}
void Config::setDevices(QSettings *dev)
{
devices = dev;
// setup devices table
qDebug() << "Config::setDevices()";
devices->beginGroup("platforms");
QStringList a = devices->childKeys();
devices->endGroup();
QMap <QString, QString> manuf;
QMap <QString, QString> devcs;
for(int it = 0; it < a.size(); it++) {
QString curdev;
devices->beginGroup("platforms");
curdev = devices->value(a.at(it), "null").toString();
devices->endGroup();
QString curname;
devices->beginGroup(curdev);
curname = devices->value("name", "null").toString();
QString curbrand = devices->value("brand", "").toString();
devices->endGroup();
manuf.insertMulti(curbrand, curdev);
devcs.insert(curdev, curname);
}
QString platform;
platform = devcs.value(userSettings->value("defaults/platform").toString());
// set up devices table
ui.treeDevices->header()->hide();
ui.treeDevices->expandAll();
ui.treeDevices->setColumnCount(1);
QList<QTreeWidgetItem *> items;
// get manufacturers
QStringList brands = manuf.uniqueKeys();
QTreeWidgetItem *w;
QTreeWidgetItem *w2;
QTreeWidgetItem *w3;
for(int c = 0; c < brands.size(); c++) {
qDebug() << brands.at(c);
w = new QTreeWidgetItem();
w->setFlags(Qt::ItemIsEnabled);
w->setText(0, brands.at(c));
// w->setData(0, Qt::DecorationRole, <icon>);
items.append(w);
// go through platforms again for sake of order
for(int it = 0; it < a.size(); it++) {
QString curdev;
devices->beginGroup("platforms");
curdev = devices->value(a.at(it), "null").toString();
devices->endGroup();
QString curname;
devices->beginGroup(curdev);
curname = devices->value("name", "null").toString();
QString curbrand = devices->value("brand", "").toString();
devices->endGroup();
if(curbrand != brands.at(c)) continue;
qDebug() << "adding:" << brands.at(c) << curname << curdev;
w2 = new QTreeWidgetItem(w, QStringList(curname));
w2->setData(0, Qt::UserRole, curdev);
if(platform.contains(curname)) {
w2->setSelected(true);
w->setExpanded(true);
w3 = w2; // save pointer to hilight old selection
}
items.append(w2);
}
}
ui.treeDevices->insertTopLevelItems(0, items);
ui.treeDevices->setCurrentItem(w3); // hilight old selection
connect(ui.treeDevices, SIGNAL(itemSelectionChanged()), this, SLOT(updatePlatform()));
}
void Config::updatePlatform()
{
qDebug() << "updatePlatform()";
QString nplat;
nplat = ui.treeDevices->selectedItems().at(0)->data(0, Qt::UserRole).toString();
userSettings->setValue("defaults/platform", nplat);
} }
@ -227,3 +316,20 @@ void Config::updateLanguage()
} }
void Config::browseFolder()
{
QFileDialog browser(this);
if(QFileInfo(ui.mountPoint->text()).isDir())
browser.setDirectory(ui.mountPoint->text());
else
browser.setDirectory("/media");
browser.setReadOnly(true);
browser.setFileMode(QFileDialog::DirectoryOnly);
browser.setAcceptMode(QFileDialog::AcceptOpen);
if(browser.exec()) {
qDebug() << browser.directory();
QStringList files = browser.selectedFiles();
ui.mountPoint->setText(files.at(0));
userSettings->setValue("defaults/mountpoint", files.at(0));
}
}

View file

@ -29,6 +29,7 @@ class Config : public QDialog
public: public:
Config(QWidget *parent = 0); Config(QWidget *parent = 0);
void setUserSettings(QSettings*); void setUserSettings(QSettings*);
void setDevices(QSettings*);
signals: signals:
void settingsUpdated(void); void settingsUpdated(void);
@ -40,6 +41,7 @@ class Config : public QDialog
private: private:
Ui::ConfigForm ui; Ui::ConfigForm ui;
QSettings *userSettings; QSettings *userSettings;
QSettings *devices;
QStringList findLanguageFiles(void); QStringList findLanguageFiles(void);
QString languageName(const QString&); QString languageName(const QString&);
QMap<QString, QString> lang; QMap<QString, QString> lang;
@ -51,6 +53,8 @@ class Config : public QDialog
void setNoProxy(bool); void setNoProxy(bool);
void setSystemProxy(bool); void setSystemProxy(bool);
void updateLanguage(void); void updateLanguage(void);
void browseFolder(void);
void updatePlatform(void);
}; };
#endif #endif

View file

@ -5,8 +5,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>476</width> <width>500</width>
<height>384</height> <height>400</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle" >
@ -58,6 +58,79 @@
<property name="currentIndex" > <property name="currentIndex" >
<number>0</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="tabDevice" >
<attribute name="title" >
<string>&amp;Device</string>
</attribute>
<layout class="QGridLayout" >
<item row="0" column="0" >
<widget class="QLabel" name="labelMountPoint" >
<property name="text" >
<string>Select your device in the &amp;filesystem</string>
</property>
<property name="buddy" >
<cstring>mountPoint</cstring>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2" >
<layout class="QHBoxLayout" >
<item>
<widget class="QLineEdit" name="mountPoint" />
</item>
<item>
<widget class="QPushButton" name="browseMountPoint" >
<property name="text" >
<string>&amp;Browse</string>
</property>
<property name="icon" >
<iconset resource="rbutilqt.qrc" >:/icons/icons/system-search.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="labelPlayer" >
<property name="text" >
<string>&amp;Select your audio player</string>
</property>
<property name="buddy" >
<cstring>treeDevices</cstring>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2" >
<widget class="QTreeWidget" name="treeDevices" >
<column>
<property name="text" >
<string>1</string>
</property>
</column>
</widget>
</item>
<item row="4" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="1" >
<widget class="QPushButton" name="buttonAutodetect" >
<property name="text" >
<string>&amp;Autodetect</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabProxy" > <widget class="QWidget" name="tabProxy" >
<attribute name="title" > <attribute name="title" >
<string>&amp;Proxy</string> <string>&amp;Proxy</string>
@ -183,7 +256,7 @@
</widget> </widget>
<widget class="QWidget" name="tabCache" > <widget class="QWidget" name="tabCache" >
<attribute name="title" > <attribute name="title" >
<string>C&amp;ache</string> <string>Cac&amp;he</string>
</attribute> </attribute>
<attribute name="toolTip" > <attribute name="toolTip" >
<string>Download cache settings</string> <string>Download cache settings</string>
@ -286,69 +359,6 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tabScrobbler" >
<attribute name="title" >
<string>&amp;Scrobbler</string>
</attribute>
<layout class="QGridLayout" >
<item row="0" column="0" >
<widget class="QLabel" name="label_8" >
<property name="text" >
<string>&amp;Username</string>
</property>
<property name="buddy" >
<cstring>scrobblerUser</cstring>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLineEdit" name="scrobblerUser" />
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label_9" >
<property name="text" >
<string>P&amp;assword</string>
</property>
<property name="buddy" >
<cstring>scrobblerPass</cstring>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLineEdit" name="scrobblerPass" >
<property name="echoMode" >
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="label_10" >
<property name="text" >
<string>&amp;Timezone</string>
</property>
<property name="buddy" >
<cstring>scrobblerTimezone</cstring>
</property>
</widget>
</item>
<item row="2" column="1" >
<widget class="QComboBox" name="scrobblerTimezone" />
</item>
<item row="4" column="1" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget> </widget>
</item> </item>
</layout> </layout>

View file

@ -3,6 +3,7 @@ download_url=http://www.rockbox.org/download/
daily_url=http://download.rockbox.org/daily/ daily_url=http://download.rockbox.org/daily/
bleeding_url=http://build.rockbox.org/dist/build- bleeding_url=http://build.rockbox.org/dist/build-
server_conf_url=http://www.rockbox.org/daily/build-info server_conf_url=http://www.rockbox.org/daily/build-info
bleeding_info=http://build.rockbox.org/cvsmod/build-info
font_url=http://www.rockbox.org/daily/fonts/rockbox-fonts.zip font_url=http://www.rockbox.org/daily/fonts/rockbox-fonts.zip
last_release=2.5 last_release=2.5
prog_name=rockbox prog_name=rockbox
@ -41,7 +42,7 @@ platform40=gigabeatf
platform50=sansae200 platform50=sansae200
[player] [player]
name="Archos Jukebox Player 6000 / Jukebox Studio 5/10/20" name="Jukebox Player 6000 / Jukebox Studio 5/10/20"
platform=player platform=player
released=yes released=yes
needsbootloader=no needsbootloader=no
@ -49,10 +50,10 @@ bootloadermethod=
bootloadername= bootloadername=
resolution=11x2x1 resolution=11x2x1
manualname= manualname=
brand=archos brand=Archos
[recorder] [recorder]
name="Archos Jukebox Recorder 10 / 20" name="Jukebox Recorder 10 / 20"
platform=recorder platform=recorder
released=yes released=yes
needsbootloader=no needsbootloader=no
@ -60,10 +61,10 @@ bootloadermethod=
bootloadername= bootloadername=
resolution=112x64x1 resolution=112x64x1
manualname= manualname=
brand=archos brand=Archos
[recorder8mb] [recorder8mb]
name="Archos Jukebox Recorder 10 / 20 (with 8mb memory)" name="Jukebox Recorder 10 / 20 (with 8mb memory)"
platform=recorder8mb platform=recorder8mb
released=no released=no
needsbootloader=no needsbootloader=no
@ -71,10 +72,10 @@ bootloadermethod=
bootloadername= bootloadername=
resolution=112x64x1 resolution=112x64x1
manualname=rockbox-recorder manualname=rockbox-recorder
brand=archos brand=Archos
[recorderv2] [recorderv2]
name="Archos Jukebox Recorder v2 (20GB)" name="Jukebox Recorder v2 (20GB)"
platform=recorderv2 platform=recorderv2
released=yes released=yes
needsbootloader=no needsbootloader=no
@ -82,10 +83,10 @@ bootloadermethod=
bootloadername= bootloadername=
resolution=112x64x1 resolution=112x64x1
manualname= manualname=
brand=archos brand=Archos
[fmrecorder] [fmrecorder]
name="Archos Jukebox Recorder FM" name="Jukebox Recorder FM"
platform=fmrecorder platform=fmrecorder
released=yes released=yes
needsbootloader=no needsbootloader=no
@ -93,10 +94,10 @@ bootloadermethod=
bootloadername= bootloadername=
resolution=112x64x1 resolution=112x64x1
manualname= manualname=
brand=archos brand=Archos
[fmrecorder8mb] [fmrecorder8mb]
name="Archos Jukebox Recorder FM (with 8mb memory)" name="Jukebox Recorder FM (with 8mb memory)"
platform=fmrecorder8mb platform=fmrecorder8mb
released=no released=no
needsbootloader=no needsbootloader=no
@ -104,10 +105,10 @@ bootloadermethod=
bootloadername= bootloadername=
resolution=112x64x1 resolution=112x64x1
manualname=rockbox-fmrecorder manualname=rockbox-fmrecorder
brand=archos brand=Archos
[ondiosp] [ondiosp]
name="Archos Ondio SP" name="Ondio SP"
platform=ondiosp platform=ondiosp
released=yes released=yes
needsbootloader=no needsbootloader=no
@ -115,10 +116,10 @@ bootloadermethod=
bootloadername= bootloadername=
resolution=112x64x1 resolution=112x64x1
manualname= manualname=
brand=archos brand=Archos
[ondiofm] [ondiofm]
name="Archos Ondio FM" name="Ondio FM"
platform=ondiofm platform=ondiofm
released=yes released=yes
needsbootloader=no needsbootloader=no
@ -126,10 +127,10 @@ bootloadermethod=
bootloadername= bootloadername=
resolution=112x64x1 resolution=112x64x1
manualname= manualname=
brand=archos brand=Archos
[h100] [h100]
name="Iriver iHP100 / iHP110" name="iHP100 / iHP110"
platform=h100 platform=h100
released=no released=no
needsbootloader=yes needsbootloader=yes
@ -137,10 +138,10 @@ bootloadermethod=fwpatcher
bootloadername=bootloader-h100.bin bootloadername=bootloader-h100.bin
resolution=160x128x2 resolution=160x128x2
manualname=rockbox-h100 manualname=rockbox-h100
brand=iriver brand=Iriver
[h120] [h120]
name="Iriver iHP120 / iHP140 / H120 / H140" name="iHP120 / iHP140 / H120 / H140"
platform=h120 platform=h120
released=no released=no
needsbootloader=yes needsbootloader=yes
@ -148,10 +149,10 @@ bootloadermethod=fwpatcher
bootloadername=bootloader-h120.bin bootloadername=bootloader-h120.bin
resolution=160x128x2 resolution=160x128x2
manualname=rockbox-h100 manualname=rockbox-h100
brand=iriver brand=Iriver
[h300] [h300]
name="Iriver H320 / H340" name="H320 / H340"
platform=h300 platform=h300
released=no released=no
needsbootloader=yes needsbootloader=yes
@ -159,10 +160,10 @@ bootloadermethod=fwpatcher
bootloadername=bootloader-h300.bin bootloadername=bootloader-h300.bin
resolution=220x176x16 resolution=220x176x16
manualname=rockbox-h300 manualname=rockbox-h300
brand=iriver brand=Iriver
[h10_5gbums] [h10_5gbums]
name="Iriver H10 (5 / 6GB) UMS" name="H10 (5 / 6GB) UMS"
platform=h10_5gb platform=h10_5gb
released=no released=no
needsbootloader=yes needsbootloader=yes
@ -170,10 +171,10 @@ bootloadermethod=h10
bootloadername=H10.mi4 bootloadername=H10.mi4
resolution=128x128x16 resolution=128x128x16
manualname= manualname=
brand=iriver brand=Iriver
[h10_5gbmtp] [h10_5gbmtp]
name="Iriver H10 (5 / 6GB) MTP" name="H10 (5 / 6GB) MTP"
platform=h10_5gb platform=h10_5gb
released=no released=no
needsbootloader=yes needsbootloader=yes
@ -181,10 +182,10 @@ bootloadermethod=h10
bootloadername=H10_5GB-MTP/H10.mi4 bootloadername=H10_5GB-MTP/H10.mi4
resolution=128x128x16 resolution=128x128x16
manualname= manualname=
brand=iriver brand=Iriver
[h10] [h10]
name="Iriver H10 (20GB)" name="H10 (20GB)"
platform=h10 platform=h10
released=no released=no
needsbootloader=yes needsbootloader=yes
@ -192,10 +193,10 @@ bootloadermethod=h10
bootloadername=H10_20GC.mi4 bootloadername=H10_20GC.mi4
resolution=160x128x16 resolution=160x128x16
manualname= manualname=
brand=iriver brand=Iriver
[ipod1g2g] [ipod1g2g]
name="Apple Ipod (1st / 2nd gen)" name="Ipod (1st / 2nd gen)"
platform=ipod1g2g platform=ipod1g2g
released=no released=no
needsbootloader=yes needsbootloader=yes
@ -203,10 +204,10 @@ bootloadermethod=ipodpatcher
bootloadername=ipod1g2g bootloadername=ipod1g2g
resolution=160x128x2 resolution=160x128x2
manualname= manualname=
brand=apple brand=Apple
[ipodcolor] [ipodcolor]
name="Apple Ipod Colour / Photo / U2 (4th gen)" name="Ipod Colour / Photo / U2 (4th gen)"
platform=ipodcolor platform=ipodcolor
released=no released=no
needsbootloader=yes needsbootloader=yes
@ -214,10 +215,10 @@ bootloadermethod=ipodpatcher
bootloadername=ipodcolor bootloadername=ipodcolor
resolution=220x176x16 resolution=220x176x16
manualname= manualname=
brand=apple brand=Apple
[ipodnano] [ipodnano]
name="Apple Ipod Nano (1st gen)" name="Ipod Nano (1st gen)"
platform=ipodnano platform=ipodnano
released=no released=no
needsbootloader=yes needsbootloader=yes
@ -225,10 +226,10 @@ bootloadermethod=ipodpatcher
bootloadername=ipodnano bootloadername=ipodnano
resolution=176x132x16 resolution=176x132x16
manualname= manualname=
brand=apple brand=Apple
[ipod4gray] [ipod4gray]
name="Apple Ipod (4th gen, greyscale)" name="Ipod (4th gen, greyscale)"
platform=ipod4gray platform=ipod4gray
released=no released=no
needsbootloader=yes needsbootloader=yes
@ -236,10 +237,10 @@ bootloadermethod=ipodpatcher
bootloadername=ipod4g bootloadername=ipod4g
resolution=160x128x2 resolution=160x128x2
manualname= manualname=
brand=apple brand=Apple
[ipodvideo] [ipodvideo]
name="Apple Ipod Video (5th gen)" name="Ipod Video (5th gen)"
platform=ipodvideo platform=ipodvideo
released=no released=no
needsbootloader=yes needsbootloader=yes
@ -247,10 +248,10 @@ bootloadermethod=ipodpatcher
bootloadername=ipodvideo bootloadername=ipodvideo
resolution=320x240x16 resolution=320x240x16
manualname= manualname=
brand=apple brand=Apple
[ipod3g] [ipod3g]
name="Apple Ipod (3rd gen)" name="Ipod (3rd gen)"
platform=ipod3g platform=ipod3g
released=no released=no
needsbootloader=yes needsbootloader=yes
@ -258,10 +259,10 @@ bootloadermethod=ipodpatcher
bootloadername=ipod3g bootloadername=ipod3g
resolution=160x128x2 resolution=160x128x2
manualname= manualname=
brand=apple brand=Apple
[ipodmini1g] [ipodmini1g]
name="Apple Ipod Mini (1st gen)" name="Ipod Mini (1st gen)"
platform=ipodmini1g platform=ipodmini1g
released=no released=no
needsbootloader=yes needsbootloader=yes
@ -269,10 +270,10 @@ bootloadermethod=ipodpatcher
bootloadername=ipodmini bootloadername=ipodmini
resolution=138x110x2 resolution=138x110x2
manualname=rockbox-ipodmini2g manualname=rockbox-ipodmini2g
brand=apple brand=Apple
[ipodmini2g] [ipodmini2g]
name="Apple Ipod Mini (2nd gen)" name="Ipod Mini (2nd gen)"
platform=ipodmini2g platform=ipodmini2g
released=no released=no
needsbootloader=yes needsbootloader=yes
@ -280,10 +281,10 @@ bootloadermethod=ipodpatcher
bootloadername=ipodmini2g bootloadername=ipodmini2g
resolution=138x110x2 resolution=138x110x2
manualname=rockbox-ipodmini2g manualname=rockbox-ipodmini2g
brand=apple brand=Apple
[iaudiox5] [iaudiox5]
name="Cowon iAudio X5 / X5L" name="iAudio X5 / X5L"
platform=iaudiox5 platform=iaudiox5
released=no released=no
needsbootloader=yes needsbootloader=yes
@ -291,10 +292,10 @@ bootloadermethod=iaudio
bootloadername=x5_fw.bin bootloadername=x5_fw.bin
resolution=160x128x16 resolution=160x128x16
manualname= manualname=
brand=iaudio brand=Cowon
[iaudiox5v] [iaudiox5v]
name="Cowon iAudio X5V" name="iAudio X5V"
platform=iaudiox5 platform=iaudiox5
released=no released=no
needsbootloader=yes needsbootloader=yes
@ -302,10 +303,10 @@ bootloadermethod=iaudio
bootloadername=x5v_fw.bin bootloadername=x5v_fw.bin
resolution=160x128x2 resolution=160x128x2
manualname= manualname=
brand=iaudio brand=Cowon
[iaudiom5] [iaudiom5]
name="Cowon iAudio M5 / M5L" name="iAudio M5 / M5L"
platform=iaudiom5 platform=iaudiom5
released=no released=no
needsbootloader=yes needsbootloader=yes
@ -313,20 +314,20 @@ bootloadermethod=iaudio
bootloadername=m5_fw.bin bootloadername=m5_fw.bin
resolution=160x128x16 resolution=160x128x16
manualname= manualname=
brand=iaudio brand=Cowon
[gigabeatf] [gigabeatf]
name="Toshiba Gigabeat F / X" name="Gigabeat F / X"
platform=gigabeatf platform=gigabeatf
needsbootloader=yes needsbootloader=yes
bootloadermethod=gigabeatf bootloadermethod=gigabeatf
bootloadername=FWIMG01.DAT bootloadername=FWIMG01.DAT
resolution=240x320x16 resolution=240x320x16
manualname= manualname=
brand=toshiba brand=Toshiba
[sansae200] [sansae200]
name="Sandisk Sansa E200" name="Sansa E200"
platform=sansae200 platform=sansae200
released=no released=no
needsbootloader=yes needsbootloader=yes
@ -334,5 +335,5 @@ bootloadermethod=sansapatcher
bootloadername=PP5022.mi4 bootloadername=PP5022.mi4
resolution=176x220x16 resolution=176x220x16
manualname= manualname=
brand=sandisk brand=Sandisk

View file

@ -50,7 +50,6 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
} }
ui.setupUi(this); ui.setupUi(this);
initDeviceNames();
// portable installation: // portable installation:
// check for a configuration file in the program folder. // check for a configuration file in the program folder.
@ -66,21 +65,16 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
QSettings::UserScope, "rockbox.org", "RockboxUtility"); QSettings::UserScope, "rockbox.org", "RockboxUtility");
qDebug() << "config: system"; qDebug() << "config: system";
} }
userSettings->beginGroup("defaults");
platform = userSettings->value("platform").toString();
userSettings->endGroup();
ui.comboBoxDevice->setCurrentIndex(ui.comboBoxDevice->findData(platform));
updateDevice(ui.comboBoxDevice->currentIndex());
// manual tab // manual tab
ui.buttonDownloadManual->setEnabled(false); ui.buttonDownloadManual->setEnabled(false);
updateManual(); updateManual();
updateDevice();
connect(ui.actionAbout_Qt, SIGNAL(triggered()), qApp, SLOT(aboutQt())); connect(ui.actionAbout_Qt, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
connect(ui.action_About, SIGNAL(triggered()), this, SLOT(about())); connect(ui.action_About, SIGNAL(triggered()), this, SLOT(about()));
connect(ui.action_Configure, SIGNAL(triggered()), this, SLOT(configDialog())); connect(ui.action_Configure, SIGNAL(triggered()), this, SLOT(configDialog()));
connect(ui.comboBoxDevice, SIGNAL(currentIndexChanged(int)), this, SLOT(updateDevice(int))); connect(ui.buttonChangeDevice, SIGNAL(clicked()), this, SLOT(configDialog()));
connect(ui.buttonRockbox, SIGNAL(clicked()), this, SLOT(install())); connect(ui.buttonRockbox, SIGNAL(clicked()), this, SLOT(install()));
connect(ui.buttonBootloader, SIGNAL(clicked()), this, SLOT(installBl())); connect(ui.buttonBootloader, SIGNAL(clicked()), this, SLOT(installBl()));
connect(ui.buttonFonts, SIGNAL(clicked()), this, SLOT(installFonts())); connect(ui.buttonFonts, SIGNAL(clicked()), this, SLOT(installFonts()));
@ -92,7 +86,6 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
ui.buttonRemoveRockbox->setEnabled(false); ui.buttonRemoveRockbox->setEnabled(false);
ui.buttonRemoveBootloader->setEnabled(false); ui.buttonRemoveBootloader->setEnabled(false);
ui.buttonComplete->setEnabled(false); ui.buttonComplete->setEnabled(false);
ui.buttonDetect->setEnabled(false);
initIpodpatcher(); initIpodpatcher();
downloadInfo(); downloadInfo();
@ -130,7 +123,8 @@ void RbUtilQt::downloadDone(bool error)
void RbUtilQt::downloadDone(int id, bool error) void RbUtilQt::downloadDone(int id, bool error)
{ {
QString errorString; QString errorString;
errorString = tr("Network error: %1. Please check your network and proxy settings.").arg(daily->errorString()); errorString = tr("Network error: %1. Please check your network and proxy settings.")
.arg(daily->errorString());
if(error) QMessageBox::about(this, "Network Error", errorString); if(error) QMessageBox::about(this, "Network Error", errorString);
qDebug() << "downloadDone:" << id << error; qDebug() << "downloadDone:" << id << error;
} }
@ -168,38 +162,25 @@ void RbUtilQt::configDialog()
{ {
Config *cw = new Config(this); Config *cw = new Config(this);
cw->setUserSettings(userSettings); cw->setUserSettings(userSettings);
cw->setDevices(devices);
cw->show(); cw->show();
connect(cw, SIGNAL(settingsUpdated()), this, SLOT(downloadInfo())); connect(cw, SIGNAL(settingsUpdated()), this, SLOT(downloadInfo()));
connect(cw, SIGNAL(settingsUpdated()), this, SLOT(updateSettings()));
} }
void RbUtilQt::initDeviceNames() void RbUtilQt::updateSettings()
{ {
qDebug() << "RbUtilQt::initDeviceNames()"; qDebug() << "updateSettings()";
devices->beginGroup("platforms"); updateDevice();
QStringList a = devices->childKeys(); updateManual();
devices->endGroup();
for(int it = 0; it < a.size(); it++) {
QString curdev;
devices->beginGroup("platforms");
curdev = devices->value(a.at(it), "null").toString();
devices->endGroup();
QString curname;
devices->beginGroup(curdev);
curname = devices->value("name", "null").toString();
devices->endGroup();
ui.comboBoxDevice->addItem(curname, curdev);
}
} }
void RbUtilQt::updateDevice(int index) void RbUtilQt::updateDevice()
{ {
platform = ui.comboBoxDevice->itemData(index).toString(); platform = userSettings->value("defaults/platform").toString();
userSettings->setValue("defaults/platform", platform); // buttons
userSettings->sync();
devices->beginGroup(platform); devices->beginGroup(platform);
if(devices->value("needsbootloader", "") == "no") { if(devices->value("needsbootloader", "") == "no") {
ui.buttonBootloader->setEnabled(false); ui.buttonBootloader->setEnabled(false);
@ -220,10 +201,15 @@ void RbUtilQt::updateDevice(int index)
} }
} }
devices->endGroup(); devices->endGroup();
// displayed device info
qDebug() << "new device selected:" << platform; platform = userSettings->value("defaults/platform").toString();
// update manual from here to make sure new device is already selected QString mountpoint = userSettings->value("defaults/mountpoint").toString();
updateManual(); devices->beginGroup(platform);
QString brand = devices->value("brand").toString();
QString name = devices->value("name").toString();
devices->endGroup();
ui.labelDevice->setText(tr("<b>%1 %2</b> at <b>%3</b>")
.arg(brand, name, mountpoint));
} }
@ -285,6 +271,7 @@ void RbUtilQt::install()
installWindow->show(); installWindow->show();
} }
void RbUtilQt::installBl() void RbUtilQt::installBl()
{ {
InstallBl *installWindow = new InstallBl(this); InstallBl *installWindow = new InstallBl(this);
@ -301,6 +288,7 @@ void RbUtilQt::installBl()
installWindow->show(); installWindow->show();
} }
void RbUtilQt::installFonts() void RbUtilQt::installFonts()
{ {
InstallZipWindow* installWindow = new InstallZipWindow(this); InstallZipWindow* installWindow = new InstallZipWindow(this);
@ -320,6 +308,7 @@ void RbUtilQt::installFonts()
} }
void RbUtilQt::installDoom() void RbUtilQt::installDoom()
{ {
InstallZipWindow* installWindow = new InstallZipWindow(this); InstallZipWindow* installWindow = new InstallZipWindow(this);
@ -338,3 +327,4 @@ void RbUtilQt::installDoom()
installWindow->show(); installWindow->show();
} }

View file

@ -48,7 +48,8 @@ class RbUtilQt : public QMainWindow
private slots: private slots:
void about(void); void about(void);
void configDialog(void); void configDialog(void);
void updateDevice(int); void updateDevice(void);
void updateSettings(void);
void install(void); void install(void);
void installBl(void); void installBl(void);
void installFonts(void); void installFonts(void);

View file

@ -5,8 +5,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>577</width> <width>600</width>
<height>511</height> <height>550</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle" >
@ -17,24 +17,113 @@
</property> </property>
<widget class="QWidget" name="centralwidget" > <widget class="QWidget" name="centralwidget" >
<layout class="QGridLayout" > <layout class="QGridLayout" >
<property name="leftMargin" > <item row="0" column="0" >
<number>9</number> <layout class="QHBoxLayout" >
</property> <property name="spacing" >
<property name="topMargin" > <number>6</number>
<number>9</number> </property>
</property> <property name="leftMargin" >
<property name="rightMargin" > <number>0</number>
<number>9</number> </property>
</property> <property name="topMargin" >
<property name="bottomMargin" > <number>0</number>
<number>9</number> </property>
</property> <property name="rightMargin" >
<property name="horizontalSpacing" > <number>0</number>
<number>6</number> </property>
</property> <property name="bottomMargin" >
<property name="verticalSpacing" > <number>0</number>
<number>6</number> </property>
</property> <item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="logoLabel" >
<property name="text" >
<string comment="Welcome to Rockbox Utility, the installation and housekeeping tool for Rockbox." />
</property>
<property name="pixmap" >
<pixmap resource="rbutilqt.qrc" >:/icons/icons/rblogo.xpm</pixmap>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="0" >
<widget class="QGroupBox" name="groupBox_3" >
<property name="title" >
<string>Device</string>
</property>
<layout class="QGridLayout" >
<item row="0" column="0" >
<widget class="QLabel" name="labelDeviceTitle" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Selected device:</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLabel" name="labelDevice" >
<property name="text" >
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
&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>
</property>
</widget>
</item>
<item row="0" column="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="3" >
<widget class="QPushButton" name="buttonChangeDevice" >
<property name="text" >
<string>&amp;Change</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="0" > <item row="2" column="0" >
<widget class="QTabWidget" name="tabWidget" > <widget class="QTabWidget" name="tabWidget" >
<property name="currentIndex" > <property name="currentIndex" >
@ -575,116 +664,6 @@ p, li { white-space: pre-wrap; }
</widget> </widget>
</widget> </widget>
</item> </item>
<item row="0" column="0" >
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="logoLabel" >
<property name="text" >
<string comment="Welcome to Rockbox Utility, the installation and housekeeping tool for Rockbox." />
</property>
<property name="pixmap" >
<pixmap resource="rbutilqt.qrc" >:/icons/icons/rblogo.xpm</pixmap>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="0" >
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<widget class="QLabel" name="labelDevice" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>&amp;Device</string>
</property>
<property name="buddy" >
<cstring>comboBoxDevice</cstring>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBoxDevice" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="accessibleDescription" >
<string>Device selection combo box</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonDetect" >
<property name="text" >
<string>&amp;Autodetect</string>
</property>
</widget>
</item>
</layout>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QMenuBar" name="menubar" > <widget class="QMenuBar" name="menubar" >
@ -692,7 +671,7 @@ p, li { white-space: pre-wrap; }
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>577</width> <width>600</width>
<height>29</height> <height>29</height>
</rect> </rect>
</property> </property>
@ -752,8 +731,6 @@ p, li { white-space: pre-wrap; }
</action> </action>
</widget> </widget>
<tabstops> <tabstops>
<tabstop>comboBoxDevice</tabstop>
<tabstop>buttonDetect</tabstop>
<tabstop>tabWidget</tabstop> <tabstop>tabWidget</tabstop>
<tabstop>buttonComplete</tabstop> <tabstop>buttonComplete</tabstop>
<tabstop>buttonSmall</tabstop> <tabstop>buttonSmall</tabstop>