diff options
Diffstat (limited to 'rbutil/rbutilqt/base')
-rw-r--r-- | rbutil/rbutilqt/base/bootloaderinstallbase.cpp | 113 | ||||
-rw-r--r-- | rbutil/rbutilqt/base/bootloaderinstallhelper.cpp | 133 | ||||
-rw-r--r-- | rbutil/rbutilqt/base/bootloaderinstallhelper.h | 36 |
3 files changed, 172 insertions, 110 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 | ||
43 | BootloaderInstallBase* 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 | |||
81 | BootloaderInstallBase::BootloaderType BootloaderInstallBase::installed(void) | 33 | BootloaderInstallBase::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 | |||
145 | void BootloaderInstallBase::installBlfile(void) | 98 | void 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 | |||
155 | bool BootloaderInstallBase::backup(QString to) | 107 | bool 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. | ||
204 | QString 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) |
263 | void BootloaderInstallBase::waitRemount() | 154 | void BootloaderInstallBase::waitRemount() |
264 | { | 155 | { |
@@ -320,6 +211,7 @@ void BootloaderInstallBase::setBlFile(QStringList sl) | |||
320 | } | 211 | } |
321 | } | 212 | } |
322 | 213 | ||
214 | |||
323 | bool BootloaderInstallBase::setOfFile(QString of, QStringList blfile) | 215 | bool 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 | |||
35 | BootloaderInstallBase* 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. | ||
77 | QString 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 | |||
27 | class 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 | |||