summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallbase.cpp113
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallhelper.cpp133
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallhelper.h36
-rw-r--r--rbutil/rbutilqt/rbutilqt.cpp16
-rw-r--r--rbutil/rbutilqt/rbutilqt.pri2
5 files changed, 183 insertions, 117 deletions
diff --git a/rbutil/rbutilqt/base/bootloaderinstallbase.cpp b/rbutil/rbutilqt/base/bootloaderinstallbase.cpp
index 87e414413d..72c7526241 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallbase.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstallbase.cpp
@@ -20,16 +20,6 @@
20#include <QtCore> 20#include <QtCore>
21 21
22#include "bootloaderinstallbase.h" 22#include "bootloaderinstallbase.h"
23#include "bootloaderinstallmi4.h"
24#include "bootloaderinstallhex.h"
25#include "bootloaderinstallipod.h"
26#include "bootloaderinstallsansa.h"
27#include "bootloaderinstallfile.h"
28#include "bootloaderinstallchinachip.h"
29#include "bootloaderinstallams.h"
30#include "bootloaderinstalltcc.h"
31#include "bootloaderinstallmpio.h"
32#include "bootloaderinstallimx.h"
33#include "utils.h" 23#include "utils.h"
34#include "ziputil.h" 24#include "ziputil.h"
35 25
@@ -40,44 +30,6 @@
40#endif 30#endif
41 31
42 32
43BootloaderInstallBase* BootloaderInstallBase::createBootloaderInstaller(QObject* parent,QString type)
44{
45 if(type == "mi4") {
46 return new BootloaderInstallMi4(parent);
47 }
48 else if(type == "hex") {
49 return new BootloaderInstallHex(parent);
50 }
51 else if(type == "sansa") {
52 return new BootloaderInstallSansa(parent);
53 }
54 else if(type == "ipod") {
55 return new BootloaderInstallIpod(parent);
56 }
57 else if(type == "file") {
58 return new BootloaderInstallFile(parent);
59 }
60 else if(type == "chinachip") {
61 return new BootloaderInstallChinaChip(parent);
62 }
63 else if(type == "ams") {
64 return new BootloaderInstallAms(parent);
65 }
66 else if(type == "tcc") {
67 return new BootloaderInstallTcc(parent);
68 }
69 else if(type == "mpio") {
70 return new BootloaderInstallMpio(parent);
71 }
72 else if(type == "imx") {
73 return new BootloaderInstallImx(parent);
74 }
75 else {
76 return NULL;
77 }
78
79}
80
81BootloaderInstallBase::BootloaderType BootloaderInstallBase::installed(void) 33BootloaderInstallBase::BootloaderType BootloaderInstallBase::installed(void)
82{ 34{
83 return BootloaderUnknown; 35 return BootloaderUnknown;
@@ -142,6 +94,7 @@ void BootloaderInstallBase::downloadBlFinish(bool error)
142 emit downloadDone(); 94 emit downloadDone();
143} 95}
144 96
97
145void BootloaderInstallBase::installBlfile(void) 98void BootloaderInstallBase::installBlfile(void)
146{ 99{
147 qDebug() << "[BootloaderInstallBase] installBlFile(void)"; 100 qDebug() << "[BootloaderInstallBase] installBlFile(void)";
@@ -151,7 +104,6 @@ void BootloaderInstallBase::installBlfile(void)
151//! @brief backup OF file. 104//! @brief backup OF file.
152//! @param to folder to write backup file to. Folder will get created. 105//! @param to folder to write backup file to. Folder will get created.
153//! @return true on success, false on error. 106//! @return true on success, false on error.
154
155bool BootloaderInstallBase::backup(QString to) 107bool BootloaderInstallBase::backup(QString to)
156{ 108{
157 qDebug() << "[BootloaderInstallBase] Backing up bootloader file"; 109 qDebug() << "[BootloaderInstallBase] Backing up bootloader file";
@@ -198,67 +150,6 @@ int BootloaderInstallBase::logInstall(LogMode mode)
198} 150}
199 151
200 152
201//! @brief Return post install hints string.
202//! @param model model string
203//! @return hints.
204QString BootloaderInstallBase::postinstallHints(QString model)
205{
206 bool hint = false;
207 QString msg = tr("Bootloader installation is almost complete. "
208 "Installation <b>requires</b> you to perform the "
209 "following steps manually:");
210
211 msg += "<ol>";
212 if(model != "sansafuzeplus") {
213 msg += tr("<li>Safely remove your player.</li>");
214 }
215 if(model == "iriverh100" || model == "iriverh120" || model == "iriverh300" ||
216 model == "ondavx747") {
217 hint = true;
218 msg += tr("<li>Reboot your player into the original firmware.</li>"
219 "<li>Perform a firmware upgrade using the update functionality "
220 "of the original firmware. Please refer to your player's manual "
221 "on details.<br/><b>Important:</b> updating the firmware is a "
222 "critical process that must not be interrupted. <b>Make sure the "
223 "player is charged before starting the firmware update "
224 "process.</b></li>"
225 "<li>After the firmware has been updated reboot your player.</li>");
226 }
227 if(model == "sansafuzeplus") {
228 hint = true;
229 msg += tr("<li>Remove any previously inserted microSD card</li>");
230 msg += tr("<li>Disconnect your player. The player will reboot and "
231 "perform an update of the original firmware. "
232 "Please refer to your players manual on details.<br/>"
233 "<b>Important:</b> updating the firmware is a "
234 "critical process that must not be interrupted. <b>Make sure the "
235 "player is charged before disconnecting the player.</b></li>"
236 "<li>After the firmware has been updated reboot your player.</li>");
237 }
238 if(model == "iaudiox5" || model == "iaudiom5"
239 || model == "iaudiox5v" || model == "iaudiom3" || model == "mpioh200") {
240 hint = true;
241 msg += tr("<li>Turn the player off</li>"
242 "<li>Insert the charger</li>");
243 }
244 if(model == "gigabeatf") {
245 hint = true;
246 msg += tr("<li>Unplug USB and power adaptors</li>"
247 "<li>Hold <i>Power</i> to turn the player off</li>"
248 "<li>Toggle the battery switch on the player</li>"
249 "<li>Hold <i>Power</i> to boot into Rockbox</li>");
250 }
251 msg += "</ol>";
252 msg += tr("<p><b>Note:</b> You can safely install other parts first, but "
253 "the above steps are <b>required</b> to finish the installation!</p>");
254
255 if(hint)
256 return msg;
257 else
258 return QString("");
259}
260
261
262#if defined(Q_OS_MACX) 153#if defined(Q_OS_MACX)
263void BootloaderInstallBase::waitRemount() 154void BootloaderInstallBase::waitRemount()
264{ 155{
@@ -320,6 +211,7 @@ void BootloaderInstallBase::setBlFile(QStringList sl)
320 } 211 }
321} 212}
322 213
214
323bool BootloaderInstallBase::setOfFile(QString of, QStringList blfile) 215bool BootloaderInstallBase::setOfFile(QString of, QStringList blfile)
324{ 216{
325 bool found = false; 217 bool found = false;
@@ -360,3 +252,4 @@ bool BootloaderInstallBase::setOfFile(QString of, QStringList blfile)
360 } 252 }
361 return found; 253 return found;
362} 254}
255
diff --git a/rbutil/rbutilqt/base/bootloaderinstallhelper.cpp b/rbutil/rbutilqt/base/bootloaderinstallhelper.cpp
new file mode 100644
index 0000000000..fe962d2b1d
--- /dev/null
+++ b/rbutil/rbutilqt/base/bootloaderinstallhelper.cpp
@@ -0,0 +1,133 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2012 Dominik Riebeling
10 *
11 * All files in this archive are subject to the GNU General Public License.
12 * See the file COPYING in the source tree root for full license agreement.
13 *
14 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
15 * KIND, either express or implied.
16 *
17 * This file is a modified version of the AMS installer by Dominik Wenger
18 *
19 ****************************************************************************/
20
21#include <QtCore>
22
23#include "bootloaderinstallhelper.h"
24#include "bootloaderinstallmi4.h"
25#include "bootloaderinstallhex.h"
26#include "bootloaderinstallipod.h"
27#include "bootloaderinstallsansa.h"
28#include "bootloaderinstallfile.h"
29#include "bootloaderinstallchinachip.h"
30#include "bootloaderinstallams.h"
31#include "bootloaderinstalltcc.h"
32#include "bootloaderinstallmpio.h"
33#include "bootloaderinstallimx.h"
34
35BootloaderInstallBase* BootloaderInstallHelper::createBootloaderInstaller(QObject* parent, QString type)
36{
37 if(type == "mi4") {
38 return new BootloaderInstallMi4(parent);
39 }
40 else if(type == "hex") {
41 return new BootloaderInstallHex(parent);
42 }
43 else if(type == "sansa") {
44 return new BootloaderInstallSansa(parent);
45 }
46 else if(type == "ipod") {
47 return new BootloaderInstallIpod(parent);
48 }
49 else if(type == "file") {
50 return new BootloaderInstallFile(parent);
51 }
52 else if(type == "chinachip") {
53 return new BootloaderInstallChinaChip(parent);
54 }
55 else if(type == "ams") {
56 return new BootloaderInstallAms(parent);
57 }
58 else if(type == "tcc") {
59 return new BootloaderInstallTcc(parent);
60 }
61 else if(type == "mpio") {
62 return new BootloaderInstallMpio(parent);
63 }
64 else if(type == "imx") {
65 return new BootloaderInstallImx(parent);
66 }
67 else {
68 return NULL;
69 }
70
71}
72
73
74//! @brief Return post install hints string.
75//! @param model model string
76//! @return hints.
77QString BootloaderInstallHelper::postinstallHints(QString model)
78{
79 bool hint = false;
80 QString msg = QObject::tr("Bootloader installation is almost complete. "
81 "Installation <b>requires</b> you to perform the "
82 "following steps manually:");
83
84 msg += "<ol>";
85 if(model != "sansafuzeplus") {
86 msg += QObject::tr("<li>Safely remove your player.</li>");
87 }
88 if(model == "iriverh100" || model == "iriverh120" || model == "iriverh300" ||
89 model == "ondavx747") {
90 hint = true;
91 msg += QObject::tr("<li>Reboot your player into the original firmware.</li>"
92 "<li>Perform a firmware upgrade using the update functionality "
93 "of the original firmware. Please refer to your player's manual "
94 "on details.<br/><b>Important:</b> updating the firmware is a "
95 "critical process that must not be interrupted. <b>Make sure the "
96 "player is charged before starting the firmware update "
97 "process.</b></li>"
98 "<li>After the firmware has been updated reboot your player.</li>");
99 }
100 if(model == "sansafuzeplus") {
101 hint = true;
102 msg += QObject::tr("<li>Remove any previously inserted microSD card</li>");
103 msg += QObject::tr("<li>Disconnect your player. The player will reboot and "
104 "perform an update of the original firmware. "
105 "Please refer to your players manual on details.<br/>"
106 "<b>Important:</b> updating the firmware is a "
107 "critical process that must not be interrupted. <b>Make sure the "
108 "player is charged before disconnecting the player.</b></li>"
109 "<li>After the firmware has been updated reboot your player.</li>");
110 }
111 if(model == "iaudiox5" || model == "iaudiom5"
112 || model == "iaudiox5v" || model == "iaudiom3" || model == "mpioh200") {
113 hint = true;
114 msg += QObject::tr("<li>Turn the player off</li>"
115 "<li>Insert the charger</li>");
116 }
117 if(model == "gigabeatf") {
118 hint = true;
119 msg += QObject::tr("<li>Unplug USB and power adaptors</li>"
120 "<li>Hold <i>Power</i> to turn the player off</li>"
121 "<li>Toggle the battery switch on the player</li>"
122 "<li>Hold <i>Power</i> to boot into Rockbox</li>");
123 }
124 msg += "</ol>";
125 msg += QObject::tr("<p><b>Note:</b> You can safely install other parts first, but "
126 "the above steps are <b>required</b> to finish the installation!</p>");
127
128 if(hint)
129 return msg;
130 else
131 return QString();
132}
133
diff --git a/rbutil/rbutilqt/base/bootloaderinstallhelper.h b/rbutil/rbutilqt/base/bootloaderinstallhelper.h
new file mode 100644
index 0000000000..c89444d7a7
--- /dev/null
+++ b/rbutil/rbutilqt/base/bootloaderinstallhelper.h
@@ -0,0 +1,36 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2012 Dominik Riebeling
10 *
11 * All files in this archive are subject to the GNU General Public License.
12 * See the file COPYING in the source tree root for full license agreement.
13 *
14 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
15 * KIND, either express or implied.
16 *
17 * This file is a modified version of the AMS installer by Dominik Wenger
18 *
19 ****************************************************************************/
20
21#ifndef BOOTLOADERINSTALLHELPER_H
22#define BOOTLOADERINSTALLHELPER_H
23
24#include <QtCore>
25#include "bootloaderinstallbase.h"
26
27class BootloaderInstallHelper : public QObject
28{
29 Q_OBJECT
30 public:
31 static BootloaderInstallBase* createBootloaderInstaller(QObject* parent, QString type);
32 static QString postinstallHints(QString model);
33};
34
35#endif
36
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp
index 4836cf567d..683f17c0af 100644
--- a/rbutil/rbutilqt/rbutilqt.cpp
+++ b/rbutil/rbutilqt/rbutilqt.cpp
@@ -44,7 +44,7 @@
44#include "progressloggerinterface.h" 44#include "progressloggerinterface.h"
45 45
46#include "bootloaderinstallbase.h" 46#include "bootloaderinstallbase.h"
47#include "bootloaderinstallmpio.h" 47#include "bootloaderinstallhelper.h"
48 48
49#if defined(Q_OS_LINUX) 49#if defined(Q_OS_LINUX)
50#include <stdio.h> 50#include <stdio.h>
@@ -673,8 +673,9 @@ void RbUtilQt::installBootloader()
673 m_error = false; 673 m_error = false;
674 674
675 // create installer 675 // create installer
676 BootloaderInstallBase *bl = BootloaderInstallBase::createBootloaderInstaller(this, 676 BootloaderInstallBase *bl =
677 SystemInfo::value(SystemInfo::CurBootloaderMethod).toString()); 677 BootloaderInstallHelper::createBootloaderInstaller(this,
678 SystemInfo::value(SystemInfo::CurBootloaderMethod).toString());
678 if(bl == NULL) { 679 if(bl == NULL) {
679 logger->addItem(tr("No install method known."), LOGERROR); 680 logger->addItem(tr("No install method known."), LOGERROR);
680 logger->setFinished(); 681 logger->setFinished();
@@ -806,7 +807,7 @@ void RbUtilQt::installBootloaderPost(bool error)
806 if(m_auto) 807 if(m_auto)
807 return; 808 return;
808 809
809 QString msg = BootloaderInstallBase::postinstallHints( 810 QString msg = BootloaderInstallHelper::postinstallHints(
810 RbSettings::value(RbSettings::Platform).toString()); 811 RbSettings::value(RbSettings::Platform).toString());
811 if(!msg.isEmpty()) { 812 if(!msg.isEmpty()) {
812 QMessageBox::information(this, tr("Manual steps required"), msg); 813 QMessageBox::information(this, tr("Manual steps required"), msg);
@@ -1048,10 +1049,11 @@ void RbUtilQt::uninstallBootloader(void)
1048 QString platform = RbSettings::value(RbSettings::Platform).toString(); 1049 QString platform = RbSettings::value(RbSettings::Platform).toString();
1049 1050
1050 // create installer 1051 // create installer
1051 BootloaderInstallBase *bl = BootloaderInstallBase::createBootloaderInstaller(this, 1052 BootloaderInstallBase *bl
1052 SystemInfo::value(SystemInfo::CurBootloaderMethod).toString()); 1053 = BootloaderInstallHelper::createBootloaderInstaller(this,
1054 SystemInfo::value(SystemInfo::CurBootloaderMethod).toString());
1053 1055
1054 if(bl == NULL ) { 1056 if(bl == NULL) {
1055 logger->addItem(tr("No uninstall method for this target known."), LOGERROR); 1057 logger->addItem(tr("No uninstall method for this target known."), LOGERROR);
1056 logger->setFinished(); 1058 logger->setFinished();
1057 return; 1059 return;
diff --git a/rbutil/rbutilqt/rbutilqt.pri b/rbutil/rbutilqt/rbutilqt.pri
index 86813c4abe..6a74a7c52f 100644
--- a/rbutil/rbutilqt/rbutilqt.pri
+++ b/rbutil/rbutilqt/rbutilqt.pri
@@ -56,6 +56,7 @@ SOURCES += \
56 sysinfo.cpp \ 56 sysinfo.cpp \
57 systrace.cpp \ 57 systrace.cpp \
58 base/bootloaderinstallbase.cpp \ 58 base/bootloaderinstallbase.cpp \
59 base/bootloaderinstallhelper.cpp \
59 base/bootloaderinstallmi4.cpp \ 60 base/bootloaderinstallmi4.cpp \
60 base/bootloaderinstallhex.cpp \ 61 base/bootloaderinstallhex.cpp \
61 base/bootloaderinstallipod.cpp \ 62 base/bootloaderinstallipod.cpp \
@@ -123,6 +124,7 @@ HEADERS += \
123 base/system.h \ 124 base/system.h \
124 systrace.h \ 125 systrace.h \
125 base/bootloaderinstallbase.h \ 126 base/bootloaderinstallbase.h \
127 base/bootloaderinstallhelper.h \
126 base/bootloaderinstallmi4.h \ 128 base/bootloaderinstallmi4.h \
127 base/bootloaderinstallhex.h \ 129 base/bootloaderinstallhex.h \
128 base/bootloaderinstallipod.h \ 130 base/bootloaderinstallipod.h \