summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/installbl.cpp
diff options
context:
space:
mode:
authorDominik Wenger <domonoky@googlemail.com>2007-07-28 14:38:25 +0000
committerDominik Wenger <domonoky@googlemail.com>2007-07-28 14:38:25 +0000
commit488b3db547a09b25eac212e77ccb64ef81f8ce3f (patch)
tree937671a00b37f4f2ca91c9119fe079ea3e837222 /rbutil/rbutilqt/installbl.cpp
parent999676bdd9b19c9fddb143698bfb5e3f4f4ae62a (diff)
downloadrockbox-488b3db547a09b25eac212e77ccb64ef81f8ce3f.tar.gz
rockbox-488b3db547a09b25eac212e77ccb64ef81f8ce3f.tar.bz2
rockbox-488b3db547a09b25eac212e77ccb64ef81f8ce3f.zip
rbutilQt: bootloader installation routines for iriver players. Bootloader routines are now completed. They need heavy testing.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14040 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/installbl.cpp')
-rw-r--r--rbutil/rbutilqt/installbl.cpp55
1 files changed, 55 insertions, 0 deletions
diff --git a/rbutil/rbutilqt/installbl.cpp b/rbutil/rbutilqt/installbl.cpp
index eae8fc20f6..6d6169f7c6 100644
--- a/rbutil/rbutilqt/installbl.cpp
+++ b/rbutil/rbutilqt/installbl.cpp
@@ -26,6 +26,8 @@ InstallBl::InstallBl(QWidget *parent) : QDialog(parent)
{
ui.setupUi(this);
connect(ui.buttonBrowse, SIGNAL(clicked()), this, SLOT(browseFolder()));
+ connect(ui.buttonBrowseOF, SIGNAL(clicked()), this, SLOT(browseOF()));
+
}
void InstallBl::setProxy(QUrl proxy_url)
@@ -43,6 +45,15 @@ void InstallBl::setMountPoint(QString mount)
}
}
+void InstallBl::setOFPath(QString path)
+{
+ QFileInfo m(path);
+ if(m.exists()) {
+ ui.lineOriginalFirmware->clear();
+ ui.lineOriginalFirmware->insert(path);
+ }
+}
+
void InstallBl::browseFolder()
{
QFileDialog browser(this);
@@ -60,6 +71,22 @@ void InstallBl::browseFolder()
}
}
+void InstallBl::browseOF()
+{
+ QFileDialog browser(this);
+ if(QFileInfo(ui.lineOriginalFirmware->text()).exists())
+ browser.setDirectory(ui.lineOriginalFirmware->text());
+ else
+ browser.setDirectory("/media");
+ browser.setReadOnly(true);
+ browser.setAcceptMode(QFileDialog::AcceptOpen);
+ if(browser.exec()) {
+ qDebug() << browser.directory();
+ QStringList files = browser.selectedFiles();
+ setOFPath(files.at(0));
+ }
+}
+
void InstallBl::accept()
{
QDialog *downloadProgress = new QDialog(this);
@@ -77,6 +104,18 @@ void InstallBl::accept()
downloadProgress->show();
return;
}
+
+ if(QFileInfo(ui.lineOriginalFirmware->text()).exists())
+ {
+ m_OrigFirmware = ui.lineOriginalFirmware->text();
+ }
+ else
+ {
+ dp.listProgress->addItem(tr("Original Firmware Path is wrong!"));
+ dp.buttonAbort->setText(tr("&Ok"));
+ downloadProgress->show();
+ return;
+ }
userSettings->sync();
binstaller = new BootloaderInstaller(this);
@@ -89,6 +128,7 @@ void InstallBl::accept()
binstaller->setBootloaderMethod(devices->value(plattform + "/bootloadermethod").toString());
binstaller->setBootloaderName(devices->value(plattform + "/bootloadername").toString());
binstaller->setBootloaderBaseUrl(devices->value("bootloader_url").toString());
+ binstaller->setOrigFirmwarePath(m_OrigFirmware);
binstaller->install(&dp);
@@ -115,6 +155,21 @@ void InstallBl::done(bool error)
void InstallBl::setDeviceSettings(QSettings *dev)
{
devices = dev;
+
+ if(userSettings->value("defaults/platform").toString() == "h100" ||
+ userSettings->value("defaults/platform").toString() == "h120" ||
+ userSettings->value("defaults/platform").toString() == "h300")
+ {
+ ui.buttonBrowseOF->show();
+ ui.lineOriginalFirmware->show();
+ ui.label_3->show();
+ }
+ else
+ {
+ ui.buttonBrowseOF->hide();
+ ui.lineOriginalFirmware->hide();
+ ui.label_3->hide();
+ }
qDebug() << "Install::setDeviceSettings:" << devices;
}