diff options
Diffstat (limited to 'utils/rbutilqt/base/bootloaderinstallhelper.cpp')
-rw-r--r-- | utils/rbutilqt/base/bootloaderinstallhelper.cpp | 140 |
1 files changed, 140 insertions, 0 deletions
diff --git a/utils/rbutilqt/base/bootloaderinstallhelper.cpp b/utils/rbutilqt/base/bootloaderinstallhelper.cpp new file mode 100644 index 0000000000..c94ed29140 --- /dev/null +++ b/utils/rbutilqt/base/bootloaderinstallhelper.cpp | |||
@@ -0,0 +1,140 @@ | |||
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 | #include "bootloaderinstalls5l.h" | ||
35 | #include "bootloaderinstallbspatch.h" | ||
36 | |||
37 | BootloaderInstallBase* BootloaderInstallHelper::createBootloaderInstaller(QObject* parent, QString type) | ||
38 | { | ||
39 | if(type == "mi4") { | ||
40 | return new BootloaderInstallMi4(parent); | ||
41 | } | ||
42 | else if(type == "hex") { | ||
43 | return new BootloaderInstallHex(parent); | ||
44 | } | ||
45 | else if(type == "sansa") { | ||
46 | return new BootloaderInstallSansa(parent); | ||
47 | } | ||
48 | else if(type == "ipod") { | ||
49 | return new BootloaderInstallIpod(parent); | ||
50 | } | ||
51 | else if(type == "file") { | ||
52 | return new BootloaderInstallFile(parent); | ||
53 | } | ||
54 | else if(type == "chinachip") { | ||
55 | return new BootloaderInstallChinaChip(parent); | ||
56 | } | ||
57 | else if(type == "ams") { | ||
58 | return new BootloaderInstallAms(parent); | ||
59 | } | ||
60 | else if(type == "tcc") { | ||
61 | return new BootloaderInstallTcc(parent); | ||
62 | } | ||
63 | else if(type == "mpio") { | ||
64 | return new BootloaderInstallMpio(parent); | ||
65 | } | ||
66 | else if(type == "imx") { | ||
67 | return new BootloaderInstallImx(parent); | ||
68 | } | ||
69 | else if(type == "s5l") { | ||
70 | return new BootloaderInstallS5l(parent); | ||
71 | } | ||
72 | else if(type == "bspatch") { | ||
73 | return new BootloaderInstallBSPatch(parent); | ||
74 | } | ||
75 | else { | ||
76 | return nullptr; | ||
77 | } | ||
78 | } | ||
79 | |||
80 | |||
81 | //! @brief Return post install hints string. | ||
82 | //! @param model model string | ||
83 | //! @return hints. | ||
84 | QString BootloaderInstallHelper::postinstallHints(QString model) | ||
85 | { | ||
86 | bool hint = false; | ||
87 | QString msg = QObject::tr("Bootloader installation is almost complete. " | ||
88 | "Installation <b>requires</b> you to perform the " | ||
89 | "following steps manually:"); | ||
90 | |||
91 | msg += "<ol>"; | ||
92 | if(model != "sansafuzeplus") { | ||
93 | msg += QObject::tr("<li>Safely remove your player.</li>"); | ||
94 | } | ||
95 | if(model == "iriverh100" || model == "iriverh120" || model == "iriverh300" | ||
96 | || model == "ondavx747" || model == "agptekrocker" | ||
97 | || model == "xduoox3" || model == "xduoox3ii" || model == "xduoox20") { | ||
98 | hint = true; | ||
99 | msg += QObject::tr("<li>Reboot your player into the original firmware.</li>" | ||
100 | "<li>Perform a firmware upgrade using the update functionality " | ||
101 | "of the original firmware. Please refer to your player's manual " | ||
102 | "on details.<br/><b>Important:</b> updating the firmware is a " | ||
103 | "critical process that must not be interrupted. <b>Make sure the " | ||
104 | "player is charged before starting the firmware update " | ||
105 | "process.</b></li>" | ||
106 | "<li>After the firmware has been updated reboot your player.</li>"); | ||
107 | } | ||
108 | if(model == "sansafuzeplus") { | ||
109 | hint = true; | ||
110 | msg += QObject::tr("<li>Remove any previously inserted microSD card</li>"); | ||
111 | msg += QObject::tr("<li>Disconnect your player. The player will reboot and " | ||
112 | "perform an update of the original firmware. " | ||
113 | "Please refer to your players manual on details.<br/>" | ||
114 | "<b>Important:</b> updating the firmware is a " | ||
115 | "critical process that must not be interrupted. <b>Make sure the " | ||
116 | "player is charged before disconnecting the player.</b></li>" | ||
117 | "<li>After the firmware has been updated reboot your player.</li>"); | ||
118 | } | ||
119 | if(model == "iaudiox5" || model == "iaudiom5" | ||
120 | || model == "iaudiox5v" || model == "iaudiom3" || model == "mpioh200") { | ||
121 | hint = true; | ||
122 | msg += QObject::tr("<li>Turn the player off</li>" | ||
123 | "<li>Insert the charger</li>"); | ||
124 | } | ||
125 | if(model == "gigabeatf") { | ||
126 | hint = true; | ||
127 | msg += QObject::tr("<li>Unplug USB and power adaptors</li>" | ||
128 | "<li>Hold <i>Power</i> to turn the player off</li>" | ||
129 | "<li>Toggle the battery switch on the player</li>" | ||
130 | "<li>Hold <i>Power</i> to boot into Rockbox</li>"); | ||
131 | } | ||
132 | msg += "</ol>"; | ||
133 | msg += QObject::tr("<p><b>Note:</b> You can safely install other parts first, but " | ||
134 | "the above steps are <b>required</b> to finish the installation!</p>"); | ||
135 | |||
136 | if(hint) | ||
137 | return msg; | ||
138 | else | ||
139 | return QString(); | ||
140 | } | ||