mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 12:45:26 -05:00
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
This commit is contained in:
parent
8897e8cdfd
commit
9789d303f2
12 changed files with 316 additions and 441 deletions
|
|
@ -7,7 +7,7 @@
|
||||||
* \/ \/ \/ \/ \/
|
* \/ \/ \/ \/ \/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 by Dominik Riebeling
|
* 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.
|
* 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.
|
* See the file COPYING in the source tree root for full license agreement.
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
* \/ \/ \/ \/ \/
|
* \/ \/ \/ \/ \/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 by Dominik Riebeling
|
* 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.
|
* 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.
|
* See the file COPYING in the source tree root for full license agreement.
|
||||||
|
|
|
||||||
69
rbutil/rbutilqt/browseof.cpp
Normal file
69
rbutil/rbutilqt/browseof.cpp
Normal file
|
|
@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
46
rbutil/rbutilqt/browseof.h
Normal file
46
rbutil/rbutilqt/browseof.h
Normal file
|
|
@ -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
|
||||||
112
rbutil/rbutilqt/browseoffrm.ui
Normal file
112
rbutil/rbutilqt/browseoffrm.ui
Normal file
|
|
@ -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>
|
||||||
|
|
@ -302,6 +302,14 @@ void BootloaderInstaller::gigabeatFinish()
|
||||||
downloadFile.remove();
|
downloadFile.remove();
|
||||||
|
|
||||||
m_dp->addItem(tr("Bootloader install finished successfully."),LOGOK);
|
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();
|
m_dp->abort();
|
||||||
|
|
||||||
emit done(false); // success
|
emit done(false); // success
|
||||||
|
|
@ -350,6 +358,11 @@ void BootloaderInstaller::iaudioFinish()
|
||||||
downloadFile.remove();
|
downloadFile.remove();
|
||||||
|
|
||||||
m_dp->addItem(tr("Bootloader install finished successfully."),LOGOK);
|
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();
|
m_dp->abort();
|
||||||
|
|
||||||
emit done(false); // success
|
emit done(false); // success
|
||||||
|
|
@ -1070,6 +1083,11 @@ void BootloaderInstaller::iriverFinish()
|
||||||
newHex.remove();
|
newHex.remove();
|
||||||
|
|
||||||
m_dp->addItem(tr("Bootloader install finished successfully."),LOGOK);
|
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();
|
m_dp->abort();
|
||||||
|
|
||||||
emit done(false); // success
|
emit done(false); // success
|
||||||
|
|
|
||||||
|
|
@ -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>
|
|
||||||
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -25,11 +25,11 @@
|
||||||
#include "ui_aboutbox.h"
|
#include "ui_aboutbox.h"
|
||||||
#include "configure.h"
|
#include "configure.h"
|
||||||
#include "install.h"
|
#include "install.h"
|
||||||
#include "installbootloaderwindow.h"
|
|
||||||
#include "installtalkwindow.h"
|
#include "installtalkwindow.h"
|
||||||
#include "httpget.h"
|
#include "httpget.h"
|
||||||
#include "installbootloader.h"
|
#include "installbootloader.h"
|
||||||
#include "uninstallwindow.h"
|
#include "uninstallwindow.h"
|
||||||
|
#include "browseof.h"
|
||||||
|
|
||||||
#ifdef __linux
|
#ifdef __linux
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
@ -280,18 +280,67 @@ void RbUtilQt::install()
|
||||||
|
|
||||||
void RbUtilQt::installBl()
|
void RbUtilQt::installBl()
|
||||||
{
|
{
|
||||||
InstallBootloaderWindow *installWindow = new InstallBootloaderWindow(this);
|
if(QMessageBox::question(this, tr("Confirm Installation"),
|
||||||
installWindow->setUserSettings(userSettings);
|
tr("Do you really want to install the Bootloader?"),
|
||||||
installWindow->setDeviceSettings(devices);
|
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")
|
if(userSettings->value("defaults/proxytype") == "manual")
|
||||||
installWindow->setProxy(QUrl(userSettings->value("defaults/proxy").toString()));
|
blinstaller->setProxy(QUrl(userSettings->value("defaults/proxy").toString()));
|
||||||
#ifdef __linux
|
#ifdef __linux
|
||||||
else if(userSettings->value("defaults/proxytype") == "system")
|
else if(userSettings->value("defaults/proxytype") == "system")
|
||||||
installWindow->setProxy(QUrl(getenv("http_proxy")));
|
blinstaller->setProxy(QUrl(getenv("http_proxy")));
|
||||||
#endif
|
#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->setMountPoint(userSettings->value("defaults/mountpoint").toString());
|
||||||
installer->install(logger);
|
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->setTarget("/.rockbox/langs/english.voice");
|
||||||
installer->install(logger);
|
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")));
|
installer->setProxy(QUrl(getenv("http_proxy")));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
installer->setLogSection("Game Addons");
|
installer->setLogSection("GameAddons");
|
||||||
installer->setMountPoint(userSettings->value("defaults/mountpoint").toString());
|
installer->setMountPoint(userSettings->value("defaults/mountpoint").toString());
|
||||||
installer->install(logger);
|
installer->install(logger);
|
||||||
|
|
||||||
connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool)));
|
// connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@
|
||||||
#include "httpget.h"
|
#include "httpget.h"
|
||||||
#include "installzip.h"
|
#include "installzip.h"
|
||||||
#include "progressloggergui.h"
|
#include "progressloggergui.h"
|
||||||
|
#include "installbootloader.h"
|
||||||
|
|
||||||
class RbUtilQt : public QMainWindow
|
class RbUtilQt : public QMainWindow
|
||||||
{
|
{
|
||||||
|
|
@ -49,6 +50,7 @@ class RbUtilQt : public QMainWindow
|
||||||
void updateManual(void);
|
void updateManual(void);
|
||||||
ProgressLoggerGui *logger;
|
ProgressLoggerGui *logger;
|
||||||
ZipInstaller *installer;
|
ZipInstaller *installer;
|
||||||
|
BootloaderInstaller* blinstaller;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void about(void);
|
void about(void);
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ SOURCES += rbutilqt.cpp \
|
||||||
zip/unzip.cpp \
|
zip/unzip.cpp \
|
||||||
installzip.cpp \
|
installzip.cpp \
|
||||||
installbootloader.cpp \
|
installbootloader.cpp \
|
||||||
installbootloaderwindow.cpp \
|
|
||||||
progressloggergui.cpp \
|
progressloggergui.cpp \
|
||||||
installtalkwindow.cpp \
|
installtalkwindow.cpp \
|
||||||
talkfile.cpp \
|
talkfile.cpp \
|
||||||
|
|
@ -32,7 +31,8 @@ SOURCES += rbutilqt.cpp \
|
||||||
irivertools/md5sum.cpp \
|
irivertools/md5sum.cpp \
|
||||||
browsedirtree.cpp \
|
browsedirtree.cpp \
|
||||||
uninstall.cpp \
|
uninstall.cpp \
|
||||||
uninstallwindow.cpp
|
uninstallwindow.cpp \
|
||||||
|
browseof.cpp
|
||||||
|
|
||||||
HEADERS += rbutilqt.h \
|
HEADERS += rbutilqt.h \
|
||||||
settings.h \
|
settings.h \
|
||||||
|
|
@ -47,7 +47,6 @@ HEADERS += rbutilqt.h \
|
||||||
version.h \
|
version.h \
|
||||||
installzip.h \
|
installzip.h \
|
||||||
installbootloader.h \
|
installbootloader.h \
|
||||||
installbootloaderwindow.h \
|
|
||||||
installtalkwindow.h \
|
installtalkwindow.h \
|
||||||
talkfile.h \
|
talkfile.h \
|
||||||
autodetection.h \
|
autodetection.h \
|
||||||
|
|
@ -66,7 +65,8 @@ HEADERS += rbutilqt.h \
|
||||||
irivertools/checksums.h \
|
irivertools/checksums.h \
|
||||||
browsedirtree.h \
|
browsedirtree.h \
|
||||||
uninstall.h \
|
uninstall.h \
|
||||||
uninstallwindow.h
|
uninstallwindow.h \
|
||||||
|
browseof.h
|
||||||
|
|
||||||
# Needed by QT on Win
|
# Needed by QT on Win
|
||||||
INCLUDEPATH = . irivertools zip zlib ../ipodpatcher ../sansapatcher
|
INCLUDEPATH = . irivertools zip zlib ../ipodpatcher ../sansapatcher
|
||||||
|
|
@ -83,10 +83,10 @@ FORMS += rbutilqtfrm.ui \
|
||||||
installfrm.ui \
|
installfrm.ui \
|
||||||
installprogressfrm.ui \
|
installprogressfrm.ui \
|
||||||
configurefrm.ui \
|
configurefrm.ui \
|
||||||
installbootloaderfrm.ui \
|
|
||||||
browsedirtreefrm.ui \
|
browsedirtreefrm.ui \
|
||||||
installtalkfrm.ui \
|
installtalkfrm.ui \
|
||||||
uninstallfrm.ui
|
uninstallfrm.ui \
|
||||||
|
browseoffrm.ui
|
||||||
|
|
||||||
RESOURCES += rbutilqt.qrc
|
RESOURCES += rbutilqt.qrc
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue