summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/base/bootloaderinstallhex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt/base/bootloaderinstallhex.cpp')
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallhex.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/rbutil/rbutilqt/base/bootloaderinstallhex.cpp b/rbutil/rbutilqt/base/bootloaderinstallhex.cpp
index a52f8d0584..31659981f7 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallhex.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstallhex.cpp
@@ -44,10 +44,23 @@ BootloaderInstallHex::BootloaderInstallHex(QObject *parent)
44{ 44{
45} 45}
46 46
47QString BootloaderInstallHex::ofHint()
48{
49 return tr("Bootloader installation requires you to provide "
50 "a firmware file of the original firmware (hex file). "
51 "You need to download this file yourself due to legal "
52 "reasons. Please refer to the "
53 "<a href='http://www.rockbox.org/manual.shtml'>manual</a> and the "
54 "<a href='http://www.rockbox.org/wiki/IriverBoot"
55 "#Download_and_extract_a_recent_ve'>IriverBoot</a> wiki page on "
56 "how to obtain this file.<br/>"
57 "Press Ok to continue and browse your computer for the firmware "
58 "file.");
59}
47 60
48bool BootloaderInstallHex::install(void) 61bool BootloaderInstallHex::install(void)
49{ 62{
50 if(m_hex.isEmpty()) 63 if(m_offile.isEmpty())
51 return false; 64 return false;
52 m_hashindex = -1; 65 m_hashindex = -1;
53 66
@@ -55,7 +68,7 @@ bool BootloaderInstallHex::install(void)
55 emit logItem(tr("checking MD5 hash of input file ..."), LOGINFO); 68 emit logItem(tr("checking MD5 hash of input file ..."), LOGINFO);
56 QByteArray filedata; 69 QByteArray filedata;
57 // read hex file into QByteArray 70 // read hex file into QByteArray
58 QFile file(m_hex); 71 QFile file(m_offile);
59 file.open(QIODevice::ReadOnly); 72 file.open(QIODevice::ReadOnly);
60 filedata = file.readAll(); 73 filedata = file.readAll();
61 file.close(); 74 file.close();
@@ -97,7 +110,7 @@ bool BootloaderInstallHex::install(void)
97 emit logItem(tr("Descrambling file"), LOGINFO); 110 emit logItem(tr("Descrambling file"), LOGINFO);
98 m_descrambled.open(); 111 m_descrambled.open();
99 int result; 112 int result;
100 result = iriver_decode(m_hex.toAscii().data(), 113 result = iriver_decode(m_offile.toAscii().data(),
101 m_descrambled.fileName().toAscii().data(), FALSE, STRIP_NONE); 114 m_descrambled.fileName().toAscii().data(), FALSE, STRIP_NONE);
102 qDebug() << "iriver_decode" << result; 115 qDebug() << "iriver_decode" << result;
103 116
@@ -223,7 +236,7 @@ BootloaderInstallBase::BootloaderType BootloaderInstallHex::installed(void)
223 236
224BootloaderInstallBase::Capabilities BootloaderInstallHex::capabilities(void) 237BootloaderInstallBase::Capabilities BootloaderInstallHex::capabilities(void)
225{ 238{
226 return (Install | NeedsFlashing); 239 return (Install | NeedsOf);
227} 240}
228 241
229QString BootloaderInstallHex::scrambleError(int err) 242QString BootloaderInstallHex::scrambleError(int err)