diff options
author | Dominik Wenger <domonoky@googlemail.com> | 2007-08-15 14:16:20 +0000 |
---|---|---|
committer | Dominik Wenger <domonoky@googlemail.com> | 2007-08-15 14:16:20 +0000 |
commit | 9789d303f234d259bb9c3de96dc6ca7c6ebde183 (patch) | |
tree | 84e3b451d2e58e6af0d6f1f4821bdc400e001279 /rbutil | |
parent | 8897e8cdfd9c0fbd5ba4a14df19e646391dc6cca (diff) |
rbutilQt: reworked bootloaderinstallation. removed the bootloaderinstalldialog, added a small dialog to ask for the original firmware, if you install a bootloader for a fwpatcher target.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14356 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil')
-rw-r--r-- | rbutil/rbutilqt/browsedirtree.cpp | 2 | ||||
-rw-r--r-- | rbutil/rbutilqt/browsedirtree.h | 2 | ||||
-rw-r--r-- | rbutil/rbutilqt/browseof.cpp | 69 | ||||
-rw-r--r-- | rbutil/rbutilqt/browseof.h | 46 | ||||
-rw-r--r-- | rbutil/rbutilqt/browseoffrm.ui | 112 | ||||
-rw-r--r-- | rbutil/rbutilqt/installbootloader.cpp | 18 | ||||
-rw-r--r-- | rbutil/rbutilqt/installbootloaderfrm.ui | 174 | ||||
-rw-r--r-- | rbutil/rbutilqt/installbootloaderwindow.cpp | 177 | ||||
-rw-r--r-- | rbutil/rbutilqt/installbootloaderwindow.h | 70 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.cpp | 73 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.h | 2 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.pro | 12 |
12 files changed, 316 insertions, 441 deletions
diff --git a/rbutil/rbutilqt/browsedirtree.cpp b/rbutil/rbutilqt/browsedirtree.cpp index 43232cf355..f46a825935 100644 --- a/rbutil/rbutilqt/browsedirtree.cpp +++ b/rbutil/rbutilqt/browsedirtree.cpp @@ -7,7 +7,7 @@ * \/ \/ \/ \/ \/ * * Copyright (C) 2007 by Dominik Riebeling - * $Id: installrb.cpp 13990 2007-07-25 22:26:10Z Dominik Wenger $ + * $Id: browsedirtree.cpp 13990 2007-07-25 22:26:10Z bluebrother $ * * All files in this archive are subject to the GNU General Public License. * See the file COPYING in the source tree root for full license agreement. diff --git a/rbutil/rbutilqt/browsedirtree.h b/rbutil/rbutilqt/browsedirtree.h index 4213400138..4893c67f0b 100644 --- a/rbutil/rbutilqt/browsedirtree.h +++ b/rbutil/rbutilqt/browsedirtree.h @@ -7,7 +7,7 @@ * \/ \/ \/ \/ \/ * * Copyright (C) 2007 by Dominik Riebeling - * $Id: installrb.cpp 13990 2007-07-25 22:26:10Z Dominik Wenger $ + * $Id: browsedirtree.h 13990 2007-07-25 22:26:10Z bluebrother $ * * All files in this archive are subject to the GNU General Public License. * See the file COPYING in the source tree root for full license agreement. diff --git a/rbutil/rbutilqt/browseof.cpp b/rbutil/rbutilqt/browseof.cpp new file mode 100644 index 0000000000..51c91c8451 --- /dev/null +++ b/rbutil/rbutilqt/browseof.cpp @@ -0,0 +1,69 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * + * Copyright (C) 2007 by Dominik Wenger + * $Id: browseof.cpp 13990 2007-07-25 22:26:10Z domonoky $ + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include <QtGui> + +#include "browseof.h" +#include "browsedirtree.h" + + +BrowseOF::BrowseOF(QWidget *parent) : QDialog(parent) +{ + ui.setupUi(this); + this->setModal(true); + + connect(ui.browseOFButton,SIGNAL(clicked()),this,SLOT(onBrowse())); +} + +void BrowseOF::setFile(QString file) +{ + ui.OFlineEdit->setText(file); +} + +void BrowseOF::onBrowse() +{ + BrowseDirtree browser(this); + browser.setFilter(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot); + + if(QFileInfo(ui.OFlineEdit->text()).exists()) + { + QDir d(ui.OFlineEdit->text()); + browser.setDir(d); + } + + if(browser.exec() == QDialog::Accepted) + { + qDebug() << browser.getSelected(); + setFile(browser.getSelected()); + } +} + +QString BrowseOF::getFile() +{ + return ui.OFlineEdit->text(); +} + +void BrowseOF::accept() +{ + this->close(); + setResult(QDialog::Accepted); +} + + + diff --git a/rbutil/rbutilqt/browseof.h b/rbutil/rbutilqt/browseof.h new file mode 100644 index 0000000000..c268054e59 --- /dev/null +++ b/rbutil/rbutilqt/browseof.h @@ -0,0 +1,46 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * + * Copyright (C) 2007 by Dominik Wenger + * $Id: browseof.h 13990 2007-07-25 22:26:10Z domonoky $ + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#ifndef BROWSEOF_H +#define BROWSEOF_H + +#include <QtGui> +#include "ui_browseoffrm.h" + +class BrowseOF : public QDialog +{ + Q_OBJECT + + public: + BrowseOF(QWidget *parent = 0); + void setFile(QString file); + QString getFile(); + + + private slots: + void onBrowse(); + + private: + Ui::BrowseOFFrm ui; + + private slots: + void accept(void); +}; + +#endif diff --git a/rbutil/rbutilqt/browseoffrm.ui b/rbutil/rbutilqt/browseoffrm.ui new file mode 100644 index 0000000000..88f8933704 --- /dev/null +++ b/rbutil/rbutilqt/browseoffrm.ui @@ -0,0 +1,112 @@ +<ui version="4.0" > + <class>BrowseOFFrm</class> + <widget class="QDialog" name="BrowseOFFrm" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>460</width> + <height>97</height> + </rect> + </property> + <property name="windowTitle" > + <string>Find original Firmware</string> + </property> + <layout class="QGridLayout" > + <item row="0" column="0" colspan="3" > + <widget class="QLabel" name="label" > + <property name="text" > + <string>Browse for a downloaded copy of the original firmware</string> + </property> + <property name="wordWrap" > + <bool>true</bool> + </property> + </widget> + </item> + <item row="1" column="0" colspan="2" > + <widget class="QLineEdit" name="OFlineEdit" /> + </item> + <item row="1" column="2" > + <widget class="QPushButton" name="browseOFButton" > + <property name="text" > + <string>Browse</string> + </property> + </widget> + </item> + <item row="2" column="0" > + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" > + <size> + <width>241</width> + <height>28</height> + </size> + </property> + </spacer> + </item> + <item row="2" column="1" colspan="2" > + <layout class="QHBoxLayout" > + <item> + <widget class="QPushButton" name="buttonOk" > + <property name="text" > + <string>&Ok</string> + </property> + <property name="icon" > + <iconset resource="rbutilqt.qrc" >:/icons/icons/go-next.png</iconset> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="buttonCancel" > + <property name="text" > + <string>&Cancel</string> + </property> + <property name="icon" > + <iconset resource="rbutilqt.qrc" >:/icons/icons/process-stop.png</iconset> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + <resources> + <include location="rbutilqt.qrc" /> + </resources> + <connections> + <connection> + <sender>buttonCancel</sender> + <signal>clicked()</signal> + <receiver>BrowseOFFrm</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel" > + <x>224</x> + <y>355</y> + </hint> + <hint type="destinationlabel" > + <x>48</x> + <y>349</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonOk</sender> + <signal>clicked()</signal> + <receiver>BrowseOFFrm</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel" > + <x>146</x> + <y>358</y> + </hint> + <hint type="destinationlabel" > + <x>74</x> + <y>357</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/rbutil/rbutilqt/installbootloader.cpp b/rbutil/rbutilqt/installbootloader.cpp index bbf58fca99..1a2d3974ec 100644 --- a/rbutil/rbutilqt/installbootloader.cpp +++ b/rbutil/rbutilqt/installbootloader.cpp @@ -302,6 +302,14 @@ void BootloaderInstaller::gigabeatFinish() downloadFile.remove(); m_dp->addItem(tr("Bootloader install finished successfully."),LOGOK); + m_dp->addItem(tr("To finish the Bootloader installation, follow the steps below."),LOGINFO); + m_dp->addItem(tr("1. Eject/Unmount your Device."),LOGINFO); + m_dp->addItem(tr("2. Unplug USB and any Power adapters."),LOGINFO); + m_dp->addItem(tr("3. Hold POWER to turn the Device off."),LOGINFO); + m_dp->addItem(tr("4. Toggle the Battery switch on the Device."),LOGINFO); + m_dp->addItem(tr("5. Hold POWER to boot the Rockbox bootloader."),LOGINFO); + + m_dp->abort(); emit done(false); // success @@ -350,6 +358,11 @@ void BootloaderInstaller::iaudioFinish() downloadFile.remove(); m_dp->addItem(tr("Bootloader install finished successfully."),LOGOK); + m_dp->addItem(tr("To finish the Bootloader installation, follow the steps below."),LOGINFO); + m_dp->addItem(tr("1. Eject/Unmount your Device."),LOGINFO); + m_dp->addItem(tr("2. Turn you Device OFF."),LOGINFO); + m_dp->addItem(tr("3. Insert Charger."),LOGINFO); + m_dp->abort(); emit done(false); // success @@ -1070,6 +1083,11 @@ void BootloaderInstaller::iriverFinish() newHex.remove(); m_dp->addItem(tr("Bootloader install finished successfully."),LOGOK); + m_dp->addItem(tr("To finish the Bootloader installation, follow the steps below."),LOGINFO); + m_dp->addItem(tr("1. Eject/Unmount your Device."),LOGINFO); + m_dp->addItem(tr("2. Boot into the original Firmware."),LOGINFO); + m_dp->addItem(tr("3. Use the Firmware flash option in the Original Firmware."),LOGINFO); + m_dp->addItem(tr("4. Reboot."),LOGINFO); m_dp->abort(); emit done(false); // success diff --git a/rbutil/rbutilqt/installbootloaderfrm.ui b/rbutil/rbutilqt/installbootloaderfrm.ui deleted file mode 100644 index b34b664d43..0000000000 --- a/rbutil/rbutilqt/installbootloaderfrm.ui +++ /dev/null @@ -1,174 +0,0 @@ -<ui version="4.0" > - <class>InstallBootloaderFrm</class> - <widget class="QDialog" name="InstallBootloaderFrm" > - <property name="windowModality" > - <enum>Qt::WindowModal</enum> - </property> - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>600</width> - <height>450</height> - </rect> - </property> - <property name="windowTitle" > - <string>Install Bootloader</string> - </property> - <layout class="QGridLayout" > - <item rowspan="6" row="0" column="0" > - <widget class="QLabel" name="label" > - <property name="text" > - <string/> - </property> - <property name="pixmap" > - <pixmap resource="rbutilqt.qrc" >:/icons/icons/wizard.xpm</pixmap> - </property> - <property name="alignment" > - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> - </property> - </widget> - </item> - <item row="0" column="1" colspan="3" > - <widget class="QLabel" name="label_2" > - <property name="text" > - <string>Select your device in the filesystem</string> - </property> - </widget> - </item> - <item row="1" column="1" colspan="2" > - <widget class="QLineEdit" name="lineMountPoint" /> - </item> - <item row="1" column="3" > - <widget class="QPushButton" name="buttonBrowse" > - <property name="text" > - <string>&Browse</string> - </property> - <property name="icon" > - <iconset resource="rbutilqt.qrc" >:/icons/icons/system-search.png</iconset> - </property> - </widget> - </item> - <item row="2" column="1" colspan="3" > - <widget class="QLabel" name="label_3" > - <property name="text" > - <string>Download and select an original Firmware</string> - </property> - </widget> - </item> - <item row="3" column="1" colspan="2" > - <widget class="QLineEdit" name="lineOriginalFirmware" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="toolTip" > - <string>select the original Firmware</string> - </property> - <property name="accessibleDescription" > - <string>select the original Firmware</string> - </property> - </widget> - </item> - <item row="3" column="3" > - <widget class="QPushButton" name="buttonBrowseOF" > - <property name="text" > - <string>&Browse</string> - </property> - <property name="icon" > - <iconset resource="rbutilqt.qrc" >:/icons/icons/system-search.png</iconset> - </property> - </widget> - </item> - <item row="4" column="2" > - <spacer> - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" > - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - <item row="5" column="1" > - <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="5" column="2" colspan="2" > - <layout class="QHBoxLayout" > - <item> - <widget class="QPushButton" name="buttonOk_2" > - <property name="text" > - <string>&Ok</string> - </property> - <property name="icon" > - <iconset resource="rbutilqt.qrc" >:/icons/icons/go-next.png</iconset> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonCancel_2" > - <property name="text" > - <string>&Cancel</string> - </property> - <property name="icon" > - <iconset resource="rbutilqt.qrc" >:/icons/icons/process-stop.png</iconset> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - <resources> - <include location="rbutilqt.qrc" /> - </resources> - <connections> - <connection> - <sender>buttonOk_2</sender> - <signal>clicked()</signal> - <receiver>InstallBootloaderFrm</receiver> - <slot>accept()</slot> - <hints> - <hint type="sourcelabel" > - <x>476</x> - <y>425</y> - </hint> - <hint type="destinationlabel" > - <x>531</x> - <y>317</y> - </hint> - </hints> - </connection> - <connection> - <sender>buttonCancel_2</sender> - <signal>clicked()</signal> - <receiver>InstallBootloaderFrm</receiver> - <slot>reject()</slot> - <hints> - <hint type="sourcelabel" > - <x>556</x> - <y>428</y> - </hint> - <hint type="destinationlabel" > - <x>599</x> - <y>325</y> - </hint> - </hints> - </connection> - </connections> -</ui> diff --git a/rbutil/rbutilqt/installbootloaderwindow.cpp b/rbutil/rbutilqt/installbootloaderwindow.cpp deleted file mode 100644 index 95084e87f7..0000000000 --- a/rbutil/rbutilqt/installbootloaderwindow.cpp +++ /dev/null @@ -1,177 +0,0 @@ -/***************************************************************************
- * __________ __ ___.
- * Open \______ \ ____ ____ | | _\_ |__ _______ ___
- * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
- * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
- * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
- * \/ \/ \/ \/ \/
- *
- * Copyright (C) 2007 by Dominik Wenger
- * $Id: installbootloaderwindow.cpp 14027 2007-07-27 17:42:49Z domonoky $
- *
- * All files in this archive are subject to the GNU General Public License.
- * See the file COPYING in the source tree root for full license agreement.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ****************************************************************************/
-
-#include "installbootloaderwindow.h"
-#include "ui_installprogressfrm.h"
-
-
-InstallBootloaderWindow::InstallBootloaderWindow(QWidget *parent) : QDialog(parent)
-{
- ui.setupUi(this);
- connect(ui.buttonBrowse, SIGNAL(clicked()), this, SLOT(browseFolder()));
- connect(ui.buttonBrowseOF, SIGNAL(clicked()), this, SLOT(browseOF()));
-
-}
-
-void InstallBootloaderWindow::setProxy(QUrl proxy_url)
-{
- proxy = proxy_url;
- qDebug() << "Install::setProxy" << proxy;
-}
-
-void InstallBootloaderWindow::setMountPoint(QString mount)
-{
- QFileInfo m(mount);
- if(m.isDir()) {
- ui.lineMountPoint->clear();
- ui.lineMountPoint->insert(mount);
- }
-}
-
-void InstallBootloaderWindow::setOFPath(QString path)
-{
- QFileInfo m(path);
- if(m.exists()) {
- ui.lineOriginalFirmware->clear();
- ui.lineOriginalFirmware->insert(path);
- }
-}
-
-void InstallBootloaderWindow::browseFolder()
-{
- QFileDialog browser(this);
- if(QFileInfo(ui.lineMountPoint->text()).isDir())
- browser.setDirectory(ui.lineMountPoint->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();
- setMountPoint(files.at(0));
- }
-}
-
-void InstallBootloaderWindow::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 InstallBootloaderWindow::accept()
-{
- // create logger
- logger = new ProgressLoggerGui(this);
- logger->show();
-
- // show dialog with error if mount point is wrong
- if(QFileInfo(ui.lineMountPoint->text()).isDir()) {
- mountPoint = ui.lineMountPoint->text();
- userSettings->setValue("defaults/mountpoint", mountPoint);
- }
- else {
- logger->addItem(tr("Mount point is wrong!"),LOGERROR);
- logger->abort();
- return;
- }
-
- if(QFileInfo(ui.lineOriginalFirmware->text()).exists())
- {
- m_OrigFirmware = ui.lineOriginalFirmware->text();
- }
- else if(needextrafile)
- {
- logger->addItem(tr("Original Firmware Path is wrong!"),LOGERROR);
- logger->abort();
- return;
- }
- userSettings->sync();
-
- binstaller = new BootloaderInstaller(this);
-
- binstaller->setMountPoint(mountPoint);
- binstaller->setProxy(proxy);
- QString plattform = userSettings->value("defaults/platform").toString();
-
- binstaller->setDevice(plattform);
- 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(logger);
-
- connect(binstaller, SIGNAL(done(bool)), this, SLOT(done(bool)));
-
-}
-
-
-void InstallBootloaderWindow::done(bool error)
-{
- qDebug() << "Install::done, error:" << error;
-
- if(error)
- {
- logger->abort();
- return;
- }
-
- // no error, close the window, when the logger is closed
- connect(logger,SIGNAL(closed()),this,SLOT(close()));
-
-}
-
-void InstallBootloaderWindow::setDeviceSettings(QSettings *dev)
-{
- devices = dev;
- qDebug() << "Install::setDeviceSettings:" << devices;
-}
-
-void InstallBootloaderWindow::setUserSettings(QSettings *user)
-{
- userSettings = user;
- 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();
- needextrafile = true;
- }
- else
- {
- ui.buttonBrowseOF->hide();
- ui.lineOriginalFirmware->hide();
- ui.label_3->hide();
- needextrafile = false;
- }
-}
diff --git a/rbutil/rbutilqt/installbootloaderwindow.h b/rbutil/rbutilqt/installbootloaderwindow.h deleted file mode 100644 index 6baafd0bf1..0000000000 --- a/rbutil/rbutilqt/installbootloaderwindow.h +++ /dev/null @@ -1,70 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * - * Copyright (C) 2007 by Dominik Wenger - * $Id: installbootloaderwindow.h 14027 2007-07-27 17:42:49Z domonoky $ - * - * All files in this archive are subject to the GNU General Public License. - * See the file COPYING in the source tree root for full license agreement. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ - -#ifndef INSTALLBL_H -#define INSTALLBL_H - -#include <QtGui> - -#include <QSettings> - -#include "ui_installbootloaderfrm.h" -#include "progressloggergui.h" - -#include "installbootloader.h" -#include "irivertools/irivertools.h" - -class InstallBootloaderWindow : public QDialog -{ - Q_OBJECT - public: - InstallBootloaderWindow(QWidget *parent = 0); - void setProxy(QUrl); - void setMountPoint(QString); - void setOFPath(QString); - void setUserSettings(QSettings*); - void setDeviceSettings(QSettings*); - - public slots: - void accept(void); - - private: - Ui::InstallBootloaderFrm ui; - ProgressLoggerGui* logger; - QUrl proxy; - QSettings *devices; - QSettings *userSettings; - QHttp *download; - QFile *target; - QString file; - QString fileName; - QString mountPoint; - QString m_OrigFirmware; - BootloaderInstaller* binstaller; - bool needextrafile; - - private slots: - void browseFolder(void); - void browseOF(void); - void done(bool); - -}; - - -#endif diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp index 2326648732..fc03ba754e 100644 --- a/rbutil/rbutilqt/rbutilqt.cpp +++ b/rbutil/rbutilqt/rbutilqt.cpp @@ -25,11 +25,11 @@ #include "ui_aboutbox.h" #include "configure.h" #include "install.h" -#include "installbootloaderwindow.h" #include "installtalkwindow.h" #include "httpget.h" #include "installbootloader.h" #include "uninstallwindow.h" +#include "browseof.h" #ifdef __linux #include <stdio.h> @@ -280,18 +280,67 @@ void RbUtilQt::install() void RbUtilQt::installBl() { - InstallBootloaderWindow *installWindow = new InstallBootloaderWindow(this); - installWindow->setUserSettings(userSettings); - installWindow->setDeviceSettings(devices); + if(QMessageBox::question(this, tr("Confirm Installation"), + tr("Do you really want to install the Bootloader?"), + QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return; + + // create logger + logger = new ProgressLoggerGui(this); + logger->show(); + + QString platform = userSettings->value("defaults/platform").toString(); + + // if fwpatcher , ask for extra file + QString offirmware; + if(devices->value(platform + "/bootloadermethod").toString() == "fwpatcher") + { + BrowseOF ofbrowser(this); + ofbrowser.setFile(userSettings->value("defaults/ofpath").toString()); + if(ofbrowser.exec() == QDialog::Accepted) + { + offirmware = ofbrowser.getFile(); + qDebug() << offirmware; + if(!QFileInfo(offirmware).exists()) + { + logger->addItem(tr("Original Firmware Path is wrong!"),LOGERROR); + logger->abort(); + return; + } + else + { + userSettings->setValue("defaults/ofpath",offirmware); + userSettings->sync(); + } + } + else + { + logger->addItem(tr("Original Firmware selection Canceled!"),LOGERROR); + logger->abort(); + return; + } + } + + // create installer + blinstaller = new BootloaderInstaller(this); + + blinstaller->setMountPoint(userSettings->value("defaults/mountpoint").toString()); + if(userSettings->value("defaults/proxytype") == "manual") - installWindow->setProxy(QUrl(userSettings->value("defaults/proxy").toString())); + blinstaller->setProxy(QUrl(userSettings->value("defaults/proxy").toString())); #ifdef __linux else if(userSettings->value("defaults/proxytype") == "system") - installWindow->setProxy(QUrl(getenv("http_proxy"))); + blinstaller->setProxy(QUrl(getenv("http_proxy"))); #endif - installWindow->setMountPoint(userSettings->value("defaults/mountpoint").toString()); - installWindow->show(); + blinstaller->setDevice(platform); + blinstaller->setBootloaderMethod(devices->value(platform + "/bootloadermethod").toString()); + blinstaller->setBootloaderName(devices->value(platform + "/bootloadername").toString()); + blinstaller->setBootloaderBaseUrl(devices->value("bootloader_url").toString()); + blinstaller->setOrigFirmwarePath(offirmware); + + blinstaller->install(logger); + + // connect(blinstaller, SIGNAL(done(bool)), this, SLOT(done(bool))); } @@ -319,7 +368,7 @@ void RbUtilQt::installFonts() installer->setMountPoint(userSettings->value("defaults/mountpoint").toString()); installer->install(logger); - connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool))); + // connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool))); } @@ -357,7 +406,7 @@ void RbUtilQt::installVoice() installer->setTarget("/.rockbox/langs/english.voice"); installer->install(logger); - connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool))); + //connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool))); } @@ -381,11 +430,11 @@ void RbUtilQt::installDoom() installer->setProxy(QUrl(getenv("http_proxy"))); #endif - installer->setLogSection("Game Addons"); + installer->setLogSection("GameAddons"); installer->setMountPoint(userSettings->value("defaults/mountpoint").toString()); installer->install(logger); - connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool))); + // connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool))); } diff --git a/rbutil/rbutilqt/rbutilqt.h b/rbutil/rbutilqt/rbutilqt.h index fe8dd3b32a..62a7aac3bd 100644 --- a/rbutil/rbutilqt/rbutilqt.h +++ b/rbutil/rbutilqt/rbutilqt.h @@ -28,6 +28,7 @@ #include "httpget.h" #include "installzip.h" #include "progressloggergui.h" +#include "installbootloader.h" class RbUtilQt : public QMainWindow { @@ -49,6 +50,7 @@ class RbUtilQt : public QMainWindow void updateManual(void); ProgressLoggerGui *logger; ZipInstaller *installer; + BootloaderInstaller* blinstaller; private slots: void about(void); diff --git a/rbutil/rbutilqt/rbutilqt.pro b/rbutil/rbutilqt/rbutilqt.pro index bc72af2538..40e205b147 100644 --- a/rbutil/rbutilqt/rbutilqt.pro +++ b/rbutil/rbutilqt/rbutilqt.pro @@ -21,7 +21,6 @@ SOURCES += rbutilqt.cpp \ zip/unzip.cpp \ installzip.cpp \ installbootloader.cpp \ - installbootloaderwindow.cpp \ progressloggergui.cpp \ installtalkwindow.cpp \ talkfile.cpp \ @@ -32,7 +31,8 @@ SOURCES += rbutilqt.cpp \ irivertools/md5sum.cpp \ browsedirtree.cpp \ uninstall.cpp \ - uninstallwindow.cpp + uninstallwindow.cpp \ + browseof.cpp HEADERS += rbutilqt.h \ settings.h \ @@ -47,7 +47,6 @@ HEADERS += rbutilqt.h \ version.h \ installzip.h \ installbootloader.h \ - installbootloaderwindow.h \ installtalkwindow.h \ talkfile.h \ autodetection.h \ @@ -66,7 +65,8 @@ HEADERS += rbutilqt.h \ irivertools/checksums.h \ browsedirtree.h \ uninstall.h \ - uninstallwindow.h + uninstallwindow.h \ + browseof.h # Needed by QT on Win INCLUDEPATH = . irivertools zip zlib ../ipodpatcher ../sansapatcher @@ -83,10 +83,10 @@ FORMS += rbutilqtfrm.ui \ installfrm.ui \ installprogressfrm.ui \ configurefrm.ui \ - installbootloaderfrm.ui \ browsedirtreefrm.ui \ installtalkfrm.ui \ - uninstallfrm.ui + uninstallfrm.ui \ + browseoffrm.ui RESOURCES += rbutilqt.qrc |