summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Wenger <domonoky@googlemail.com>2007-08-15 14:16:20 +0000
committerDominik Wenger <domonoky@googlemail.com>2007-08-15 14:16:20 +0000
commit9789d303f234d259bb9c3de96dc6ca7c6ebde183 (patch)
tree84e3b451d2e58e6af0d6f1f4821bdc400e001279
parent8897e8cdfd9c0fbd5ba4a14df19e646391dc6cca (diff)
downloadrockbox-9789d303f234d259bb9c3de96dc6ca7c6ebde183.tar.gz
rockbox-9789d303f234d259bb9c3de96dc6ca7c6ebde183.zip
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
-rw-r--r--rbutil/rbutilqt/browsedirtree.cpp2
-rw-r--r--rbutil/rbutilqt/browsedirtree.h2
-rw-r--r--rbutil/rbutilqt/browseof.cpp69
-rw-r--r--rbutil/rbutilqt/browseof.h46
-rw-r--r--rbutil/rbutilqt/browseoffrm.ui112
-rw-r--r--rbutil/rbutilqt/installbootloader.cpp18
-rw-r--r--rbutil/rbutilqt/installbootloaderfrm.ui174
-rw-r--r--rbutil/rbutilqt/installbootloaderwindow.cpp177
-rw-r--r--rbutil/rbutilqt/installbootloaderwindow.h70
-rw-r--r--rbutil/rbutilqt/rbutilqt.cpp73
-rw-r--r--rbutil/rbutilqt/rbutilqt.h2
-rw-r--r--rbutil/rbutilqt/rbutilqt.pro12
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 @@
7 * \/ \/ \/ \/ \/ 7 * \/ \/ \/ \/ \/
8 * 8 *
9 * Copyright (C) 2007 by Dominik Riebeling 9 * Copyright (C) 2007 by Dominik Riebeling
10 * $Id: installrb.cpp 13990 2007-07-25 22:26:10Z Dominik Wenger $ 10 * $Id: browsedirtree.cpp 13990 2007-07-25 22:26:10Z bluebrother $
11 * 11 *
12 * All files in this archive are subject to the GNU General Public License. 12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement. 13 * 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 @@
7 * \/ \/ \/ \/ \/ 7 * \/ \/ \/ \/ \/
8 * 8 *
9 * Copyright (C) 2007 by Dominik Riebeling 9 * Copyright (C) 2007 by Dominik Riebeling
10 * $Id: installrb.cpp 13990 2007-07-25 22:26:10Z Dominik Wenger $ 10 * $Id: browsedirtree.h 13990 2007-07-25 22:26:10Z bluebrother $
11 * 11 *
12 * All files in this archive are subject to the GNU General Public License. 12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement. 13 * 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 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2007 by Dominik Wenger
10 * $Id: browseof.cpp 13990 2007-07-25 22:26:10Z domonoky $
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#include <QtGui>
21
22#include "browseof.h"
23#include "browsedirtree.h"
24
25
26BrowseOF::BrowseOF(QWidget *parent) : QDialog(parent)
27{
28 ui.setupUi(this);
29 this->setModal(true);
30
31 connect(ui.browseOFButton,SIGNAL(clicked()),this,SLOT(onBrowse()));
32}
33
34void BrowseOF::setFile(QString file)
35{
36 ui.OFlineEdit->setText(file);
37}
38
39void BrowseOF::onBrowse()
40{
41 BrowseDirtree browser(this);
42 browser.setFilter(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot);
43
44 if(QFileInfo(ui.OFlineEdit->text()).exists())
45 {
46 QDir d(ui.OFlineEdit->text());
47 browser.setDir(d);
48 }
49
50 if(browser.exec() == QDialog::Accepted)
51 {
52 qDebug() << browser.getSelected();
53 setFile(browser.getSelected());
54 }
55}
56
57QString BrowseOF::getFile()
58{
59 return ui.OFlineEdit->text();
60}
61
62void BrowseOF::accept()
63{
64 this->close();
65 setResult(QDialog::Accepted);
66}
67
68
69
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 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2007 by Dominik Wenger
10 * $Id: browseof.h 13990 2007-07-25 22:26:10Z domonoky $
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#ifndef BROWSEOF_H
21#define BROWSEOF_H
22
23#include <QtGui>
24#include "ui_browseoffrm.h"
25
26class BrowseOF : public QDialog
27{
28 Q_OBJECT
29
30 public:
31 BrowseOF(QWidget *parent = 0);
32 void setFile(QString file);
33 QString getFile();
34
35
36 private slots:
37 void onBrowse();
38
39 private:
40 Ui::BrowseOFFrm ui;
41
42 private slots:
43 void accept(void);
44};
45
46#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 @@
1<ui version="4.0" >
2 <class>BrowseOFFrm</class>
3 <widget class="QDialog" name="BrowseOFFrm" >
4 <property name="geometry" >
5 <rect>
6 <x>0</x>
7 <y>0</y>
8 <width>460</width>
9 <height>97</height>
10 </rect>
11 </property>
12 <property name="windowTitle" >
13 <string>Find original Firmware</string>
14 </property>
15 <layout class="QGridLayout" >
16 <item row="0" column="0" colspan="3" >
17 <widget class="QLabel" name="label" >
18 <property name="text" >
19 <string>Browse for a downloaded copy of the original firmware</string>
20 </property>
21 <property name="wordWrap" >
22 <bool>true</bool>
23 </property>
24 </widget>
25 </item>
26 <item row="1" column="0" colspan="2" >
27 <widget class="QLineEdit" name="OFlineEdit" />
28 </item>
29 <item row="1" column="2" >
30 <widget class="QPushButton" name="browseOFButton" >
31 <property name="text" >
32 <string>Browse</string>
33 </property>
34 </widget>
35 </item>
36 <item row="2" column="0" >
37 <spacer>
38 <property name="orientation" >
39 <enum>Qt::Horizontal</enum>
40 </property>
41 <property name="sizeHint" >
42 <size>
43 <width>241</width>
44 <height>28</height>
45 </size>
46 </property>
47 </spacer>
48 </item>
49 <item row="2" column="1" colspan="2" >
50 <layout class="QHBoxLayout" >
51 <item>
52 <widget class="QPushButton" name="buttonOk" >
53 <property name="text" >
54 <string>&amp;Ok</string>
55 </property>
56 <property name="icon" >
57 <iconset resource="rbutilqt.qrc" >:/icons/icons/go-next.png</iconset>
58 </property>
59 </widget>
60 </item>
61 <item>
62 <widget class="QPushButton" name="buttonCancel" >
63 <property name="text" >
64 <string>&amp;Cancel</string>
65 </property>
66 <property name="icon" >
67 <iconset resource="rbutilqt.qrc" >:/icons/icons/process-stop.png</iconset>
68 </property>
69 </widget>
70 </item>
71 </layout>
72 </item>
73 </layout>
74 </widget>
75 <resources>
76 <include location="rbutilqt.qrc" />
77 </resources>
78 <connections>
79 <connection>
80 <sender>buttonCancel</sender>
81 <signal>clicked()</signal>
82 <receiver>BrowseOFFrm</receiver>
83 <slot>reject()</slot>
84 <hints>
85 <hint type="sourcelabel" >
86 <x>224</x>
87 <y>355</y>
88 </hint>
89 <hint type="destinationlabel" >
90 <x>48</x>
91 <y>349</y>
92 </hint>
93 </hints>
94 </connection>
95 <connection>
96 <sender>buttonOk</sender>
97 <signal>clicked()</signal>
98 <receiver>BrowseOFFrm</receiver>
99 <slot>accept()</slot>
100 <hints>
101 <hint type="sourcelabel" >
102 <x>146</x>
103 <y>358</y>
104 </hint>
105 <hint type="destinationlabel" >
106 <x>74</x>
107 <y>357</y>
108 </hint>
109 </hints>
110 </connection>
111 </connections>
112</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()
302 downloadFile.remove(); 302 downloadFile.remove();
303 303
304 m_dp->addItem(tr("Bootloader install finished successfully."),LOGOK); 304 m_dp->addItem(tr("Bootloader install finished successfully."),LOGOK);
305 m_dp->addItem(tr("To finish the Bootloader installation, follow the steps below."),LOGINFO);
306 m_dp->addItem(tr("1. Eject/Unmount your Device."),LOGINFO);
307 m_dp->addItem(tr("2. Unplug USB and any Power adapters."),LOGINFO);
308 m_dp->addItem(tr("3. Hold POWER to turn the Device off."),LOGINFO);
309 m_dp->addItem(tr("4. Toggle the Battery switch on the Device."),LOGINFO);
310 m_dp->addItem(tr("5. Hold POWER to boot the Rockbox bootloader."),LOGINFO);
311
312
305 m_dp->abort(); 313 m_dp->abort();
306 314
307 emit done(false); // success 315 emit done(false); // success
@@ -350,6 +358,11 @@ void BootloaderInstaller::iaudioFinish()
350 downloadFile.remove(); 358 downloadFile.remove();
351 359
352 m_dp->addItem(tr("Bootloader install finished successfully."),LOGOK); 360 m_dp->addItem(tr("Bootloader install finished successfully."),LOGOK);
361 m_dp->addItem(tr("To finish the Bootloader installation, follow the steps below."),LOGINFO);
362 m_dp->addItem(tr("1. Eject/Unmount your Device."),LOGINFO);
363 m_dp->addItem(tr("2. Turn you Device OFF."),LOGINFO);
364 m_dp->addItem(tr("3. Insert Charger."),LOGINFO);
365
353 m_dp->abort(); 366 m_dp->abort();
354 367
355 emit done(false); // success 368 emit done(false); // success
@@ -1070,6 +1083,11 @@ void BootloaderInstaller::iriverFinish()
1070 newHex.remove(); 1083 newHex.remove();
1071 1084
1072 m_dp->addItem(tr("Bootloader install finished successfully."),LOGOK); 1085 m_dp->addItem(tr("Bootloader install finished successfully."),LOGOK);
1086 m_dp->addItem(tr("To finish the Bootloader installation, follow the steps below."),LOGINFO);
1087 m_dp->addItem(tr("1. Eject/Unmount your Device."),LOGINFO);
1088 m_dp->addItem(tr("2. Boot into the original Firmware."),LOGINFO);
1089 m_dp->addItem(tr("3. Use the Firmware flash option in the Original Firmware."),LOGINFO);
1090 m_dp->addItem(tr("4. Reboot."),LOGINFO);
1073 m_dp->abort(); 1091 m_dp->abort();
1074 1092
1075 emit done(false); // success 1093 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 @@
1<ui version="4.0" >
2 <class>InstallBootloaderFrm</class>
3 <widget class="QDialog" name="InstallBootloaderFrm" >
4 <property name="windowModality" >
5 <enum>Qt::WindowModal</enum>
6 </property>
7 <property name="geometry" >
8 <rect>
9 <x>0</x>
10 <y>0</y>
11 <width>600</width>
12 <height>450</height>
13 </rect>
14 </property>
15 <property name="windowTitle" >
16 <string>Install Bootloader</string>
17 </property>
18 <layout class="QGridLayout" >
19 <item rowspan="6" row="0" column="0" >
20 <widget class="QLabel" name="label" >
21 <property name="text" >
22 <string/>
23 </property>
24 <property name="pixmap" >
25 <pixmap resource="rbutilqt.qrc" >:/icons/icons/wizard.xpm</pixmap>
26 </property>
27 <property name="alignment" >
28 <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
29 </property>
30 </widget>
31 </item>
32 <item row="0" column="1" colspan="3" >
33 <widget class="QLabel" name="label_2" >
34 <property name="text" >
35 <string>Select your device in the filesystem</string>
36 </property>
37 </widget>
38 </item>
39 <item row="1" column="1" colspan="2" >
40 <widget class="QLineEdit" name="lineMountPoint" />
41 </item>
42 <item row="1" column="3" >
43 <widget class="QPushButton" name="buttonBrowse" >
44 <property name="text" >
45 <string>&amp;Browse</string>
46 </property>
47 <property name="icon" >
48 <iconset resource="rbutilqt.qrc" >:/icons/icons/system-search.png</iconset>
49 </property>
50 </widget>
51 </item>
52 <item row="2" column="1" colspan="3" >
53 <widget class="QLabel" name="label_3" >
54 <property name="text" >
55 <string>Download and select an original Firmware</string>
56 </property>
57 </widget>
58 </item>
59 <item row="3" column="1" colspan="2" >
60 <widget class="QLineEdit" name="lineOriginalFirmware" >
61 <property name="sizePolicy" >
62 <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
63 <horstretch>0</horstretch>
64 <verstretch>0</verstretch>
65 </sizepolicy>
66 </property>
67 <property name="toolTip" >
68 <string>select the original Firmware</string>
69 </property>
70 <property name="accessibleDescription" >
71 <string>select the original Firmware</string>
72 </property>
73 </widget>
74 </item>
75 <item row="3" column="3" >
76 <widget class="QPushButton" name="buttonBrowseOF" >
77 <property name="text" >
78 <string>&amp;Browse</string>
79 </property>
80 <property name="icon" >
81 <iconset resource="rbutilqt.qrc" >:/icons/icons/system-search.png</iconset>
82 </property>
83 </widget>
84 </item>
85 <item row="4" column="2" >
86 <spacer>
87 <property name="orientation" >
88 <enum>Qt::Vertical</enum>
89 </property>
90 <property name="sizeHint" >
91 <size>
92 <width>20</width>
93 <height>40</height>
94 </size>
95 </property>
96 </spacer>
97 </item>
98 <item row="5" column="1" >
99 <spacer>
100 <property name="orientation" >
101 <enum>Qt::Horizontal</enum>
102 </property>
103 <property name="sizeHint" >
104 <size>
105 <width>40</width>
106 <height>20</height>
107 </size>
108 </property>
109 </spacer>
110 </item>
111 <item row="5" column="2" colspan="2" >
112 <layout class="QHBoxLayout" >
113 <item>
114 <widget class="QPushButton" name="buttonOk_2" >
115 <property name="text" >
116 <string>&amp;Ok</string>
117 </property>
118 <property name="icon" >
119 <iconset resource="rbutilqt.qrc" >:/icons/icons/go-next.png</iconset>
120 </property>
121 </widget>
122 </item>
123 <item>
124 <widget class="QPushButton" name="buttonCancel_2" >
125 <property name="text" >
126 <string>&amp;Cancel</string>
127 </property>
128 <property name="icon" >
129 <iconset resource="rbutilqt.qrc" >:/icons/icons/process-stop.png</iconset>
130 </property>
131 </widget>
132 </item>
133 </layout>
134 </item>
135 </layout>
136 </widget>
137 <resources>
138 <include location="rbutilqt.qrc" />
139 </resources>
140 <connections>
141 <connection>
142 <sender>buttonOk_2</sender>
143 <signal>clicked()</signal>
144 <receiver>InstallBootloaderFrm</receiver>
145 <slot>accept()</slot>
146 <hints>
147 <hint type="sourcelabel" >
148 <x>476</x>
149 <y>425</y>
150 </hint>
151 <hint type="destinationlabel" >
152 <x>531</x>
153 <y>317</y>
154 </hint>
155 </hints>
156 </connection>
157 <connection>
158 <sender>buttonCancel_2</sender>
159 <signal>clicked()</signal>
160 <receiver>InstallBootloaderFrm</receiver>
161 <slot>reject()</slot>
162 <hints>
163 <hint type="sourcelabel" >
164 <x>556</x>
165 <y>428</y>
166 </hint>
167 <hint type="destinationlabel" >
168 <x>599</x>
169 <y>325</y>
170 </hint>
171 </hints>
172 </connection>
173 </connections>
174</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 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2007 by Dominik Wenger
10 * $Id: installbootloaderwindow.cpp 14027 2007-07-27 17:42:49Z domonoky $
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#include "installbootloaderwindow.h"
21#include "ui_installprogressfrm.h"
22
23
24InstallBootloaderWindow::InstallBootloaderWindow(QWidget *parent) : QDialog(parent)
25{
26 ui.setupUi(this);
27 connect(ui.buttonBrowse, SIGNAL(clicked()), this, SLOT(browseFolder()));
28 connect(ui.buttonBrowseOF, SIGNAL(clicked()), this, SLOT(browseOF()));
29
30}
31
32void InstallBootloaderWindow::setProxy(QUrl proxy_url)
33{
34 proxy = proxy_url;
35 qDebug() << "Install::setProxy" << proxy;
36}
37
38void InstallBootloaderWindow::setMountPoint(QString mount)
39{
40 QFileInfo m(mount);
41 if(m.isDir()) {
42 ui.lineMountPoint->clear();
43 ui.lineMountPoint->insert(mount);
44 }
45}
46
47void InstallBootloaderWindow::setOFPath(QString path)
48{
49 QFileInfo m(path);
50 if(m.exists()) {
51 ui.lineOriginalFirmware->clear();
52 ui.lineOriginalFirmware->insert(path);
53 }
54}
55
56void InstallBootloaderWindow::browseFolder()
57{
58 QFileDialog browser(this);
59 if(QFileInfo(ui.lineMountPoint->text()).isDir())
60 browser.setDirectory(ui.lineMountPoint->text());
61 else
62 browser.setDirectory("/media");
63 browser.setReadOnly(true);
64 browser.setFileMode(QFileDialog::DirectoryOnly);
65 browser.setAcceptMode(QFileDialog::AcceptOpen);
66 if(browser.exec()) {
67 qDebug() << browser.directory();
68 QStringList files = browser.selectedFiles();
69 setMountPoint(files.at(0));
70 }
71}
72
73void InstallBootloaderWindow::browseOF()
74{
75 QFileDialog browser(this);
76 if(QFileInfo(ui.lineOriginalFirmware->text()).exists())
77 browser.setDirectory(ui.lineOriginalFirmware->text());
78 else
79 browser.setDirectory("/media");
80 browser.setReadOnly(true);
81 browser.setAcceptMode(QFileDialog::AcceptOpen);
82 if(browser.exec()) {
83 qDebug() << browser.directory();
84 QStringList files = browser.selectedFiles();
85 setOFPath(files.at(0));
86 }
87}
88
89void InstallBootloaderWindow::accept()
90{
91 // create logger
92 logger = new ProgressLoggerGui(this);
93 logger->show();
94
95 // show dialog with error if mount point is wrong
96 if(QFileInfo(ui.lineMountPoint->text()).isDir()) {
97 mountPoint = ui.lineMountPoint->text();
98 userSettings->setValue("defaults/mountpoint", mountPoint);
99 }
100 else {
101 logger->addItem(tr("Mount point is wrong!"),LOGERROR);
102 logger->abort();
103 return;
104 }
105
106 if(QFileInfo(ui.lineOriginalFirmware->text()).exists())
107 {
108 m_OrigFirmware = ui.lineOriginalFirmware->text();
109 }
110 else if(needextrafile)
111 {
112 logger->addItem(tr("Original Firmware Path is wrong!"),LOGERROR);
113 logger->abort();
114 return;
115 }
116 userSettings->sync();
117
118 binstaller = new BootloaderInstaller(this);
119
120 binstaller->setMountPoint(mountPoint);
121 binstaller->setProxy(proxy);
122 QString plattform = userSettings->value("defaults/platform").toString();
123
124 binstaller->setDevice(plattform);
125 binstaller->setBootloaderMethod(devices->value(plattform + "/bootloadermethod").toString());
126 binstaller->setBootloaderName(devices->value(plattform + "/bootloadername").toString());
127 binstaller->setBootloaderBaseUrl(devices->value("bootloader_url").toString());
128 binstaller->setOrigFirmwarePath(m_OrigFirmware);
129
130 binstaller->install(logger);
131
132 connect(binstaller, SIGNAL(done(bool)), this, SLOT(done(bool)));
133
134}
135
136
137void InstallBootloaderWindow::done(bool error)
138{
139 qDebug() << "Install::done, error:" << error;
140
141 if(error)
142 {
143 logger->abort();
144 return;
145 }
146
147 // no error, close the window, when the logger is closed
148 connect(logger,SIGNAL(closed()),this,SLOT(close()));
149
150}
151
152void InstallBootloaderWindow::setDeviceSettings(QSettings *dev)
153{
154 devices = dev;
155 qDebug() << "Install::setDeviceSettings:" << devices;
156}
157
158void InstallBootloaderWindow::setUserSettings(QSettings *user)
159{
160 userSettings = user;
161 if(userSettings->value("defaults/platform").toString() == "h100" ||
162 userSettings->value("defaults/platform").toString() == "h120" ||
163 userSettings->value("defaults/platform").toString() == "h300")
164 {
165 ui.buttonBrowseOF->show();
166 ui.lineOriginalFirmware->show();
167 ui.label_3->show();
168 needextrafile = true;
169 }
170 else
171 {
172 ui.buttonBrowseOF->hide();
173 ui.lineOriginalFirmware->hide();
174 ui.label_3->hide();
175 needextrafile = false;
176 }
177}
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 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2007 by Dominik Wenger
10 * $Id: installbootloaderwindow.h 14027 2007-07-27 17:42:49Z domonoky $
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#ifndef INSTALLBL_H
21#define INSTALLBL_H
22
23#include <QtGui>
24
25#include <QSettings>
26
27#include "ui_installbootloaderfrm.h"
28#include "progressloggergui.h"
29
30#include "installbootloader.h"
31#include "irivertools/irivertools.h"
32
33class InstallBootloaderWindow : public QDialog
34{
35 Q_OBJECT
36 public:
37 InstallBootloaderWindow(QWidget *parent = 0);
38 void setProxy(QUrl);
39 void setMountPoint(QString);
40 void setOFPath(QString);
41 void setUserSettings(QSettings*);
42 void setDeviceSettings(QSettings*);
43
44 public slots:
45 void accept(void);
46
47 private:
48 Ui::InstallBootloaderFrm ui;
49 ProgressLoggerGui* logger;
50 QUrl proxy;
51 QSettings *devices;
52 QSettings *userSettings;
53 QHttp *download;
54 QFile *target;
55 QString file;
56 QString fileName;
57 QString mountPoint;
58 QString m_OrigFirmware;
59 BootloaderInstaller* binstaller;
60 bool needextrafile;
61
62 private slots:
63 void browseFolder(void);
64 void browseOF(void);
65 void done(bool);
66
67};
68
69
70#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 @@
25#include "ui_aboutbox.h" 25#include "ui_aboutbox.h"
26#include "configure.h" 26#include "configure.h"
27#include "install.h" 27#include "install.h"
28#include "installbootloaderwindow.h"
29#include "installtalkwindow.h" 28#include "installtalkwindow.h"
30#include "httpget.h" 29#include "httpget.h"
31#include "installbootloader.h" 30#include "installbootloader.h"
32#include "uninstallwindow.h" 31#include "uninstallwindow.h"
32#include "browseof.h"
33 33
34#ifdef __linux 34#ifdef __linux
35#include <stdio.h> 35#include <stdio.h>
@@ -280,18 +280,67 @@ void RbUtilQt::install()
280 280
281void RbUtilQt::installBl() 281void RbUtilQt::installBl()
282{ 282{
283 InstallBootloaderWindow *installWindow = new InstallBootloaderWindow(this); 283 if(QMessageBox::question(this, tr("Confirm Installation"),
284 installWindow->setUserSettings(userSettings); 284 tr("Do you really want to install the Bootloader?"),
285 installWindow->setDeviceSettings(devices); 285 QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return;
286
287 // create logger
288 logger = new ProgressLoggerGui(this);
289 logger->show();
290
291 QString platform = userSettings->value("defaults/platform").toString();
292
293 // if fwpatcher , ask for extra file
294 QString offirmware;
295 if(devices->value(platform + "/bootloadermethod").toString() == "fwpatcher")
296 {
297 BrowseOF ofbrowser(this);
298 ofbrowser.setFile(userSettings->value("defaults/ofpath").toString());
299 if(ofbrowser.exec() == QDialog::Accepted)
300 {
301 offirmware = ofbrowser.getFile();
302 qDebug() << offirmware;
303 if(!QFileInfo(offirmware).exists())
304 {
305 logger->addItem(tr("Original Firmware Path is wrong!"),LOGERROR);
306 logger->abort();
307 return;
308 }
309 else
310 {
311 userSettings->setValue("defaults/ofpath",offirmware);
312 userSettings->sync();
313 }
314 }
315 else
316 {
317 logger->addItem(tr("Original Firmware selection Canceled!"),LOGERROR);
318 logger->abort();
319 return;
320 }
321 }
322
323 // create installer
324 blinstaller = new BootloaderInstaller(this);
325
326 blinstaller->setMountPoint(userSettings->value("defaults/mountpoint").toString());
327
286 if(userSettings->value("defaults/proxytype") == "manual") 328 if(userSettings->value("defaults/proxytype") == "manual")
287 installWindow->setProxy(QUrl(userSettings->value("defaults/proxy").toString())); 329 blinstaller->setProxy(QUrl(userSettings->value("defaults/proxy").toString()));
288#ifdef __linux 330#ifdef __linux
289 else if(userSettings->value("defaults/proxytype") == "system") 331 else if(userSettings->value("defaults/proxytype") == "system")
290 installWindow->setProxy(QUrl(getenv("http_proxy"))); 332 blinstaller->setProxy(QUrl(getenv("http_proxy")));
291#endif 333#endif
292 installWindow->setMountPoint(userSettings->value("defaults/mountpoint").toString());
293 334
294 installWindow->show(); 335 blinstaller->setDevice(platform);
336 blinstaller->setBootloaderMethod(devices->value(platform + "/bootloadermethod").toString());
337 blinstaller->setBootloaderName(devices->value(platform + "/bootloadername").toString());
338 blinstaller->setBootloaderBaseUrl(devices->value("bootloader_url").toString());
339 blinstaller->setOrigFirmwarePath(offirmware);
340
341 blinstaller->install(logger);
342
343 // connect(blinstaller, SIGNAL(done(bool)), this, SLOT(done(bool)));
295} 344}
296 345
297 346
@@ -319,7 +368,7 @@ void RbUtilQt::installFonts()
319 installer->setMountPoint(userSettings->value("defaults/mountpoint").toString()); 368 installer->setMountPoint(userSettings->value("defaults/mountpoint").toString());
320 installer->install(logger); 369 installer->install(logger);
321 370
322 connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool))); 371 // connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool)));
323} 372}
324 373
325 374
@@ -357,7 +406,7 @@ void RbUtilQt::installVoice()
357 installer->setTarget("/.rockbox/langs/english.voice"); 406 installer->setTarget("/.rockbox/langs/english.voice");
358 installer->install(logger); 407 installer->install(logger);
359 408
360 connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool))); 409 //connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool)));
361} 410}
362 411
363 412
@@ -381,11 +430,11 @@ void RbUtilQt::installDoom()
381 installer->setProxy(QUrl(getenv("http_proxy"))); 430 installer->setProxy(QUrl(getenv("http_proxy")));
382#endif 431#endif
383 432
384 installer->setLogSection("Game Addons"); 433 installer->setLogSection("GameAddons");
385 installer->setMountPoint(userSettings->value("defaults/mountpoint").toString()); 434 installer->setMountPoint(userSettings->value("defaults/mountpoint").toString());
386 installer->install(logger); 435 installer->install(logger);
387 436
388 connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool))); 437 // connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool)));
389 438
390} 439}
391 440
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 @@
28#include "httpget.h" 28#include "httpget.h"
29#include "installzip.h" 29#include "installzip.h"
30#include "progressloggergui.h" 30#include "progressloggergui.h"
31#include "installbootloader.h"
31 32
32class RbUtilQt : public QMainWindow 33class RbUtilQt : public QMainWindow
33{ 34{
@@ -49,6 +50,7 @@ class RbUtilQt : public QMainWindow
49 void updateManual(void); 50 void updateManual(void);
50 ProgressLoggerGui *logger; 51 ProgressLoggerGui *logger;
51 ZipInstaller *installer; 52 ZipInstaller *installer;
53 BootloaderInstaller* blinstaller;
52 54
53 private slots: 55 private slots:
54 void about(void); 56 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 \
21 zip/unzip.cpp \ 21 zip/unzip.cpp \
22 installzip.cpp \ 22 installzip.cpp \
23 installbootloader.cpp \ 23 installbootloader.cpp \
24 installbootloaderwindow.cpp \
25 progressloggergui.cpp \ 24 progressloggergui.cpp \
26 installtalkwindow.cpp \ 25 installtalkwindow.cpp \
27 talkfile.cpp \ 26 talkfile.cpp \
@@ -32,7 +31,8 @@ SOURCES += rbutilqt.cpp \
32 irivertools/md5sum.cpp \ 31 irivertools/md5sum.cpp \
33 browsedirtree.cpp \ 32 browsedirtree.cpp \
34 uninstall.cpp \ 33 uninstall.cpp \
35 uninstallwindow.cpp 34 uninstallwindow.cpp \
35 browseof.cpp
36 36
37HEADERS += rbutilqt.h \ 37HEADERS += rbutilqt.h \
38 settings.h \ 38 settings.h \
@@ -47,7 +47,6 @@ HEADERS += rbutilqt.h \
47 version.h \ 47 version.h \
48 installzip.h \ 48 installzip.h \
49 installbootloader.h \ 49 installbootloader.h \
50 installbootloaderwindow.h \
51 installtalkwindow.h \ 50 installtalkwindow.h \
52 talkfile.h \ 51 talkfile.h \
53 autodetection.h \ 52 autodetection.h \
@@ -66,7 +65,8 @@ HEADERS += rbutilqt.h \
66 irivertools/checksums.h \ 65 irivertools/checksums.h \
67 browsedirtree.h \ 66 browsedirtree.h \
68 uninstall.h \ 67 uninstall.h \
69 uninstallwindow.h 68 uninstallwindow.h \
69 browseof.h
70 70
71# Needed by QT on Win 71# Needed by QT on Win
72INCLUDEPATH = . irivertools zip zlib ../ipodpatcher ../sansapatcher 72INCLUDEPATH = . irivertools zip zlib ../ipodpatcher ../sansapatcher
@@ -83,10 +83,10 @@ FORMS += rbutilqtfrm.ui \
83 installfrm.ui \ 83 installfrm.ui \
84 installprogressfrm.ui \ 84 installprogressfrm.ui \
85 configurefrm.ui \ 85 configurefrm.ui \
86 installbootloaderfrm.ui \
87 browsedirtreefrm.ui \ 86 browsedirtreefrm.ui \
88 installtalkfrm.ui \ 87 installtalkfrm.ui \
89 uninstallfrm.ui 88 uninstallfrm.ui \
89 browseoffrm.ui
90 90
91RESOURCES += rbutilqt.qrc 91RESOURCES += rbutilqt.qrc
92 92