rbutil: enforce parents for bootloader install classes. and rework OF handling a bit.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20892 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dominik Wenger 2009-05-09 18:17:05 +00:00
parent 09085a30f6
commit 9ca29354e1
7 changed files with 57 additions and 46 deletions

View file

@ -44,10 +44,23 @@ BootloaderInstallHex::BootloaderInstallHex(QObject *parent)
{
}
QString BootloaderInstallHex::ofHint()
{
return tr("Bootloader installation requires you to provide "
"a firmware file of the original firmware (hex file). "
"You need to download this file yourself due to legal "
"reasons. Please refer to the "
"<a href='http://www.rockbox.org/manual.shtml'>manual</a> and the "
"<a href='http://www.rockbox.org/wiki/IriverBoot"
"#Download_and_extract_a_recent_ve'>IriverBoot</a> wiki page on "
"how to obtain this file.<br/>"
"Press Ok to continue and browse your computer for the firmware "
"file.");
}
bool BootloaderInstallHex::install(void)
{
if(m_hex.isEmpty())
if(m_offile.isEmpty())
return false;
m_hashindex = -1;
@ -55,7 +68,7 @@ bool BootloaderInstallHex::install(void)
emit logItem(tr("checking MD5 hash of input file ..."), LOGINFO);
QByteArray filedata;
// read hex file into QByteArray
QFile file(m_hex);
QFile file(m_offile);
file.open(QIODevice::ReadOnly);
filedata = file.readAll();
file.close();
@ -97,7 +110,7 @@ bool BootloaderInstallHex::install(void)
emit logItem(tr("Descrambling file"), LOGINFO);
m_descrambled.open();
int result;
result = iriver_decode(m_hex.toAscii().data(),
result = iriver_decode(m_offile.toAscii().data(),
m_descrambled.fileName().toAscii().data(), FALSE, STRIP_NONE);
qDebug() << "iriver_decode" << result;
@ -223,7 +236,7 @@ BootloaderInstallBase::BootloaderType BootloaderInstallHex::installed(void)
BootloaderInstallBase::Capabilities BootloaderInstallHex::capabilities(void)
{
return (Install | NeedsFlashing);
return (Install | NeedsOf);
}
QString BootloaderInstallHex::scrambleError(int err)