From c876d3bbefe0dc00c27ca0c12d29da5874946962 Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Wed, 15 Dec 2021 21:04:28 +0100 Subject: rbutil: Merge rbutil with utils folder. rbutil uses several components from the utils folder, and can be considered part of utils too. Having it in a separate folder is an arbitrary split that doesn't help anymore these days, so merge them. This also allows other utils to easily use libtools.make without the need to navigate to a different folder. Change-Id: I3fc2f4de19e3e776553efb5dea5f779dfec0dc21 --- utils/rbutilqt/base/bootloaderinstallhelper.cpp | 140 ++++++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 utils/rbutilqt/base/bootloaderinstallhelper.cpp (limited to 'utils/rbutilqt/base/bootloaderinstallhelper.cpp') 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 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * + * Copyright (C) 2012 Dominik Riebeling + * + * 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. + * + * This file is a modified version of the AMS installer by Dominik Wenger + * + ****************************************************************************/ + +#include + +#include "bootloaderinstallhelper.h" +#include "bootloaderinstallmi4.h" +#include "bootloaderinstallhex.h" +#include "bootloaderinstallipod.h" +#include "bootloaderinstallsansa.h" +#include "bootloaderinstallfile.h" +#include "bootloaderinstallchinachip.h" +#include "bootloaderinstallams.h" +#include "bootloaderinstalltcc.h" +#include "bootloaderinstallmpio.h" +#include "bootloaderinstallimx.h" +#include "bootloaderinstalls5l.h" +#include "bootloaderinstallbspatch.h" + +BootloaderInstallBase* BootloaderInstallHelper::createBootloaderInstaller(QObject* parent, QString type) +{ + if(type == "mi4") { + return new BootloaderInstallMi4(parent); + } + else if(type == "hex") { + return new BootloaderInstallHex(parent); + } + else if(type == "sansa") { + return new BootloaderInstallSansa(parent); + } + else if(type == "ipod") { + return new BootloaderInstallIpod(parent); + } + else if(type == "file") { + return new BootloaderInstallFile(parent); + } + else if(type == "chinachip") { + return new BootloaderInstallChinaChip(parent); + } + else if(type == "ams") { + return new BootloaderInstallAms(parent); + } + else if(type == "tcc") { + return new BootloaderInstallTcc(parent); + } + else if(type == "mpio") { + return new BootloaderInstallMpio(parent); + } + else if(type == "imx") { + return new BootloaderInstallImx(parent); + } + else if(type == "s5l") { + return new BootloaderInstallS5l(parent); + } + else if(type == "bspatch") { + return new BootloaderInstallBSPatch(parent); + } + else { + return nullptr; + } +} + + +//! @brief Return post install hints string. +//! @param model model string +//! @return hints. +QString BootloaderInstallHelper::postinstallHints(QString model) +{ + bool hint = false; + QString msg = QObject::tr("Bootloader installation is almost complete. " + "Installation requires you to perform the " + "following steps manually:"); + + msg += "
    "; + if(model != "sansafuzeplus") { + msg += QObject::tr("
  1. Safely remove your player.
  2. "); + } + if(model == "iriverh100" || model == "iriverh120" || model == "iriverh300" + || model == "ondavx747" || model == "agptekrocker" + || model == "xduoox3" || model == "xduoox3ii" || model == "xduoox20") { + hint = true; + msg += QObject::tr("
  3. Reboot your player into the original firmware.
  4. " + "
  5. Perform a firmware upgrade using the update functionality " + "of the original firmware. Please refer to your player's manual " + "on details.
    Important: updating the firmware is a " + "critical process that must not be interrupted. Make sure the " + "player is charged before starting the firmware update " + "process.
  6. " + "
  7. After the firmware has been updated reboot your player.
  8. "); + } + if(model == "sansafuzeplus") { + hint = true; + msg += QObject::tr("
  9. Remove any previously inserted microSD card
  10. "); + msg += QObject::tr("
  11. Disconnect your player. The player will reboot and " + "perform an update of the original firmware. " + "Please refer to your players manual on details.
    " + "Important: updating the firmware is a " + "critical process that must not be interrupted. Make sure the " + "player is charged before disconnecting the player.
  12. " + "
  13. After the firmware has been updated reboot your player.
  14. "); + } + if(model == "iaudiox5" || model == "iaudiom5" + || model == "iaudiox5v" || model == "iaudiom3" || model == "mpioh200") { + hint = true; + msg += QObject::tr("
  15. Turn the player off
  16. " + "
  17. Insert the charger
  18. "); + } + if(model == "gigabeatf") { + hint = true; + msg += QObject::tr("
  19. Unplug USB and power adaptors
  20. " + "
  21. Hold Power to turn the player off
  22. " + "
  23. Toggle the battery switch on the player
  24. " + "
  25. Hold Power to boot into Rockbox
  26. "); + } + msg += "
"; + msg += QObject::tr("

Note: You can safely install other parts first, but " + "the above steps are required to finish the installation!

"); + + if(hint) + return msg; + else + return QString(); +} -- cgit v1.2.3