Cosmetics: remove trailing spaces.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14723 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Antoine Cellerier 2007-09-15 22:57:07 +00:00
parent 76ea412d5f
commit 1464c9b5d0
21 changed files with 366 additions and 366 deletions

View file

@ -155,22 +155,22 @@ QStringList Autodetection::getMountpoints()
tempList << list.at(i).absolutePath(); tempList << list.at(i).absolutePath();
} }
return tempList; return tempList;
#elif defined(Q_OS_MACX) #elif defined(Q_OS_MACX)
QDir dir("/Volumes"); QDir dir("/Volumes");
return dir.entryList(); return dir.entryList();
#elif defined(Q_OS_LINUX) #elif defined(Q_OS_LINUX)
QStringList tempList; QStringList tempList;
FILE *mn = setmntent("/etc/mtab", "r"); FILE *mn = setmntent("/etc/mtab", "r");
if(!mn) if(!mn)
return QStringList(""); return QStringList("");
struct mntent *ent; struct mntent *ent;
while((ent = getmntent(mn))) while((ent = getmntent(mn)))
tempList << QString(ent->mnt_dir); tempList << QString(ent->mnt_dir);
endmntent(mn); endmntent(mn);
return tempList; return tempList;
#else #else
#error Unknown Plattform #error Unknown Plattform
@ -185,7 +185,7 @@ QString Autodetection::resolveMountPoint(QString device)
FILE *mn = setmntent("/etc/mtab", "r"); FILE *mn = setmntent("/etc/mtab", "r");
if(!mn) if(!mn)
return QString(""); return QString("");
struct mntent *ent; struct mntent *ent;
while((ent = getmntent(mn))) { while((ent = getmntent(mn))) {
if(QString(ent->mnt_fsname).startsWith(device) if(QString(ent->mnt_fsname).startsWith(device)
@ -221,7 +221,7 @@ bool Autodetection::detectUsb()
// the ini file needs to hold the IDs as hex values. // the ini file needs to hold the IDs as hex values.
QMap<int, QString> usbids; QMap<int, QString> usbids;
QMap<int, QString> usberror; QMap<int, QString> usberror;
for(int i = 0; i < platforms.size(); i++) { for(int i = 0; i < platforms.size(); i++) {
dev.beginGroup("platforms"); dev.beginGroup("platforms");
QString target = dev.value(platforms.at(i)).toString(); QString target = dev.value(platforms.at(i)).toString();

View file

@ -35,9 +35,9 @@ class Autodetection :public QObject
public: public:
Autodetection(QObject* parent=0); Autodetection(QObject* parent=0);
bool detect(); bool detect();
QString getDevice() {return m_device;} QString getDevice() {return m_device;}
QString getMountPoint() {return m_mountpoint;} QString getMountPoint() {return m_mountpoint;}
QString errdev(void) { return m_errdev; } QString errdev(void) { return m_errdev; }
@ -46,7 +46,7 @@ private:
QStringList getMountpoints(void); QStringList getMountpoints(void);
QString resolveMountPoint(QString); QString resolveMountPoint(QString);
bool detectUsb(void); bool detectUsb(void);
QString m_device; QString m_device;
QString m_mountpoint; QString m_mountpoint;
QString m_errdev; QString m_errdev;

View file

@ -27,25 +27,25 @@ BrowseOF::BrowseOF(QWidget *parent) : QDialog(parent)
{ {
ui.setupUi(this); ui.setupUi(this);
this->setModal(true); this->setModal(true);
connect(ui.browseOFButton,SIGNAL(clicked()),this,SLOT(onBrowse())); connect(ui.browseOFButton,SIGNAL(clicked()),this,SLOT(onBrowse()));
} }
void BrowseOF::setFile(QString file) void BrowseOF::setFile(QString file)
{ {
ui.OFlineEdit->setText(file); ui.OFlineEdit->setText(file);
} }
void BrowseOF::onBrowse() void BrowseOF::onBrowse()
{ {
BrowseDirtree browser(this); BrowseDirtree browser(this);
browser.setFilter(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot); browser.setFilter(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot);
if(QFileInfo(ui.OFlineEdit->text()).exists()) if(QFileInfo(ui.OFlineEdit->text()).exists())
{ {
browser.setDir(ui.OFlineEdit->text()); browser.setDir(ui.OFlineEdit->text());
} }
if(browser.exec() == QDialog::Accepted) if(browser.exec() == QDialog::Accepted)
{ {
qDebug() << browser.getSelected(); qDebug() << browser.getSelected();

View file

@ -31,11 +31,11 @@ class BrowseOF : public QDialog
BrowseOF(QWidget *parent = 0); BrowseOF(QWidget *parent = 0);
void setFile(QString file); void setFile(QString file);
QString getFile(); QString getFile();
private slots: private slots:
void onBrowse(); void onBrowse();
private: private:
Ui::BrowseOFFrm ui; Ui::BrowseOFFrm ui;

View file

@ -57,7 +57,7 @@ Config::Config(QWidget *parent) : QDialog(parent)
ui.listLanguages->setAlternatingRowColors(true); ui.listLanguages->setAlternatingRowColors(true);
this->setModal(true); this->setModal(true);
connect(ui.buttonOk, SIGNAL(clicked()), this, SLOT(accept())); connect(ui.buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
connect(ui.buttonCancel, SIGNAL(clicked()), this, SLOT(abort())); connect(ui.buttonCancel, SIGNAL(clicked()), this, SLOT(abort()));
connect(ui.radioNoProxy, SIGNAL(toggled(bool)), this, SLOT(setNoProxy(bool))); connect(ui.radioNoProxy, SIGNAL(toggled(bool)), this, SLOT(setNoProxy(bool)));
@ -212,7 +212,7 @@ void Config::setDevices(QSettings *dev)
devices->beginGroup("platforms"); devices->beginGroup("platforms");
QStringList a = devices->childKeys(); QStringList a = devices->childKeys();
devices->endGroup(); devices->endGroup();
QMap <QString, QString> manuf; QMap <QString, QString> manuf;
QMap <QString, QString> devcs; QMap <QString, QString> devcs;
for(int it = 0; it < a.size(); it++) { for(int it = 0; it < a.size(); it++) {
@ -249,7 +249,7 @@ void Config::setDevices(QSettings *dev)
w->setFlags(Qt::ItemIsEnabled); w->setFlags(Qt::ItemIsEnabled);
w->setText(0, brands.at(c)); w->setText(0, brands.at(c));
items.append(w); items.append(w);
// go through platforms again for sake of order // go through platforms again for sake of order
for(int it = 0; it < a.size(); it++) { for(int it = 0; it < a.size(); it++) {
QString curdev; QString curdev;
@ -284,7 +284,7 @@ void Config::setDevices(QSettings *dev)
// tts / encoder tab // tts / encoder tab
QStringList keys; QStringList keys;
devices->beginGroup("encoders"); devices->beginGroup("encoders");
keys = devices->allKeys(); keys = devices->allKeys();
for(int i=0; i < keys.size();i++) for(int i=0; i < keys.size();i++)
@ -542,7 +542,7 @@ void Config::autodetect()
for(int a = 0; a < ui.treeDevices->topLevelItemCount(); a++) for(int a = 0; a < ui.treeDevices->topLevelItemCount(); a++)
ui.treeDevices->topLevelItem(a)->setExpanded(false); ui.treeDevices->topLevelItem(a)->setExpanded(false);
//deselect the selected item(s) //deselect the selected item(s)
for(int a = 0; a < ui.treeDevices->selectedItems().size(); a++) for(int a = 0; a < ui.treeDevices->selectedItems().size(); a++)
ui.treeDevices->selectedItems().at(a)->setSelected(false); ui.treeDevices->selectedItems().at(a)->setSelected(false);
// find the new item // find the new item
@ -554,7 +554,7 @@ void Config::autodetect()
for(int j=0;j < itmList.at(i)->childCount();j++) for(int j=0;j < itmList.at(i)->childCount();j++)
{ {
QString data = itmList.at(i)->child(j)->data(0, Qt::UserRole).toString(); QString data = itmList.at(i)->child(j)->data(0, Qt::UserRole).toString();
if(devicename == data) // item found if(devicename == data) // item found
{ {
itmList.at(i)->child(j)->setSelected(true); //select the item itmList.at(i)->child(j)->setSelected(true); //select the item
@ -578,7 +578,7 @@ void Config::autodetect()
QMessageBox::critical(this, tr("Fatal error"), text, QMessageBox::Ok); QMessageBox::critical(this, tr("Fatal error"), text, QMessageBox::Ok);
return; return;
} }
if(detector.getMountPoint() != "" ) if(detector.getMountPoint() != "" )
{ {
ui.mountPoint->setText(detector.getMountPoint()); ui.mountPoint->setText(detector.getMountPoint());
@ -597,7 +597,7 @@ void Config::autodetect()
tr("Could not detect a device.\n" tr("Could not detect a device.\n"
"Select your device and Mountpoint manually."), "Select your device and Mountpoint manually."),
QMessageBox::Ok ,QMessageBox::Ok); QMessageBox::Ok ,QMessageBox::Ok);
} }
} }
@ -609,7 +609,7 @@ void Config::cacheClear()
"remove <b>all</b> files in this folder!").arg(ui.cachePath->text()), "remove <b>all</b> files in this folder!").arg(ui.cachePath->text()),
QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes)
return; return;
QString cache = ui.cachePath->text() + "/rbutil-cache/"; QString cache = ui.cachePath->text() + "/rbutil-cache/";
if(!QFileInfo(cache).isDir()) { if(!QFileInfo(cache).isDir()) {
QMessageBox::critical(this, tr("Path wrong!"), QMessageBox::critical(this, tr("Path wrong!"),
@ -633,7 +633,7 @@ void Config::browseTts()
{ {
BrowseDirtree browser(this); BrowseDirtree browser(this);
browser.setFilter(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot); browser.setFilter(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot);
if(QFileInfo(ui.ttsExecutable->text()).isDir()) if(QFileInfo(ui.ttsExecutable->text()).isDir())
{ {
browser.setDir(ui.ttsExecutable->text()); browser.setDir(ui.ttsExecutable->text());
@ -646,7 +646,7 @@ void Config::browseTts()
return; return;
ui.ttsExecutable->setText(exe); ui.ttsExecutable->setText(exe);
} }
} }
@ -654,7 +654,7 @@ void Config::browseEnc()
{ {
BrowseDirtree browser(this); BrowseDirtree browser(this);
browser.setFilter(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot); browser.setFilter(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot);
if(QFileInfo(ui.encoderExecutable->text()).isDir()) if(QFileInfo(ui.encoderExecutable->text()).isDir())
{ {
browser.setDir(ui.encoderExecutable->text()); browser.setDir(ui.encoderExecutable->text());
@ -667,5 +667,5 @@ void Config::browseEnc()
return; return;
ui.encoderExecutable->setText(exe); ui.encoderExecutable->setText(exe);
} }
} }

View file

@ -49,10 +49,10 @@ class Config : public QDialog
QString language; QString language;
QString programPath; QString programPath;
QUrl proxy; QUrl proxy;
BrowseDirtree *browser; BrowseDirtree *browser;
BrowseDirtree *cbrowser; BrowseDirtree *cbrowser;
private slots: private slots:
void setNoProxy(bool); void setNoProxy(bool);
void setSystemProxy(bool); void setSystemProxy(bool);

View file

@ -106,9 +106,9 @@ void Install::accept()
installer->setLogVersion(myversion); installer->setLogVersion(myversion);
installer->setMountPoint(mountPoint); installer->setMountPoint(mountPoint);
installer->install(logger); installer->install(logger);
connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool))); connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool)));
} }
// Zip installer has finished // Zip installer has finished
@ -193,12 +193,12 @@ void Install::setVersionStrings(QMap<QString, QString> ver)
// rel_rev release version revision id // rel_rev release version revision id
// rel_date release version release date // rel_date release version release date
// same for arch_* and bleed_* // same for arch_* and bleed_*
if(version.value("arch_rev").isEmpty()) { if(version.value("arch_rev").isEmpty()) {
ui.radioArchived->setEnabled(false); ui.radioArchived->setEnabled(false);
qDebug() << "no information about archived version available!"; qDebug() << "no information about archived version available!";
} }
if(!version.value("rel_rev").isEmpty()) { if(!version.value("rel_rev").isEmpty()) {
ui.radioStable->setChecked(true); ui.radioStable->setChecked(true);
ui.radioStable->setEnabled(true); ui.radioStable->setEnabled(true);

View file

@ -16,13 +16,13 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
****************************************************************************/ ****************************************************************************/
#include "installbootloader.h" #include "installbootloader.h"
#include "irivertools/checksums.h" #include "irivertools/checksums.h"
BootloaderInstaller::BootloaderInstaller(QObject* parent): QObject(parent) BootloaderInstaller::BootloaderInstaller(QObject* parent): QObject(parent)
{ {
} }
void BootloaderInstaller::install(ProgressloggerInterface* dp) void BootloaderInstaller::install(ProgressloggerInterface* dp)
@ -31,50 +31,50 @@ void BootloaderInstaller::install(ProgressloggerInterface* dp)
m_install = true; m_install = true;
m_dp->addItem(tr("Starting bootloader installation"),LOGINFO); m_dp->addItem(tr("Starting bootloader installation"),LOGINFO);
connect(this, SIGNAL(done(bool)), this, SLOT(installEnded(bool))); connect(this, SIGNAL(done(bool)), this, SLOT(installEnded(bool)));
if(m_bootloadermethod == "gigabeatf") if(m_bootloadermethod == "gigabeatf")
{ {
// connect internal signal // connect internal signal
connect(this,SIGNAL(prepare()),this,SLOT(gigabeatPrepare())); connect(this,SIGNAL(prepare()),this,SLOT(gigabeatPrepare()));
connect(this,SIGNAL(finish()),this,SLOT(gigabeatFinish())); connect(this,SIGNAL(finish()),this,SLOT(gigabeatFinish()));
} }
else if(m_bootloadermethod == "iaudio") else if(m_bootloadermethod == "iaudio")
{ {
// connect internal signal // connect internal signal
connect(this,SIGNAL(prepare()),this,SLOT(iaudioPrepare())); connect(this,SIGNAL(prepare()),this,SLOT(iaudioPrepare()));
connect(this,SIGNAL(finish()),this,SLOT(iaudioFinish())); connect(this,SIGNAL(finish()),this,SLOT(iaudioFinish()));
} }
else if(m_bootloadermethod == "h10") else if(m_bootloadermethod == "h10")
{ {
// connect internal signal // connect internal signal
connect(this,SIGNAL(prepare()),this,SLOT(h10Prepare())); connect(this,SIGNAL(prepare()),this,SLOT(h10Prepare()));
connect(this,SIGNAL(finish()),this,SLOT(h10Finish())); connect(this,SIGNAL(finish()),this,SLOT(h10Finish()));
} }
else if(m_bootloadermethod == "ipodpatcher") else if(m_bootloadermethod == "ipodpatcher")
{ {
// connect internal signal // connect internal signal
connect(this,SIGNAL(prepare()),this,SLOT(ipodPrepare())); connect(this,SIGNAL(prepare()),this,SLOT(ipodPrepare()));
connect(this,SIGNAL(finish()),this,SLOT(ipodFinish())); connect(this,SIGNAL(finish()),this,SLOT(ipodFinish()));
} }
else if(m_bootloadermethod == "sansapatcher") else if(m_bootloadermethod == "sansapatcher")
{ {
// connect internal signal // connect internal signal
connect(this,SIGNAL(prepare()),this,SLOT(sansaPrepare())); connect(this,SIGNAL(prepare()),this,SLOT(sansaPrepare()));
connect(this,SIGNAL(finish()),this,SLOT(sansaFinish())); connect(this,SIGNAL(finish()),this,SLOT(sansaFinish()));
} }
else if(m_bootloadermethod == "fwpatcher") else if(m_bootloadermethod == "fwpatcher")
{ {
// connect internal signal // connect internal signal
connect(this,SIGNAL(prepare()),this,SLOT(iriverPrepare())); connect(this,SIGNAL(prepare()),this,SLOT(iriverPrepare()));
connect(this,SIGNAL(finish()),this,SLOT(iriverFinish())); connect(this,SIGNAL(finish()),this,SLOT(iriverFinish()));
} }
else else
{ {
m_dp->addItem(tr("unsupported install Method"),LOGERROR); m_dp->addItem(tr("unsupported install Method"),LOGERROR);
emit done(true); emit done(true);
return; return;
} }
emit prepare(); emit prepare();
} }
@ -84,38 +84,38 @@ void BootloaderInstaller::uninstall(ProgressloggerInterface* dp)
m_install = false; m_install = false;
m_dp->addItem(tr("Starting bootloader uninstallation"),LOGINFO); m_dp->addItem(tr("Starting bootloader uninstallation"),LOGINFO);
connect(this, SIGNAL(done(bool)), this, SLOT(installEnded(bool))); connect(this, SIGNAL(done(bool)), this, SLOT(installEnded(bool)));
if(m_bootloadermethod == "gigabeatf") if(m_bootloadermethod == "gigabeatf")
{ {
// connect internal signal // connect internal signal
connect(this,SIGNAL(prepare()),this,SLOT(gigabeatPrepare())); connect(this,SIGNAL(prepare()),this,SLOT(gigabeatPrepare()));
} }
else if(m_bootloadermethod == "iaudio") else if(m_bootloadermethod == "iaudio")
{ {
m_dp->addItem(tr("No uninstallation possible"),LOGWARNING); m_dp->addItem(tr("No uninstallation possible"),LOGWARNING);
emit done(true); emit done(true);
return; return;
} }
else if(m_bootloadermethod == "iaudio") else if(m_bootloadermethod == "iaudio")
{ {
// connect internal signal // connect internal signal
connect(this,SIGNAL(prepare()),this,SLOT(h10Prepare())); connect(this,SIGNAL(prepare()),this,SLOT(h10Prepare()));
} }
else if(m_bootloadermethod == "ipodpatcher") else if(m_bootloadermethod == "ipodpatcher")
{ {
// connect internal signal // connect internal signal
connect(this,SIGNAL(prepare()),this,SLOT(ipodPrepare())); connect(this,SIGNAL(prepare()),this,SLOT(ipodPrepare()));
} }
else if(m_bootloadermethod == "sansapatcher") else if(m_bootloadermethod == "sansapatcher")
{ {
// connect internal signal // connect internal signal
connect(this,SIGNAL(prepare()),this,SLOT(sansaPrepare())); connect(this,SIGNAL(prepare()),this,SLOT(sansaPrepare()));
} }
else if(m_bootloadermethod == "fwpatcher") else if(m_bootloadermethod == "fwpatcher")
{ {
m_dp->addItem(tr("No uninstallation possible"),LOGWARNING); m_dp->addItem(tr("No uninstallation possible"),LOGWARNING);
emit done(true); emit done(true);
return; return;
} }
else else
{ {
@ -123,7 +123,7 @@ void BootloaderInstaller::uninstall(ProgressloggerInterface* dp)
emit done(true); emit done(true);
return; return;
} }
emit prepare(); emit prepare();
} }
@ -138,9 +138,9 @@ void BootloaderInstaller::downloadRequestFinished(int id, bool error)
void BootloaderInstaller::downloadDone(bool error) void BootloaderInstaller::downloadDone(bool error)
{ {
qDebug() << "Install::downloadDone, error:" << error; qDebug() << "Install::downloadDone, error:" << error;
// update progress bar // update progress bar
int max = m_dp->getProgressMax(); int max = m_dp->getProgressMax();
if(max == 0) { if(max == 0) {
max = 100; max = 100;
@ -160,9 +160,9 @@ void BootloaderInstaller::downloadDone(bool error)
return; return;
} }
else m_dp->addItem(tr("Download finished."),LOGOK); else m_dp->addItem(tr("Download finished."),LOGOK);
emit finish(); emit finish();
} }
void BootloaderInstaller::updateDataReadProgress(int read, int total) void BootloaderInstaller::updateDataReadProgress(int read, int total)
@ -183,7 +183,7 @@ bool BootloaderInstaller::downloadInfo()
{ {
// try to get the current build information // try to get the current build information
infodownloader = new HttpGet(this); infodownloader = new HttpGet(this);
connect(infodownloader, SIGNAL(done(bool)), this, SLOT(infoDownloadDone(bool))); connect(infodownloader, SIGNAL(done(bool)), this, SLOT(infoDownloadDone(bool)));
connect(infodownloader, SIGNAL(requestFinished(int, bool)), this, SLOT(infoRequestFinished(int, bool))); connect(infodownloader, SIGNAL(requestFinished(int, bool)), this, SLOT(infoRequestFinished(int, bool)));
@ -192,7 +192,7 @@ bool BootloaderInstaller::downloadInfo()
qDebug() << "downloading bootloader info"; qDebug() << "downloading bootloader info";
infodownloader->setFile(&bootloaderInfo); infodownloader->setFile(&bootloaderInfo);
infodownloader->getFile(QUrl(m_bootloaderinfoUrl)); infodownloader->getFile(QUrl(m_bootloaderinfoUrl));
// block until its downloaded // block until its downloaded
qDebug() << "Waiting for Download finished"; qDebug() << "Waiting for Download finished";
infoDownloaded=false; infoDownloaded=false;
@ -204,27 +204,27 @@ bool BootloaderInstaller::downloadInfo()
void BootloaderInstaller::infoDownloadDone(bool error) void BootloaderInstaller::infoDownloadDone(bool error)
{ {
if(error) if(error)
{ {
qDebug() << "network error:" << infodownloader->error(); qDebug() << "network error:" << infodownloader->error();
return; return;
} }
qDebug() << "network status:" << infodownloader->error(); qDebug() << "network status:" << infodownloader->error();
infoDownloaded = true; infoDownloaded = true;
} }
void BootloaderInstaller::infoRequestFinished(int id, bool error) void BootloaderInstaller::infoRequestFinished(int id, bool error)
{ {
if(error) if(error)
{ {
QString errorString; QString errorString;
errorString = tr("Network error: %1. Please check your network and proxy settings.") errorString = tr("Network error: %1. Please check your network and proxy settings.")
.arg(infodownloader->errorString()); .arg(infodownloader->errorString());
if(error) QMessageBox::about(NULL, "Network Error", errorString); if(error) QMessageBox::about(NULL, "Network Error", errorString);
qDebug() << "downloadDone:" << id << error; qDebug() << "downloadDone:" << id << error;
infoError = true; infoError = true;
infoDownloaded = true; infoDownloaded = true;
} }
@ -241,7 +241,7 @@ void BootloaderInstaller::createInstallLog()
QSettings info(bootloaderInfo.fileName(), QSettings::IniFormat, this); QSettings info(bootloaderInfo.fileName(), QSettings::IniFormat, this);
bootloaderInfo.close(); bootloaderInfo.close();
info.beginGroup(m_device); info.beginGroup(m_device);
installlog.beginGroup("Bootloader"); installlog.beginGroup("Bootloader");
installlog.setValue("md5sum",info.value("md5sum").toString()); installlog.setValue("md5sum",info.value("md5sum").toString());
installlog.endGroup(); installlog.endGroup();
@ -263,19 +263,19 @@ bool BootloaderInstaller::uptodate()
{ {
QString installedMd5; QString installedMd5;
QString serverMd5; QString serverMd5;
QSettings installlog(m_mountpoint + "/.rockbox/rbutil.log", QSettings::IniFormat, 0); QSettings installlog(m_mountpoint + "/.rockbox/rbutil.log", QSettings::IniFormat, 0);
installlog.beginGroup("Bootloader"); installlog.beginGroup("Bootloader");
installedMd5 = installlog.value("md5sum").toString(); installedMd5 = installlog.value("md5sum").toString();
installlog.endGroup(); installlog.endGroup();
bootloaderInfo.open(); bootloaderInfo.open();
QSettings info(bootloaderInfo.fileName(), QSettings::IniFormat, this); QSettings info(bootloaderInfo.fileName(), QSettings::IniFormat, this);
bootloaderInfo.close(); bootloaderInfo.close();
info.beginGroup(m_device); info.beginGroup(m_device);
serverMd5 = info.value("md5sum").toString(); serverMd5 = info.value("md5sum").toString();
info.endGroup(); info.endGroup();
if(installedMd5 != serverMd5) if(installedMd5 != serverMd5)
return false; return false;
else else
@ -283,7 +283,7 @@ bool BootloaderInstaller::uptodate()
} }
/************************************************** /**************************************************
*** gigabeat secific code *** gigabeat secific code
***************************************************/ ***************************************************/
void BootloaderInstaller::gigabeatPrepare() void BootloaderInstaller::gigabeatPrepare()
@ -291,7 +291,7 @@ void BootloaderInstaller::gigabeatPrepare()
if(m_install) // Installation if(m_install) // Installation
{ {
QString url = m_bootloaderUrlBase + "/gigabeat/" + m_bootloadername; QString url = m_bootloaderUrlBase + "/gigabeat/" + m_bootloadername;
m_dp->addItem(tr("Downloading file %1.%2") m_dp->addItem(tr("Downloading file %1.%2")
.arg(QFileInfo(url).baseName(), QFileInfo(url).completeSuffix()),LOGINFO); .arg(QFileInfo(url).baseName(), QFileInfo(url).completeSuffix()),LOGINFO);
@ -307,75 +307,75 @@ void BootloaderInstaller::gigabeatPrepare()
// connect signals from HttpGet // connect signals from HttpGet
connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool))); connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool)));
connect(getter, SIGNAL(dataReadProgress(int, int)), this, SLOT(updateDataReadProgress(int, int))); connect(getter, SIGNAL(dataReadProgress(int, int)), this, SLOT(updateDataReadProgress(int, int)));
connect(m_dp, SIGNAL(aborted()), getter, SLOT(abort())); connect(m_dp, SIGNAL(aborted()), getter, SLOT(abort()));
} }
else //UnInstallation else //UnInstallation
{ {
QString firmware = m_mountpoint + "/GBSYSTEM/FWIMG/FWIMG01.DAT"; QString firmware = m_mountpoint + "/GBSYSTEM/FWIMG/FWIMG01.DAT";
QString firmwareOrig = firmware.append(".ORIG"); QString firmwareOrig = firmware.append(".ORIG");
QFileInfo firmwareOrigFI(firmwareOrig); QFileInfo firmwareOrigFI(firmwareOrig);
// check if original firmware exists // check if original firmware exists
if(!firmwareOrigFI.exists()) if(!firmwareOrigFI.exists())
{ {
m_dp->addItem(tr("Could not find the Original Firmware at: %1") m_dp->addItem(tr("Could not find the Original Firmware at: %1")
.arg(firmwareOrig),LOGERROR); .arg(firmwareOrig),LOGERROR);
emit done(true); emit done(true);
return; return;
} }
QFile firmwareFile(firmware); QFile firmwareFile(firmware);
QFile firmwareOrigFile(firmwareOrig); QFile firmwareOrigFile(firmwareOrig);
//remove modified firmware //remove modified firmware
if(!firmwareFile.remove()) if(!firmwareFile.remove())
{ {
m_dp->addItem(tr("Could not remove the Firmware at: %1") m_dp->addItem(tr("Could not remove the Firmware at: %1")
.arg(firmware),LOGERROR); .arg(firmware),LOGERROR);
emit done(true); emit done(true);
return; return;
} }
//copy original firmware //copy original firmware
if(!firmwareOrigFile.copy(firmware)) if(!firmwareOrigFile.copy(firmware))
{ {
m_dp->addItem(tr("Could not copy the Firmware from: %1 to %2") m_dp->addItem(tr("Could not copy the Firmware from: %1 to %2")
.arg(firmwareOrig,firmware),LOGERROR); .arg(firmwareOrig,firmware),LOGERROR);
emit done(true); emit done(true);
return; return;
} }
removeInstallLog(); removeInstallLog();
emit done(false); //success emit done(false); //success
} }
} }
void BootloaderInstaller::gigabeatFinish() void BootloaderInstaller::gigabeatFinish()
{ {
// this step is only need for installation, so no code for uninstall here // this step is only need for installation, so no code for uninstall here
m_dp->addItem(tr("Finishing bootloader install"),LOGINFO); m_dp->addItem(tr("Finishing bootloader install"),LOGINFO);
QString firmware = m_mountpoint + "/GBSYSTEM/FWIMG/" + m_bootloadername; QString firmware = m_mountpoint + "/GBSYSTEM/FWIMG/" + m_bootloadername;
QFileInfo firmwareFI(firmware); QFileInfo firmwareFI(firmware);
// check if firmware exists // check if firmware exists
if(!firmwareFI.exists()) if(!firmwareFI.exists())
{ {
m_dp->addItem(tr("Could not find the Firmware at: %1") m_dp->addItem(tr("Could not find the Firmware at: %1")
.arg(firmware),LOGERROR); .arg(firmware),LOGERROR);
emit done(true); emit done(true);
return; return;
} }
QString firmwareOrig = firmware; QString firmwareOrig = firmware;
firmwareOrig.append(".ORIG"); firmwareOrig.append(".ORIG");
QFileInfo firmwareOrigFI(firmwareOrig); QFileInfo firmwareOrigFI(firmwareOrig);
// rename the firmware, if there is no original firmware there // rename the firmware, if there is no original firmware there
if(!firmwareOrigFI.exists()) if(!firmwareOrigFI.exists())
{ {
@ -393,7 +393,7 @@ void BootloaderInstaller::gigabeatFinish()
QFile firmwareFile(firmware); QFile firmwareFile(firmware);
firmwareFile.remove(); firmwareFile.remove();
} }
//copy the firmware //copy the firmware
if(!downloadFile.copy(firmware)) if(!downloadFile.copy(firmware))
{ {
@ -402,11 +402,11 @@ void BootloaderInstaller::gigabeatFinish()
emit done(true); emit done(true);
return; return;
} }
downloadFile.remove(); downloadFile.remove();
createInstallLog(); createInstallLog();
m_dp->addItem(tr("Bootloader install finished successfully."),LOGOK); m_dp->addItem(tr("Bootloader install finished successfully."),LOGOK);
m_dp->addItem(tr("To finish the Bootloader installation, follow the steps below."),LOGINFO); m_dp->addItem(tr("To finish the Bootloader installation, follow the steps below."),LOGINFO);
m_dp->addItem(tr("1. Eject/Unmount your Device."),LOGINFO); m_dp->addItem(tr("1. Eject/Unmount your Device."),LOGINFO);
@ -414,22 +414,22 @@ void BootloaderInstaller::gigabeatFinish()
m_dp->addItem(tr("3. Hold POWER to turn the Device off."),LOGINFO); m_dp->addItem(tr("3. Hold POWER to turn the Device off."),LOGINFO);
m_dp->addItem(tr("4. Toggle the Battery switch on the Device."),LOGINFO); m_dp->addItem(tr("4. Toggle the Battery switch on the Device."),LOGINFO);
m_dp->addItem(tr("5. Hold POWER to boot the Rockbox bootloader."),LOGINFO); m_dp->addItem(tr("5. Hold POWER to boot the Rockbox bootloader."),LOGINFO);
m_dp->abort(); m_dp->abort();
emit done(false); // success emit done(false); // success
} }
/************************************************** /**************************************************
*** iaudio secific code *** iaudio secific code
***************************************************/ ***************************************************/
void BootloaderInstaller::iaudioPrepare() void BootloaderInstaller::iaudioPrepare()
{ {
QString url = m_bootloaderUrlBase + "/iaudio/" + m_bootloadername; QString url = m_bootloaderUrlBase + "/iaudio/" + m_bootloadername;
m_dp->addItem(tr("Downloading file %1.%2") m_dp->addItem(tr("Downloading file %1.%2")
.arg(QFileInfo(url).baseName(), QFileInfo(url).completeSuffix()),LOGINFO); .arg(QFileInfo(url).baseName(), QFileInfo(url).completeSuffix()),LOGINFO);
@ -444,14 +444,14 @@ void BootloaderInstaller::iaudioPrepare()
getter->getFile(QUrl(url)); getter->getFile(QUrl(url));
// connect signals from HttpGet // connect signals from HttpGet
connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool))); connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool)));
connect(getter, SIGNAL(dataReadProgress(int, int)), this, SLOT(updateDataReadProgress(int, int))); connect(getter, SIGNAL(dataReadProgress(int, int)), this, SLOT(updateDataReadProgress(int, int)));
connect(m_dp, SIGNAL(aborted()), getter, SLOT(abort())); connect(m_dp, SIGNAL(aborted()), getter, SLOT(abort()));
} }
void BootloaderInstaller::iaudioFinish() void BootloaderInstaller::iaudioFinish()
{ {
QString firmware = m_mountpoint + "/FIRMWARE/" + m_bootloadername; QString firmware = m_mountpoint + "/FIRMWARE/" + m_bootloadername;
//copy the firmware //copy the firmware
if(!downloadFile.copy(firmware)) if(!downloadFile.copy(firmware))
{ {
@ -460,33 +460,33 @@ void BootloaderInstaller::iaudioFinish()
emit done(true); emit done(true);
return; return;
} }
downloadFile.remove(); downloadFile.remove();
createInstallLog(); createInstallLog();
m_dp->addItem(tr("Bootloader install finished successfully."),LOGOK); m_dp->addItem(tr("Bootloader install finished successfully."),LOGOK);
m_dp->addItem(tr("To finish the Bootloader installation, follow the steps below."),LOGINFO); m_dp->addItem(tr("To finish the Bootloader installation, follow the steps below."),LOGINFO);
m_dp->addItem(tr("1. Eject/Unmount your Device."),LOGINFO); m_dp->addItem(tr("1. Eject/Unmount your Device."),LOGINFO);
m_dp->addItem(tr("2. Turn you Device OFF."),LOGINFO); m_dp->addItem(tr("2. Turn you Device OFF."),LOGINFO);
m_dp->addItem(tr("3. Insert Charger."),LOGINFO); m_dp->addItem(tr("3. Insert Charger."),LOGINFO);
m_dp->abort(); m_dp->abort();
emit done(false); // success emit done(false); // success
} }
/************************************************** /**************************************************
*** h10 secific code *** h10 secific code
***************************************************/ ***************************************************/
void BootloaderInstaller::h10Prepare() void BootloaderInstaller::h10Prepare()
{ {
if(m_install) // Installation if(m_install) // Installation
{ {
QString url = m_bootloaderUrlBase + "/iriver/" + m_bootloadername; QString url = m_bootloaderUrlBase + "/iriver/" + m_bootloadername;
m_dp->addItem(tr("Downloading file %1.%2") m_dp->addItem(tr("Downloading file %1.%2")
.arg(QFileInfo(url).baseName(), QFileInfo(url).completeSuffix()),LOGINFO); .arg(QFileInfo(url).baseName(), QFileInfo(url).completeSuffix()),LOGINFO);
@ -501,17 +501,17 @@ void BootloaderInstaller::h10Prepare()
getter->getFile(QUrl(url)); getter->getFile(QUrl(url));
// connect signals from HttpGet // connect signals from HttpGet
connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool))); connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool)));
connect(getter, SIGNAL(dataReadProgress(int, int)), this, SLOT(updateDataReadProgress(int, int))); connect(getter, SIGNAL(dataReadProgress(int, int)), this, SLOT(updateDataReadProgress(int, int)));
connect(m_dp, SIGNAL(aborted()), getter, SLOT(abort())); connect(m_dp, SIGNAL(aborted()), getter, SLOT(abort()));
} }
else // Uninstallation else // Uninstallation
{ {
QString firmwarename = m_bootloadername.section('/', -1); QString firmwarename = m_bootloadername.section('/', -1);
QString firmware = m_mountpoint + "/SYSTEM/" + firmwarename; QString firmware = m_mountpoint + "/SYSTEM/" + firmwarename;
QString firmwareOrig = m_mountpoint + "/SYSTEM/Original.mi4"; QString firmwareOrig = m_mountpoint + "/SYSTEM/Original.mi4";
QFileInfo firmwareFI(firmware); QFileInfo firmwareFI(firmware);
if(!firmwareFI.exists()) //Firmware dosent exists on player if(!firmwareFI.exists()) //Firmware dosent exists on player
{ {
@ -525,7 +525,7 @@ void BootloaderInstaller::h10Prepare()
return; return;
} }
} }
QFileInfo firmwareOrigFI(firmwareOrig); QFileInfo firmwareOrigFI(firmwareOrig);
if(!firmwareOrigFI.exists()) //Original Firmware dosent exists on player if(!firmwareOrigFI.exists()) //Original Firmware dosent exists on player
{ {
@ -534,32 +534,32 @@ void BootloaderInstaller::h10Prepare()
emit done(true); emit done(true);
return; return;
} }
QFile firmwareFile(firmware); QFile firmwareFile(firmware);
QFile firmwareOrigFile(firmwareOrig); QFile firmwareOrigFile(firmwareOrig);
//remove modified firmware //remove modified firmware
if(!firmwareFile.remove()) if(!firmwareFile.remove())
{ {
m_dp->addItem(tr("Could not remove the Firmware at: %1") m_dp->addItem(tr("Could not remove the Firmware at: %1")
.arg(firmware),LOGERROR); .arg(firmware),LOGERROR);
emit done(true); emit done(true);
return; return;
} }
//copy original firmware //copy original firmware
if(!firmwareOrigFile.copy(firmware)) if(!firmwareOrigFile.copy(firmware))
{ {
m_dp->addItem(tr("Could not copy the Firmware from: %1 to %2") m_dp->addItem(tr("Could not copy the Firmware from: %1 to %2")
.arg(firmwareOrig,firmware),LOGERROR); .arg(firmwareOrig,firmware),LOGERROR);
emit done(true); emit done(true);
return; return;
} }
removeInstallLog(); removeInstallLog();
emit done(false); //success emit done(false); //success
} }
} }
@ -569,9 +569,9 @@ void BootloaderInstaller::h10Finish()
QString firmware = m_mountpoint + "/SYSTEM/" + firmwarename; QString firmware = m_mountpoint + "/SYSTEM/" + firmwarename;
QString firmwareOrig = m_mountpoint + "/SYSTEM/Original.mi4"; QString firmwareOrig = m_mountpoint + "/SYSTEM/Original.mi4";
QFileInfo firmwareFI(firmware); QFileInfo firmwareFI(firmware);
if(!firmwareFI.exists()) //Firmware dosent exists on player if(!firmwareFI.exists()) //Firmware dosent exists on player
{ {
firmware = m_mountpoint + "/SYSTEM/H10EMP.mi4"; //attempt other firmwarename firmware = m_mountpoint + "/SYSTEM/H10EMP.mi4"; //attempt other firmwarename
@ -584,9 +584,9 @@ void BootloaderInstaller::h10Finish()
return; return;
} }
} }
QFileInfo firmwareOrigFI(firmwareOrig); QFileInfo firmwareOrigFI(firmwareOrig);
if(!firmwareOrigFI.exists()) //there is already a original firmware if(!firmwareOrigFI.exists()) //there is already a original firmware
{ {
QFile firmwareFile(firmware); QFile firmwareFile(firmware);
@ -611,20 +611,20 @@ void BootloaderInstaller::h10Finish()
emit done(true); emit done(true);
return; return;
} }
downloadFile.remove(); downloadFile.remove();
createInstallLog(); createInstallLog();
m_dp->addItem(tr("Bootloader install finished successfully."),LOGOK); m_dp->addItem(tr("Bootloader install finished successfully."),LOGOK);
m_dp->abort(); m_dp->abort();
emit done(false); // success emit done(false); // success
} }
/************************************************** /**************************************************
*** ipod secific code *** ipod secific code
***************************************************/ ***************************************************/
int verbose =0; int verbose =0;
// reserves memory for ipodpatcher // reserves memory for ipodpatcher
@ -651,12 +651,12 @@ void BootloaderInstaller::ipodPrepare()
m_dp->addItem(tr("Too many Ipods found"),LOGERROR); m_dp->addItem(tr("Too many Ipods found"),LOGERROR);
emit done(true); emit done(true);
} }
if(m_install) // Installation if(m_install) // Installation
{ {
QString url = m_bootloaderUrlBase + "/ipod/bootloader-" + m_bootloadername + ".ipod"; QString url = m_bootloaderUrlBase + "/ipod/bootloader-" + m_bootloadername + ".ipod";
m_dp->addItem(tr("Downloading file %1.%2") m_dp->addItem(tr("Downloading file %1.%2")
.arg(QFileInfo(url).baseName(), QFileInfo(url).completeSuffix()),LOGINFO); .arg(QFileInfo(url).baseName(), QFileInfo(url).completeSuffix()),LOGINFO);
@ -671,8 +671,8 @@ void BootloaderInstaller::ipodPrepare()
getter->getFile(QUrl(url)); getter->getFile(QUrl(url));
// connect signals from HttpGet // connect signals from HttpGet
connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool))); connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool)));
connect(getter, SIGNAL(dataReadProgress(int, int)), this, SLOT(updateDataReadProgress(int, int))); connect(getter, SIGNAL(dataReadProgress(int, int)), this, SLOT(updateDataReadProgress(int, int)));
connect(m_dp, SIGNAL(aborted()), getter, SLOT(abort())); connect(m_dp, SIGNAL(aborted()), getter, SLOT(abort()));
} }
else // Uninstallation else // Uninstallation
{ {
@ -693,13 +693,13 @@ void BootloaderInstaller::ipodPrepare()
if (ipod.pinfo[0].start==0) if (ipod.pinfo[0].start==0)
{ {
m_dp->addItem(tr("No partition 0 on disk"),LOGERROR); m_dp->addItem(tr("No partition 0 on disk"),LOGERROR);
int i; int i;
double sectors_per_MB = (1024.0*1024.0)/ipod.sector_size; double sectors_per_MB = (1024.0*1024.0)/ipod.sector_size;
m_dp->addItem(tr("[INFO] Part Start Sector End Sector Size (MB) Type\n"),LOGINFO); m_dp->addItem(tr("[INFO] Part Start Sector End Sector Size (MB) Type\n"),LOGINFO);
for ( i = 0; i < 4; i++ ) for ( i = 0; i < 4; i++ )
{ {
if (ipod.pinfo[i].start != 0) if (ipod.pinfo[i].start != 0)
{ {
m_dp->addItem(tr("[INFO] %1 %2 %3 %4 %5 (%6)").arg( m_dp->addItem(tr("[INFO] %1 %2 %3 %4 %5 (%6)").arg(
i).arg( i).arg(
@ -734,43 +734,43 @@ void BootloaderInstaller::ipodPrepare()
{ {
m_dp->addItem(tr("Warning this is a MacPod, Rockbox doesnt work on this. Convert it to WinPod"),LOGWARNING); m_dp->addItem(tr("Warning this is a MacPod, Rockbox doesnt work on this. Convert it to WinPod"),LOGWARNING);
} }
if (ipod_reopen_rw(&ipod) < 0) if (ipod_reopen_rw(&ipod) < 0)
{ {
m_dp->addItem(tr("Could not open Ipod in RW mode"),LOGERROR); m_dp->addItem(tr("Could not open Ipod in RW mode"),LOGERROR);
emit done(true); emit done(true);
return; return;
} }
if (ipod.ipod_directory[0].entryOffset==0) { if (ipod.ipod_directory[0].entryOffset==0) {
m_dp->addItem(tr("No bootloader detected."),LOGERROR); m_dp->addItem(tr("No bootloader detected."),LOGERROR);
emit done(true); emit done(true);
return; return;
} }
if (delete_bootloader(&ipod)==0) if (delete_bootloader(&ipod)==0)
{ {
m_dp->addItem(tr("Successfully removed Bootloader"),LOGOK); m_dp->addItem(tr("Successfully removed Bootloader"),LOGOK);
removeInstallLog(); removeInstallLog();
emit done(false); emit done(false);
ipod_close(&ipod); ipod_close(&ipod);
return; return;
} }
else else
{ {
m_dp->addItem(tr("--delete-bootloader failed."),LOGERROR); m_dp->addItem(tr("--delete-bootloader failed."),LOGERROR);
emit done(true); emit done(true);
ipod_close(&ipod); ipod_close(&ipod);
return; return;
} }
} }
} }
void BootloaderInstaller::ipodFinish() void BootloaderInstaller::ipodFinish()
{ {
struct ipod_t ipod; struct ipod_t ipod;
ipod_scan(&ipod); ipod_scan(&ipod);
if (ipod_open(&ipod, 0) < 0) if (ipod_open(&ipod, 0) < 0)
{ {
m_dp->addItem(tr("could not open ipod"),LOGERROR); m_dp->addItem(tr("could not open ipod"),LOGERROR);
@ -788,15 +788,15 @@ void BootloaderInstaller::ipodFinish()
if (ipod.pinfo[0].start==0) if (ipod.pinfo[0].start==0)
{ {
m_dp->addItem(tr("No partition 0 on disk"),LOGERROR); m_dp->addItem(tr("No partition 0 on disk"),LOGERROR);
int i; int i;
double sectors_per_MB = (1024.0*1024.0)/ipod.sector_size; double sectors_per_MB = (1024.0*1024.0)/ipod.sector_size;
m_dp->addItem(tr("[INFO] Part Start Sector End Sector Size (MB) Type\n"),LOGINFO); m_dp->addItem(tr("[INFO] Part Start Sector End Sector Size (MB) Type\n"),LOGINFO);
for ( i = 0; i < 4; i++ ) for ( i = 0; i < 4; i++ )
{ {
if (ipod.pinfo[i].start != 0) if (ipod.pinfo[i].start != 0)
{ {
m_dp->addItem(tr("[INFO] %1 %2 %3 %4 %5 (%6)").arg( m_dp->addItem(tr("[INFO] %1 %2 %3 %4 %5 (%6)").arg(
i).arg( i).arg(
@ -832,32 +832,32 @@ void BootloaderInstaller::ipodFinish()
m_dp->addItem(tr("Warning this is a MacPod, Rockbox doesnt work on this. Convert it to WinPod"),LOGWARNING); m_dp->addItem(tr("Warning this is a MacPod, Rockbox doesnt work on this. Convert it to WinPod"),LOGWARNING);
} }
if (ipod_reopen_rw(&ipod) < 0) if (ipod_reopen_rw(&ipod) < 0)
{ {
m_dp->addItem(tr("Could not open Ipod in RW mode"),LOGERROR); m_dp->addItem(tr("Could not open Ipod in RW mode"),LOGERROR);
emit done(true); emit done(true);
return; return;
} }
if (add_bootloader(&ipod, m_tempfilename.toLatin1().data(), FILETYPE_DOT_IPOD)==0) if (add_bootloader(&ipod, m_tempfilename.toLatin1().data(), FILETYPE_DOT_IPOD)==0)
{ {
m_dp->addItem(tr("Successfully added Bootloader"),LOGOK); m_dp->addItem(tr("Successfully added Bootloader"),LOGOK);
createInstallLog(); createInstallLog();
emit done(false); emit done(false);
ipod_close(&ipod); ipod_close(&ipod);
return; return;
} }
else else
{ {
m_dp->addItem(tr("failed to add Bootloader"),LOGERROR); m_dp->addItem(tr("failed to add Bootloader"),LOGERROR);
ipod_close(&ipod); ipod_close(&ipod);
emit done(true); emit done(true);
return; return;
} }
} }
/************************************************** /**************************************************
*** sansa secific code *** sansa secific code
***************************************************/ ***************************************************/
// reserves memory for sansapatcher // reserves memory for sansapatcher
bool initSansapatcher() bool initSansapatcher()
@ -884,11 +884,11 @@ void BootloaderInstaller::sansaPrepare()
m_dp->addItem(tr("Too many Sansas found"),LOGERROR); m_dp->addItem(tr("Too many Sansas found"),LOGERROR);
emit done(true); emit done(true);
} }
if(m_install) // Installation if(m_install) // Installation
{ {
QString url = m_bootloaderUrlBase + "/sandisk-sansa/e200/" + m_bootloadername; QString url = m_bootloaderUrlBase + "/sandisk-sansa/e200/" + m_bootloadername;
m_dp->addItem(tr("Downloading file %1.%2") m_dp->addItem(tr("Downloading file %1.%2")
.arg(QFileInfo(url).baseName(), QFileInfo(url).completeSuffix()),LOGINFO); .arg(QFileInfo(url).baseName(), QFileInfo(url).completeSuffix()),LOGINFO);
@ -903,19 +903,19 @@ void BootloaderInstaller::sansaPrepare()
getter->getFile(QUrl(url)); getter->getFile(QUrl(url));
// connect signals from HttpGet // connect signals from HttpGet
connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool))); connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool)));
connect(getter, SIGNAL(dataReadProgress(int, int)), this, SLOT(updateDataReadProgress(int, int))); connect(getter, SIGNAL(dataReadProgress(int, int)), this, SLOT(updateDataReadProgress(int, int)));
connect(m_dp, SIGNAL(aborted()), getter, SLOT(abort())); connect(m_dp, SIGNAL(aborted()), getter, SLOT(abort()));
} }
else // Uninstallation else // Uninstallation
{ {
if (sansa_open(&sansa, 0) < 0) if (sansa_open(&sansa, 0) < 0)
{ {
m_dp->addItem(tr("could not open Sansa"),LOGERROR); m_dp->addItem(tr("could not open Sansa"),LOGERROR);
emit done(true); emit done(true);
return; return;
} }
if (sansa_read_partinfo(&sansa,0) < 0) if (sansa_read_partinfo(&sansa,0) < 0)
{ {
m_dp->addItem(tr("could not read partitiontable"),LOGERROR); m_dp->addItem(tr("could not read partitiontable"),LOGERROR);
@ -941,45 +941,45 @@ void BootloaderInstaller::sansaPrepare()
emit done(true); emit done(true);
return; return;
} }
if (sansa_reopen_rw(&sansa) < 0)
if (sansa_reopen_rw(&sansa) < 0)
{ {
m_dp->addItem(tr("Could not open Sansa in RW mode"),LOGERROR); m_dp->addItem(tr("Could not open Sansa in RW mode"),LOGERROR);
emit done(true); emit done(true);
return; return;
} }
if (sansa_delete_bootloader(&sansa)==0) if (sansa_delete_bootloader(&sansa)==0)
{ {
m_dp->addItem(tr("Successfully removed Bootloader"),LOGOK); m_dp->addItem(tr("Successfully removed Bootloader"),LOGOK);
removeInstallLog(); removeInstallLog();
emit done(false); emit done(false);
sansa_close(&sansa); sansa_close(&sansa);
return; return;
} }
else else
{ {
m_dp->addItem(tr("--delete-bootloader failed."),LOGERROR); m_dp->addItem(tr("--delete-bootloader failed."),LOGERROR);
emit done(true); emit done(true);
sansa_close(&sansa); sansa_close(&sansa);
return; return;
} }
} }
} }
void BootloaderInstaller::sansaFinish() void BootloaderInstaller::sansaFinish()
{ {
struct sansa_t sansa; struct sansa_t sansa;
sansa_scan(&sansa); sansa_scan(&sansa);
if (sansa_open(&sansa, 0) < 0) if (sansa_open(&sansa, 0) < 0)
{ {
m_dp->addItem(tr("could not open Sansa"),LOGERROR); m_dp->addItem(tr("could not open Sansa"),LOGERROR);
emit done(true); emit done(true);
return; return;
} }
if (sansa_read_partinfo(&sansa,0) < 0) if (sansa_read_partinfo(&sansa,0) < 0)
{ {
m_dp->addItem(tr("could not read partitiontable"),LOGERROR); m_dp->addItem(tr("could not read partitiontable"),LOGERROR);
@ -990,7 +990,7 @@ void BootloaderInstaller::sansaFinish()
int i = is_e200(&sansa); int i = is_e200(&sansa);
if (i < 0) { if (i < 0) {
m_dp->addItem(tr("Disk is not an E200 (%1), aborting.").arg(i),LOGERROR); m_dp->addItem(tr("Disk is not an E200 (%1), aborting.").arg(i),LOGERROR);
emit done(true); emit done(true);
return; return;
@ -1008,33 +1008,33 @@ void BootloaderInstaller::sansaFinish()
return; return;
} }
if (sansa_reopen_rw(&sansa) < 0) if (sansa_reopen_rw(&sansa) < 0)
{ {
m_dp->addItem(tr("Could not open Sansa in RW mode"),LOGERROR); m_dp->addItem(tr("Could not open Sansa in RW mode"),LOGERROR);
emit done(true); emit done(true);
return; return;
} }
if (sansa_add_bootloader(&sansa, m_tempfilename.toLatin1().data(), FILETYPE_MI4)==0) if (sansa_add_bootloader(&sansa, m_tempfilename.toLatin1().data(), FILETYPE_MI4)==0)
{ {
m_dp->addItem(tr("Successfully added Bootloader"),LOGOK); m_dp->addItem(tr("Successfully added Bootloader"),LOGOK);
createInstallLog(); createInstallLog();
emit done(false); emit done(false);
sansa_close(&sansa); sansa_close(&sansa);
return; return;
} }
else else
{ {
m_dp->addItem(tr("failed to add Bootloader"),LOGERROR); m_dp->addItem(tr("failed to add Bootloader"),LOGERROR);
sansa_close(&sansa); sansa_close(&sansa);
emit done(true); emit done(true);
return; return;
} }
} }
/************************************************** /**************************************************
*** iriver /fwpatcher secific code *** iriver /fwpatcher secific code
***************************************************/ ***************************************************/
void BootloaderInstaller::iriverPrepare() void BootloaderInstaller::iriverPrepare()
@ -1045,7 +1045,7 @@ void BootloaderInstaller::iriverPrepare()
emit done(true); emit done(true);
return; return;
} }
/* Check firmware against md5sums in h120sums and h100sums */ /* Check firmware against md5sums in h120sums and h100sums */
series = 0; series = 0;
table_entry = intable(md5sum_str, &h120pairs[0], table_entry = intable(md5sum_str, &h120pairs[0],
@ -1053,15 +1053,15 @@ void BootloaderInstaller::iriverPrepare()
if (table_entry >= 0) { if (table_entry >= 0) {
series = 120; series = 120;
} }
else else
{ {
table_entry = intable(md5sum_str, &h100pairs[0], table_entry = intable(md5sum_str, &h100pairs[0],
sizeof(h100pairs)/sizeof(struct sumpairs)); sizeof(h100pairs)/sizeof(struct sumpairs));
if (table_entry >= 0) if (table_entry >= 0)
{ {
series = 100; series = 100;
} }
else else
{ {
table_entry = intable(md5sum_str, &h300pairs[0], table_entry = intable(md5sum_str, &h300pairs[0],
sizeof(h300pairs)/sizeof(struct sumpairs)); sizeof(h300pairs)/sizeof(struct sumpairs));
@ -1075,9 +1075,9 @@ void BootloaderInstaller::iriverPrepare()
emit done(true); emit done(true);
return; return;
} }
QString url = m_bootloaderUrlBase + "/iriver/" + m_bootloadername; QString url = m_bootloaderUrlBase + "/iriver/" + m_bootloadername;
m_dp->addItem(tr("Downloading file %1.%2") m_dp->addItem(tr("Downloading file %1.%2")
.arg(QFileInfo(url).baseName(), QFileInfo(url).completeSuffix()),LOGINFO); .arg(QFileInfo(url).baseName(), QFileInfo(url).completeSuffix()),LOGINFO);
@ -1092,8 +1092,8 @@ void BootloaderInstaller::iriverPrepare()
getter->getFile(QUrl(url)); getter->getFile(QUrl(url));
// connect signals from HttpGet // connect signals from HttpGet
connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool))); connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool)));
connect(getter, SIGNAL(dataReadProgress(int, int)), this, SLOT(updateDataReadProgress(int, int))); connect(getter, SIGNAL(dataReadProgress(int, int)), this, SLOT(updateDataReadProgress(int, int)));
connect(m_dp, SIGNAL(aborted()), getter, SLOT(abort())); connect(m_dp, SIGNAL(aborted()), getter, SLOT(abort()));
} }
void BootloaderInstaller::iriverFinish() void BootloaderInstaller::iriverFinish()
@ -1118,7 +1118,7 @@ void BootloaderInstaller::iriverFinish()
origin = 0x3f0000; origin = 0x3f0000;
break; break;
} }
// temporary files needs to be opened to get the filename // temporary files needs to be opened to get the filename
QTemporaryFile firmwareBin, newBin, newHex; QTemporaryFile firmwareBin, newBin, newHex;
firmwareBin.open(); firmwareBin.open();
@ -1130,9 +1130,9 @@ void BootloaderInstaller::iriverFinish()
firmwareBin.close(); firmwareBin.close();
newBin.close(); newBin.close();
newHex.close(); newHex.close();
// iriver decode // iriver decode
if (iriver_decode(m_origfirmware, firmwareBinName, FALSE, STRIP_NONE,m_dp) == -1) if (iriver_decode(m_origfirmware, firmwareBinName, FALSE, STRIP_NONE,m_dp) == -1)
{ {
m_dp->addItem(tr("Error in descramble"),LOGERROR); m_dp->addItem(tr("Error in descramble"),LOGERROR);
firmwareBin.remove(); firmwareBin.remove();
@ -1142,7 +1142,7 @@ void BootloaderInstaller::iriverFinish()
return; return;
} }
// mkboot // mkboot
if (!mkboot(firmwareBinName, newBinName, m_tempfilename, origin,m_dp)) if (!mkboot(firmwareBinName, newBinName, m_tempfilename, origin,m_dp))
{ {
m_dp->addItem(tr("Error in patching"),LOGERROR); m_dp->addItem(tr("Error in patching"),LOGERROR);
firmwareBin.remove(); firmwareBin.remove();
@ -1152,7 +1152,7 @@ void BootloaderInstaller::iriverFinish()
return; return;
} }
// iriver_encode // iriver_encode
if (iriver_encode(newBinName, newHexName, FALSE,m_dp) == -1) if (iriver_encode(newBinName, newHexName, FALSE,m_dp) == -1)
{ {
m_dp->addItem(tr("Error in scramble"),LOGERROR); m_dp->addItem(tr("Error in scramble"),LOGERROR);
firmwareBin.remove(); firmwareBin.remove();
@ -1161,9 +1161,9 @@ void BootloaderInstaller::iriverFinish()
emit done(true); emit done(true);
return; return;
} }
/* now md5sum it */ /* now md5sum it */
if (!FileMD5(newHexName, md5sum_str)) if (!FileMD5(newHexName, md5sum_str))
{ {
m_dp->addItem(tr("Error in checksumming"),LOGERROR); m_dp->addItem(tr("Error in checksumming"),LOGERROR);
firmwareBin.remove(); firmwareBin.remove();
@ -1177,7 +1177,7 @@ void BootloaderInstaller::iriverFinish()
firmwareBin.remove(); firmwareBin.remove();
newBin.remove(); newBin.remove();
} }
// Load patched Firmware to player // Load patched Firmware to player
QString dest; QString dest;
if(series == 100) if(series == 100)
@ -1186,7 +1186,7 @@ void BootloaderInstaller::iriverFinish()
dest = m_mountpoint + "/ihp_120.hex"; dest = m_mountpoint + "/ihp_120.hex";
else if(series == 300) else if(series == 300)
dest = m_mountpoint + "/H300.hex"; dest = m_mountpoint + "/H300.hex";
// copy file // copy file
QFile destfile(dest); QFile destfile(dest);
if(destfile.exists()) destfile.remove(); if(destfile.exists()) destfile.remove();
@ -1197,12 +1197,12 @@ void BootloaderInstaller::iriverFinish()
emit done(true); emit done(true);
return; return;
} }
downloadFile.remove(); downloadFile.remove();
newHex.remove(); newHex.remove();
createInstallLog(); createInstallLog();
m_dp->addItem(tr("Bootloader install finished successfully."),LOGOK); m_dp->addItem(tr("Bootloader install finished successfully."),LOGOK);
m_dp->addItem(tr("To finish the Bootloader installation, follow the steps below."),LOGINFO); m_dp->addItem(tr("To finish the Bootloader installation, follow the steps below."),LOGINFO);
m_dp->addItem(tr("1. Eject/Unmount your Device."),LOGINFO); m_dp->addItem(tr("1. Eject/Unmount your Device."),LOGINFO);
@ -1210,7 +1210,7 @@ void BootloaderInstaller::iriverFinish()
m_dp->addItem(tr("3. Use the Firmware flash option in the Original Firmware."),LOGINFO); m_dp->addItem(tr("3. Use the Firmware flash option in the Original Firmware."),LOGINFO);
m_dp->addItem(tr("4. Reboot."),LOGINFO); m_dp->addItem(tr("4. Reboot."),LOGINFO);
m_dp->abort(); m_dp->abort();
emit done(false); // success emit done(false); // success

View file

@ -16,7 +16,7 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
****************************************************************************/ ****************************************************************************/
#ifndef INSTALLBOOTLOADER_H #ifndef INSTALLBOOTLOADER_H
#define INSTALLBOOTLOADER_H #define INSTALLBOOTLOADER_H
@ -38,14 +38,14 @@ bool initSansapatcher();
class BootloaderInstaller : public QObject class BootloaderInstaller : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
BootloaderInstaller(QObject* parent); BootloaderInstaller(QObject* parent);
~BootloaderInstaller() {} ~BootloaderInstaller() {}
void install(ProgressloggerInterface* dp); void install(ProgressloggerInterface* dp);
void uninstall(ProgressloggerInterface* dp); void uninstall(ProgressloggerInterface* dp);
void setMountPoint(QString mountpoint) {m_mountpoint = mountpoint;} void setMountPoint(QString mountpoint) {m_mountpoint = mountpoint;}
void setProxy(QUrl proxy) {m_proxy= proxy;} void setProxy(QUrl proxy) {m_proxy= proxy;}
void setDevice(QString device) {m_device= device;} //!< the current plattform void setDevice(QString device) {m_device= device;} //!< the current plattform
@ -56,14 +56,14 @@ public:
void setBootloaderInfoUrl(QString url) {m_bootloaderinfoUrl =url; } //!< the url for the info file void setBootloaderInfoUrl(QString url) {m_bootloaderinfoUrl =url; } //!< the url for the info file
bool downloadInfo(); //!< should be called before install/uninstall, blocks until downloaded. bool downloadInfo(); //!< should be called before install/uninstall, blocks until downloaded.
bool uptodate(); //!< returns wether the bootloader is uptodate bool uptodate(); //!< returns wether the bootloader is uptodate
signals: signals:
void done(bool error); //installation finished. void done(bool error); //installation finished.
signals: // internal signals. Dont use this from out side. signals: // internal signals. Dont use this from out side.
void prepare(); void prepare();
void finish(); void finish();
private slots: private slots:
void createInstallLog(); // adds the bootloader entry to the log void createInstallLog(); // adds the bootloader entry to the log
void removeInstallLog(); // removes the bootloader entry from the log void removeInstallLog(); // removes the bootloader entry from the log
@ -74,23 +74,23 @@ private slots:
void infoDownloadDone(bool); void infoDownloadDone(bool);
void infoRequestFinished(int, bool); void infoRequestFinished(int, bool);
void installEnded(bool); void installEnded(bool);
// gigabeat specific routines // gigabeat specific routines
void gigabeatPrepare(); void gigabeatPrepare();
void gigabeatFinish(); void gigabeatFinish();
//iaudio specific routines //iaudio specific routines
void iaudioPrepare(); void iaudioPrepare();
void iaudioFinish(); void iaudioFinish();
//h10 specific routines //h10 specific routines
void h10Prepare(); void h10Prepare();
void h10Finish(); void h10Finish();
//ipod specific routines //ipod specific routines
void ipodPrepare(); void ipodPrepare();
void ipodFinish(); void ipodFinish();
//sansa specific routines //sansa specific routines
void sansaPrepare(); void sansaPrepare();
void sansaFinish(); void sansaFinish();
@ -98,25 +98,25 @@ private slots:
//iriver specific routines //iriver specific routines
void iriverPrepare(); void iriverPrepare();
void iriverFinish(); void iriverFinish();
private: private:
HttpGet *infodownloader; HttpGet *infodownloader;
QTemporaryFile bootloaderInfo; QTemporaryFile bootloaderInfo;
volatile bool infoDownloaded; volatile bool infoDownloaded;
volatile bool infoError; volatile bool infoError;
QString m_mountpoint, m_device,m_bootloadermethod,m_bootloadername; QString m_mountpoint, m_device,m_bootloadermethod,m_bootloadername;
QString m_bootloaderUrlBase,m_tempfilename,m_origfirmware; QString m_bootloaderUrlBase,m_tempfilename,m_origfirmware;
QUrl m_proxy; QUrl m_proxy;
QString m_bootloaderinfoUrl; QString m_bootloaderinfoUrl;
bool m_install; bool m_install;
int series,table_entry; // for fwpatcher int series,table_entry; // for fwpatcher
HttpGet *getter; HttpGet *getter;
QTemporaryFile downloadFile; QTemporaryFile downloadFile;
ProgressloggerInterface* m_dp; ProgressloggerInterface* m_dp;
}; };

View file

@ -26,7 +26,7 @@ InstallTalkWindow::InstallTalkWindow(QWidget *parent) : QDialog(parent)
{ {
ui.setupUi(this); ui.setupUi(this);
talkcreator = new TalkFileCreator(this); talkcreator = new TalkFileCreator(this);
connect(ui.buttonBrowse, SIGNAL(clicked()), this, SLOT(browseFolder())); connect(ui.buttonBrowse, SIGNAL(clicked()), this, SLOT(browseFolder()));
ui.OverwriteWav->setChecked(true); ui.OverwriteWav->setChecked(true);
@ -40,7 +40,7 @@ void InstallTalkWindow::browseFolder()
{ {
BrowseDirtree browser(this); BrowseDirtree browser(this);
browser.setFilter(QDir::AllDirs | QDir::NoDotAndDotDot | QDir::NoSymLinks); browser.setFilter(QDir::AllDirs | QDir::NoDotAndDotDot | QDir::NoSymLinks);
if(QFileInfo(ui.lineTalkFolder->text()).isDir()) if(QFileInfo(ui.lineTalkFolder->text()).isDir())
{ {
browser.setDir(ui.lineTalkFolder->text()); browser.setDir(ui.lineTalkFolder->text());
@ -67,7 +67,7 @@ void InstallTalkWindow::accept()
logger = new ProgressLoggerGui(this); logger = new ProgressLoggerGui(this);
logger->show(); logger->show();
connect(logger,SIGNAL(closed()),this,SLOT(close())); connect(logger,SIGNAL(closed()),this,SLOT(close()));
QString folderToTalk = ui.lineTalkFolder->text(); QString folderToTalk = ui.lineTalkFolder->text();
QString pathEncoder = userSettings->value("encbin").toString(); QString pathEncoder = userSettings->value("encbin").toString();
QString pathTTS = userSettings->value("ttsbin").toString(); QString pathTTS = userSettings->value("ttsbin").toString();
@ -78,23 +78,23 @@ void InstallTalkWindow::accept()
logger->abort(); logger->abort();
return; return;
} }
if(!QFileInfo(pathEncoder).isExecutable()) if(!QFileInfo(pathEncoder).isExecutable())
{ {
logger->addItem(tr("Path to Encoder is wrong!"),LOGERROR); logger->addItem(tr("Path to Encoder is wrong!"),LOGERROR);
logger->abort(); logger->abort();
return; return;
} }
if(!QFileInfo(pathTTS).isExecutable()) if(!QFileInfo(pathTTS).isExecutable())
{ {
logger->addItem(tr("Path to TTS is wrong!"),LOGERROR); logger->addItem(tr("Path to TTS is wrong!"),LOGERROR);
logger->abort(); logger->abort();
return; return;
} }
userSettings->setValue("last_talked_folder", folderToTalk); userSettings->setValue("last_talked_folder", folderToTalk);
userSettings->sync(); userSettings->sync();
talkcreator->setDir(folderToTalk); talkcreator->setDir(folderToTalk);
@ -102,7 +102,7 @@ void InstallTalkWindow::accept()
talkcreator->setEncexe(pathEncoder); talkcreator->setEncexe(pathEncoder);
talkcreator->setEncOpts(userSettings->value("encopts").toString()); talkcreator->setEncOpts(userSettings->value("encopts").toString());
talkcreator->setTTsOpts(userSettings->value("ttsopts").toString()); talkcreator->setTTsOpts(userSettings->value("ttsopts").toString());
devices->beginGroup(userSettings->value("ttspreset").toString()); devices->beginGroup(userSettings->value("ttspreset").toString());
talkcreator->setTTsType(devices->value("tts").toString()); talkcreator->setTTsType(devices->value("tts").toString());
talkcreator->setTTsOpts(devices->value("options").toString()); talkcreator->setTTsOpts(devices->value("options").toString());
@ -113,7 +113,7 @@ void InstallTalkWindow::accept()
talkcreator->setEncOpts(devices->value("options").toString()); talkcreator->setEncOpts(devices->value("options").toString());
talkcreator->setEncTemplate(devices->value("template").toString()); talkcreator->setEncTemplate(devices->value("template").toString());
devices->endGroup(); devices->endGroup();
talkcreator->setOverwriteTalk(ui.OverwriteTalk->isChecked()); talkcreator->setOverwriteTalk(ui.OverwriteTalk->isChecked());
talkcreator->setOverwriteWav(ui.OverwriteWav->isChecked()); talkcreator->setOverwriteWav(ui.OverwriteWav->isChecked());
talkcreator->setRemoveWav(ui.RemoveWav->isChecked()); talkcreator->setRemoveWav(ui.RemoveWav->isChecked());
@ -128,7 +128,7 @@ void InstallTalkWindow::setDeviceSettings(QSettings *dev)
{ {
devices = dev; devices = dev;
qDebug() << "Install::setDeviceSettings:" << devices; qDebug() << "Install::setDeviceSettings:" << devices;
QString profile; QString profile;
profile = userSettings->value("ttspreset", "none").toString(); profile = userSettings->value("ttspreset", "none").toString();
@ -151,9 +151,9 @@ void InstallTalkWindow::setDeviceSettings(QSettings *dev)
void InstallTalkWindow::setUserSettings(QSettings *user) void InstallTalkWindow::setUserSettings(QSettings *user)
{ {
userSettings = user; userSettings = user;
talkcreator->setMountPoint(userSettings->value("mountpoint").toString()); talkcreator->setMountPoint(userSettings->value("mountpoint").toString());
setTalkFolder(userSettings->value("last_talked_folder").toString()); setTalkFolder(userSettings->value("last_talked_folder").toString());
} }

View file

@ -153,7 +153,7 @@ void ThemesInstallWindow::downloadDone(bool error)
void ThemesInstallWindow::updateDetails(int row) void ThemesInstallWindow::updateDetails(int row)
{ {
if(row == currentItem) return; if(row == currentItem) return;
currentItem = row; currentItem = row;
qDebug() << "updateDetails(int) =" << row; qDebug() << "updateDetails(int) =" << row;
QSettings iniDetails(themesInfo.fileName(), QSettings::IniFormat, this); QSettings iniDetails(themesInfo.fileName(), QSettings::IniFormat, this);
@ -161,7 +161,7 @@ void ThemesInstallWindow::updateDetails(int row)
.arg(ui.listThemes->item(row)->data(Qt::DisplayRole).toString())); .arg(ui.listThemes->item(row)->data(Qt::DisplayRole).toString()));
ui.themePreview->clear(); ui.themePreview->clear();
ui.themePreview->setText(tr("fetching preview ...")); ui.themePreview->setText(tr("fetching preview ..."));
int size = 0; int size = 0;
iniDetails.beginGroup(ui.listThemes->item(row)->data(Qt::UserRole).toString()); iniDetails.beginGroup(ui.listThemes->item(row)->data(Qt::UserRole).toString());
@ -184,7 +184,7 @@ void ThemesInstallWindow::updateDetails(int row)
text = tr("<b>Author:</b> %1<hr/>").arg(iniDetails.value("author", tr("unknown")).toString()); text = tr("<b>Author:</b> %1<hr/>").arg(iniDetails.value("author", tr("unknown")).toString());
text += tr("<b>Version:</b> %1<hr/>").arg(iniDetails.value("version", tr("unknown")).toString()); text += tr("<b>Version:</b> %1<hr/>").arg(iniDetails.value("version", tr("unknown")).toString());
text += tr("<b>Description:</b> %1<hr/>").arg(iniDetails.value("about", tr("no description")).toString()); text += tr("<b>Description:</b> %1<hr/>").arg(iniDetails.value("about", tr("no description")).toString());
ui.themeDescription->setHtml(text); ui.themeDescription->setHtml(text);
iniDetails.endGroup(); iniDetails.endGroup();
@ -211,7 +211,7 @@ void ThemesInstallWindow::updateImage(bool error)
{ {
qDebug() << "updateImage(bool) =" << error; qDebug() << "updateImage(bool) =" << error;
if(error) return; if(error) return;
QPixmap p; QPixmap p;
if(!error) { if(!error) {
imgData = igetter.readAll(); imgData = igetter.readAll();
@ -221,7 +221,7 @@ void ThemesInstallWindow::updateImage(bool error)
ui.themePreview->clear(); ui.themePreview->clear();
ui.themePreview->setText(tr("no theme preview")); ui.themePreview->setText(tr("no theme preview"));
} }
else else
ui.themePreview->setPixmap(p); ui.themePreview->setPixmap(p);
} }
} }
@ -302,7 +302,7 @@ void ThemesInstallWindow::accept()
iniDetails.endGroup(); iniDetails.endGroup();
} }
qDebug() << "installing themes:" << themes; qDebug() << "installing themes:" << themes;
logger = new ProgressLoggerGui(this); logger = new ProgressLoggerGui(this);
logger->show(); logger->show();
QString mountPoint = userSettings->value("mountpoint").toString(); QString mountPoint = userSettings->value("mountpoint").toString();

View file

@ -16,13 +16,13 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
****************************************************************************/ ****************************************************************************/
#include "installzip.h" #include "installzip.h"
#include "zip/zip.h" #include "zip/zip.h"
#include "zip/unzip.h" #include "zip/unzip.h"
ZipInstaller::ZipInstaller(QObject* parent): QObject(parent) ZipInstaller::ZipInstaller(QObject* parent): QObject(parent)
{ {
m_unzip = true; m_unzip = true;
m_cache = ""; m_cache = "";
@ -46,7 +46,7 @@ void ZipInstaller::install(ProgressloggerInterface *dp)
void ZipInstaller::installContinue() void ZipInstaller::installContinue()
{ {
qDebug() << "installContinue()"; qDebug() << "installContinue()";
runner++; // this gets called when a install finished, so increase first. runner++; // this gets called when a install finished, so increase first.
qDebug() << "runner is now at" << runner << "size is" << m_urllist.size(); qDebug() << "runner is now at" << runner << "size is" << m_urllist.size();
if(runner < m_urllist.size()) { if(runner < m_urllist.size()) {
@ -115,7 +115,7 @@ void ZipInstaller::downloadDone(bool error)
qDebug() << "Install::downloadDone, error:" << error; qDebug() << "Install::downloadDone, error:" << error;
QStringList zipContents; // needed later QStringList zipContents; // needed later
// update progress bar // update progress bar
int max = m_dp->getProgressMax(); int max = m_dp->getProgressMax();
if(max == 0) { if(max == 0) {
max = 100; max = 100;
@ -155,7 +155,7 @@ void ZipInstaller::downloadDone(bool error)
emit done(false); emit done(false);
return; return;
} }
ec = uz.extractAll(m_mountpoint); ec = uz.extractAll(m_mountpoint);
if(ec != UnZip::Ok) { if(ec != UnZip::Ok) {
m_dp->addItem(tr("Extracting failed: %1.") m_dp->addItem(tr("Extracting failed: %1.")
@ -185,7 +185,7 @@ void ZipInstaller::downloadDone(bool error)
emit done(false); emit done(false);
return; return;
} }
// add file to log // add file to log
zipContents.append( m_target); zipContents.append( m_target);
} }

View file

@ -16,11 +16,11 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
****************************************************************************/ ****************************************************************************/
#ifndef INSTALLZIP_H #ifndef INSTALLZIP_H
#define INSTALLZIP_H #define INSTALLZIP_H
#include <QtGui> #include <QtGui>
@ -28,9 +28,9 @@
#include "progressloggerinterface.h" #include "progressloggerinterface.h"
#include "httpget.h" #include "httpget.h"
class ZipInstaller : public QObject class ZipInstaller : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
ZipInstaller(QObject* parent) ; ZipInstaller(QObject* parent) ;
@ -48,11 +48,11 @@ public:
void setTarget(QString t) { m_target = t; } void setTarget(QString t) { m_target = t; }
void setCache(QDir c) { m_cache = c; }; void setCache(QDir c) { m_cache = c; };
void setCache(QString c) { m_cache = QDir(c);} void setCache(QString c) { m_cache = QDir(c);}
signals: signals:
void done(bool error); void done(bool error);
void cont(); void cont();
private slots: private slots:
void updateDataReadProgress(int, int); void updateDataReadProgress(int, int);
void downloadDone(bool); void downloadDone(bool);
@ -69,14 +69,14 @@ private:
QString m_target; QString m_target;
int runner; int runner;
QDir m_cache; QDir m_cache;
HttpGet *getter; HttpGet *getter;
QTemporaryFile *downloadFile; QTemporaryFile *downloadFile;
ProgressloggerInterface* m_dp; ProgressloggerInterface* m_dp;
}; };
#endif #endif

View file

@ -27,7 +27,7 @@ PreviewDlg::PreviewDlg(QWidget *parent) : QDialog(parent)
this->setModal(true); this->setModal(true);
this->setMouseTracking(true); this->setMouseTracking(true);
this->setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint); this->setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint);
} }
void PreviewDlg::setText(QString text) void PreviewDlg::setText(QString text)
@ -39,7 +39,7 @@ void PreviewDlg::setPixmap(QPixmap p)
{ {
ui.themePreview->setFixedSize(p.size()); ui.themePreview->setFixedSize(p.size());
this->resize(QSize(10,10)); this->resize(QSize(10,10));
ui.themePreview->setPixmap(p); ui.themePreview->setPixmap(p);
} }
void PreviewDlg::mouseMoveEvent(QMouseEvent * event) void PreviewDlg::mouseMoveEvent(QMouseEvent * event)
@ -58,9 +58,9 @@ PreviewLabel::PreviewLabel(QWidget * parent, Qt::WindowFlags f)
:QLabel(parent,f) :QLabel(parent,f)
{ {
this->setMouseTracking(true); this->setMouseTracking(true);
preview = new PreviewDlg(parent); preview = new PreviewDlg(parent);
hovertimer.setInterval(1500); // wait for 1.5 seconds before showing the Fullsize Preview hovertimer.setInterval(1500); // wait for 1.5 seconds before showing the Fullsize Preview
hovertimer.setSingleShot(true); hovertimer.setSingleShot(true);
connect(&hovertimer,SIGNAL(timeout ()),this,SLOT(timeout())); connect(&hovertimer,SIGNAL(timeout ()),this,SLOT(timeout()));
@ -89,11 +89,11 @@ void PreviewLabel::timeout()
preview->setVisible(true); preview->setVisible(true);
} }
void PreviewLabel::setPixmap(QPixmap p) void PreviewLabel::setPixmap(QPixmap p)
{ {
// set the image for the Fullsize Preview // set the image for the Fullsize Preview
preview->setPixmap(p); preview->setPixmap(p);
//scale the image for use in the label //scale the image for use in the label
QSize img; QSize img;
img.setHeight(this->height()); img.setHeight(this->height());

View file

@ -30,27 +30,27 @@ class PreviewDlg : public QDialog
public: public:
PreviewDlg(QWidget *parent = 0); PreviewDlg(QWidget *parent = 0);
void setPixmap(QPixmap p); void setPixmap(QPixmap p);
void setText(QString text); void setText(QString text);
private slots: private slots:
void mouseMoveEvent(QMouseEvent * event); void mouseMoveEvent(QMouseEvent * event);
void leaveEvent(QEvent * event); void leaveEvent(QEvent * event);
private: private:
Ui::PreviewFrm ui; Ui::PreviewFrm ui;
}; };
class PreviewLabel : public QLabel class PreviewLabel : public QLabel
{ {
Q_OBJECT Q_OBJECT
public: public:
PreviewLabel(QWidget * parent = 0, Qt::WindowFlags f = 0); PreviewLabel(QWidget * parent = 0, Qt::WindowFlags f = 0);
void setPixmap(QPixmap p); void setPixmap(QPixmap p);
void setText(QString text); void setText(QString text);
private slots: private slots:
@ -58,7 +58,7 @@ private slots:
void enterEvent(QEvent * event); void enterEvent(QEvent * event);
void leaveEvent(QEvent * event); void leaveEvent(QEvent * event);
void timeout(); void timeout();
private: private:
QTimer hovertimer; QTimer hovertimer;
int mousex; int mousex;

View file

@ -96,7 +96,7 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
connect(ui.buttonDownloadManual, SIGNAL(clicked()), this, SLOT(downloadManual())); connect(ui.buttonDownloadManual, SIGNAL(clicked()), this, SLOT(downloadManual()));
connect(ui.buttonSmall, SIGNAL(clicked()), this, SLOT(smallInstall())); connect(ui.buttonSmall, SIGNAL(clicked()), this, SLOT(smallInstall()));
connect(ui.buttonComplete, SIGNAL(clicked()), this, SLOT(completeInstall())); connect(ui.buttonComplete, SIGNAL(clicked()), this, SLOT(completeInstall()));
#if !defined(STATIC) #if !defined(STATIC)
ui.actionInstall_Rockbox_Utility_on_player->setEnabled(false); ui.actionInstall_Rockbox_Utility_on_player->setEnabled(false);
#else #else
@ -145,7 +145,7 @@ void RbUtilQt::downloadDone(bool error)
return; return;
} }
qDebug() << "network status:" << daily->error(); qDebug() << "network status:" << daily->error();
buildInfo.open(); buildInfo.open();
QSettings info(buildInfo.fileName(), QSettings::IniFormat, this); QSettings info(buildInfo.fileName(), QSettings::IniFormat, this);
buildInfo.close(); buildInfo.close();
@ -195,7 +195,7 @@ void RbUtilQt::about()
Ui::aboutBox about; Ui::aboutBox about;
about.setupUi(window); about.setupUi(window);
window->setModal(true); window->setModal(true);
QFile licence(":/docs/gpl-2.0.html"); QFile licence(":/docs/gpl-2.0.html");
licence.open(QIODevice::ReadOnly); licence.open(QIODevice::ReadOnly);
QTextStream c(&licence); QTextStream c(&licence);
@ -288,7 +288,7 @@ void RbUtilQt::updateManual()
devices->beginGroup(userSettings->value("platform").toString()); devices->beginGroup(userSettings->value("platform").toString());
QString manual; QString manual;
manual = devices->value("manualname", "").toString(); manual = devices->value("manualname", "").toString();
if(manual == "") if(manual == "")
manual = "rockbox-" + devices->value("platform").toString(); manual = "rockbox-" + devices->value("platform").toString();
devices->endGroup(); devices->endGroup();
@ -314,18 +314,18 @@ void RbUtilQt::completeInstall()
if(QMessageBox::question(this, tr("Confirm Installation"), if(QMessageBox::question(this, tr("Confirm Installation"),
tr("Do you really want to make a complete Installation?"), tr("Do you really want to make a complete Installation?"),
QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return; QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return;
// create logger // create logger
logger = new ProgressLoggerGui(this); logger = new ProgressLoggerGui(this);
logger->show(); logger->show();
QString mountpoint = userSettings->value("mountpoint").toString(); QString mountpoint = userSettings->value("mountpoint").toString();
// show dialog with error if mount point is wrong // show dialog with error if mount point is wrong
if(!QFileInfo(mountpoint).isDir()) { if(!QFileInfo(mountpoint).isDir()) {
logger->addItem(tr("Mount point is wrong!"),LOGERROR); logger->addItem(tr("Mount point is wrong!"),LOGERROR);
logger->abort(); logger->abort();
return; return;
} }
// Bootloader // Bootloader
devices->beginGroup(userSettings->value("platform").toString()); devices->beginGroup(userSettings->value("platform").toString());
if(devices->value("needsbootloader", "") == "yes") { if(devices->value("needsbootloader", "") == "yes") {
@ -357,7 +357,7 @@ void RbUtilQt::completeInstall()
} }
if(m_error) return; if(m_error) return;
logger->undoAbort(); logger->undoAbort();
// Fonts // Fonts
m_error = false; m_error = false;
m_installed = false; m_installed = false;
@ -371,7 +371,7 @@ void RbUtilQt::completeInstall()
} }
if(m_error) return; if(m_error) return;
logger->undoAbort(); logger->undoAbort();
// Doom // Doom
if(hasDoom()) if(hasDoom())
{ {
@ -393,7 +393,7 @@ void RbUtilQt::completeInstall()
// it has its own logger window,so close our. // it has its own logger window,so close our.
logger->close(); logger->close();
installThemes(); installThemes();
} }
void RbUtilQt::smallInstall() void RbUtilQt::smallInstall()
@ -401,7 +401,7 @@ void RbUtilQt::smallInstall()
if(QMessageBox::question(this, tr("Confirm Installation"), if(QMessageBox::question(this, tr("Confirm Installation"),
tr("Do you really want to make a small Installation?"), tr("Do you really want to make a small Installation?"),
QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return; QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return;
// create logger // create logger
logger = new ProgressLoggerGui(this); logger = new ProgressLoggerGui(this);
logger->show(); logger->show();
@ -412,7 +412,7 @@ void RbUtilQt::smallInstall()
logger->addItem(tr("Mount point is wrong!"),LOGERROR); logger->addItem(tr("Mount point is wrong!"),LOGERROR);
logger->abort(); logger->abort();
return; return;
} }
// Bootloader // Bootloader
devices->beginGroup(userSettings->value("platform").toString()); devices->beginGroup(userSettings->value("platform").toString());
if(devices->value("needsbootloader", "") == "yes") { if(devices->value("needsbootloader", "") == "yes") {
@ -461,7 +461,7 @@ bool RbUtilQt::installAuto()
QString file = QString("%1%2/rockbox.zip") QString file = QString("%1%2/rockbox.zip")
.arg(devices->value("bleeding_url").toString(), .arg(devices->value("bleeding_url").toString(),
userSettings->value("platform").toString()); userSettings->value("platform").toString());
buildInfo.open(); buildInfo.open();
QSettings info(buildInfo.fileName(), QSettings::IniFormat, this); QSettings info(buildInfo.fileName(), QSettings::IniFormat, this);
buildInfo.close(); buildInfo.close();
@ -475,9 +475,9 @@ bool RbUtilQt::installAuto()
versmap.insert("rel_rev", devices->value("last_release").toString()); versmap.insert("rel_rev", devices->value("last_release").toString());
versmap.insert("rel_date", ""); // FIXME: provide the release timestamp versmap.insert("rel_date", ""); // FIXME: provide the release timestamp
} }
QString myversion = "r" + versmap.value("bleed_rev"); QString myversion = "r" + versmap.value("bleed_rev");
ZipInstaller* installer = new ZipInstaller(this); ZipInstaller* installer = new ZipInstaller(this);
installer->setUrl(file); installer->setUrl(file);
installer->setProxy(proxy()); installer->setProxy(proxy());
@ -487,9 +487,9 @@ bool RbUtilQt::installAuto()
installer->setCache(userSettings->value("cachepath", QDir::tempPath()).toString()); installer->setCache(userSettings->value("cachepath", QDir::tempPath()).toString());
installer->setMountPoint(userSettings->value("mountpoint").toString()); installer->setMountPoint(userSettings->value("mountpoint").toString());
installer->install(logger); installer->install(logger);
connect(installer, SIGNAL(done(bool)), this, SLOT(installdone(bool))); connect(installer, SIGNAL(done(bool)), this, SLOT(installdone(bool)));
return true; return true;
} }
@ -530,23 +530,23 @@ void RbUtilQt::installBootloaderBtn()
if(QMessageBox::question(this, tr("Confirm Installation"), if(QMessageBox::question(this, tr("Confirm Installation"),
tr("Do you really want to install the Bootloader?"), tr("Do you really want to install the Bootloader?"),
QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return; QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return;
// create logger // create logger
logger = new ProgressLoggerGui(this); logger = new ProgressLoggerGui(this);
logger->show(); logger->show();
installBootloader(); installBootloader();
} }
void RbUtilQt::installBootloader() void RbUtilQt::installBootloader()
{ {
QString platform = userSettings->value("platform").toString(); QString platform = userSettings->value("platform").toString();
// create installer // create installer
blinstaller = new BootloaderInstaller(this); blinstaller = new BootloaderInstaller(this);
blinstaller->setMountPoint(userSettings->value("mountpoint").toString()); blinstaller->setMountPoint(userSettings->value("mountpoint").toString());
blinstaller->setProxy(proxy()); blinstaller->setProxy(proxy());
blinstaller->setDevice(platform); blinstaller->setDevice(platform);
blinstaller->setBootloaderMethod(devices->value(platform + "/bootloadermethod").toString()); blinstaller->setBootloaderMethod(devices->value(platform + "/bootloadermethod").toString());
@ -560,7 +560,7 @@ void RbUtilQt::installBootloader()
m_error = true; m_error = true;
return; return;
} }
if(blinstaller->uptodate()) if(blinstaller->uptodate())
{ {
int ret = QMessageBox::question(this, tr("Bootloader Installation"), int ret = QMessageBox::question(this, tr("Bootloader Installation"),
@ -583,7 +583,7 @@ void RbUtilQt::installBootloader()
return; return;
} }
} }
// if fwpatcher , ask for extra file // if fwpatcher , ask for extra file
QString offirmware; QString offirmware;
if(devices->value(platform + "/bootloadermethod").toString() == "fwpatcher") if(devices->value(platform + "/bootloadermethod").toString() == "fwpatcher")
@ -616,7 +616,7 @@ void RbUtilQt::installBootloader()
} }
} }
blinstaller->setOrigFirmwarePath(offirmware); blinstaller->setOrigFirmwarePath(offirmware);
blinstaller->install(logger); blinstaller->install(logger);
} }
@ -642,7 +642,7 @@ void RbUtilQt::installFonts()
{ {
// create zip installer // create zip installer
installer = new ZipInstaller(this); installer = new ZipInstaller(this);
installer->setUrl(devices->value("font_url").toString()); installer->setUrl(devices->value("font_url").toString());
installer->setProxy(proxy()); installer->setProxy(proxy());
installer->setLogSection("Fonts"); installer->setLogSection("Fonts");
@ -650,7 +650,7 @@ void RbUtilQt::installFonts()
installer->setMountPoint(userSettings->value("mountpoint").toString()); installer->setMountPoint(userSettings->value("mountpoint").toString());
if(!userSettings->value("cachedisable").toBool()) if(!userSettings->value("cachedisable").toBool())
installer->setCache(userSettings->value("cachepath", QDir::tempPath()).toString()); installer->setCache(userSettings->value("cachepath", QDir::tempPath()).toString());
installer->install(logger); installer->install(logger);
} }
@ -666,7 +666,7 @@ void RbUtilQt::installVoice()
// create zip installer // create zip installer
installer = new ZipInstaller(this); installer = new ZipInstaller(this);
installer->setUnzip(false); installer->setUnzip(false);
QString voiceurl = devices->value("voice_url").toString() + "/" + QString voiceurl = devices->value("voice_url").toString() + "/" +
userSettings->value("platform").toString() + "-" + userSettings->value("platform").toString() + "-" +
versmap.value("arch_date") + "-english.voice"; versmap.value("arch_date") + "-english.voice";
@ -681,7 +681,7 @@ void RbUtilQt::installVoice()
if(!userSettings->value("cachedisable").toBool()) if(!userSettings->value("cachedisable").toBool())
installer->setCache(userSettings->value("cachepath", QDir::tempPath()).toString()); installer->setCache(userSettings->value("cachepath", QDir::tempPath()).toString());
installer->install(logger); installer->install(logger);
//connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool))); //connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool)));
} }
@ -718,7 +718,7 @@ void RbUtilQt::installDoom()
{ {
// create zip installer // create zip installer
installer = new ZipInstaller(this); installer = new ZipInstaller(this);
installer->setUrl(devices->value("doom_url").toString()); installer->setUrl(devices->value("doom_url").toString());
installer->setProxy(proxy()); installer->setProxy(proxy());
installer->setLogSection("Game Addons"); installer->setLogSection("Game Addons");
@ -767,7 +767,7 @@ void RbUtilQt::uninstallBootloader(void)
// create logger // create logger
ProgressLoggerGui* logger = new ProgressLoggerGui(this); ProgressLoggerGui* logger = new ProgressLoggerGui(this);
logger->show(); logger->show();
QString plattform = userSettings->value("platform").toString(); QString plattform = userSettings->value("platform").toString();
BootloaderInstaller blinstaller(this); BootloaderInstaller blinstaller(this);
blinstaller.setMountPoint(userSettings->value("mountpoint").toString()); blinstaller.setMountPoint(userSettings->value("mountpoint").toString());
@ -782,9 +782,9 @@ void RbUtilQt::uninstallBootloader(void)
logger->abort(); logger->abort();
return; return;
} }
blinstaller.uninstall(logger); blinstaller.uninstall(logger);
} }
@ -795,18 +795,18 @@ void RbUtilQt::downloadManual(void)
"to the root folder of your player."), "to the root folder of your player."),
QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes)
return; return;
buildInfo.open(); buildInfo.open();
QSettings info(buildInfo.fileName(), QSettings::IniFormat, this); QSettings info(buildInfo.fileName(), QSettings::IniFormat, this);
buildInfo.close(); buildInfo.close();
devices->beginGroup(userSettings->value("platform").toString()); devices->beginGroup(userSettings->value("platform").toString());
QString manual; QString manual;
manual = devices->value("manualname", "rockbox-" + devices->value("platform").toString()).toString(); manual = devices->value("manualname", "rockbox-" + devices->value("platform").toString()).toString();
devices->endGroup(); devices->endGroup();
QString date = (info.value("dailies/date").toString()); QString date = (info.value("dailies/date").toString());
QString manualurl; QString manualurl;
QString target; QString target;
QString section; QString section;
@ -872,7 +872,7 @@ void RbUtilQt::installPortable(void)
} }
logger->addItem(tr("Successfully installed Rockbox Utility."), LOGOK); logger->addItem(tr("Successfully installed Rockbox Utility."), LOGOK);
logger->abort(); logger->abort();
} }
@ -913,7 +913,7 @@ void RbUtilQt::updateInfo()
if(log.value(keys.at(b)).toString() < min) if(log.value(keys.at(b)).toString() < min)
min = log.value(keys.at(b)).toString(); min = log.value(keys.at(b)).toString();
} }
for(int b = 0; b < keys.size(); b++) { for(int b = 0; b < keys.size(); b++) {
QString file; QString file;
file = userSettings->value("mountpoint").toString() + "/" + keys.at(b); file = userSettings->value("mountpoint").toString() + "/" + keys.at(b);

View file

@ -56,7 +56,7 @@ class RbUtilQt : public QMainWindow
BootloaderInstaller* blinstaller; BootloaderInstaller* blinstaller;
QUrl proxy(void); QUrl proxy(void);
QMap<QString, QString> versmap; QMap<QString, QString> versmap;
volatile bool m_installed; volatile bool m_installed;
volatile bool m_error; volatile bool m_error;
@ -66,28 +66,28 @@ class RbUtilQt : public QMainWindow
void configDialog(void); void configDialog(void);
void updateDevice(void); void updateDevice(void);
void updateSettings(void); void updateSettings(void);
void completeInstall(void); void completeInstall(void);
void smallInstall(void); void smallInstall(void);
void installdone(bool error); void installdone(bool error);
void installBtn(void); void installBtn(void);
bool installAuto(void); bool installAuto(void);
void install(void); void install(void);
void installBootloaderBtn(void); void installBootloaderBtn(void);
bool installBootloaderAuto(void); bool installBootloaderAuto(void);
void installBootloader(void); void installBootloader(void);
void installFontsBtn(void); void installFontsBtn(void);
bool installFontsAuto(void); bool installFontsAuto(void);
void installFonts(void); void installFonts(void);
bool hasDoom(void); bool hasDoom(void);
void installDoomBtn(void); void installDoomBtn(void);
bool installDoomAuto(void); bool installDoomAuto(void);
void installDoom(void); void installDoom(void);
void createTalkFiles(void); void createTalkFiles(void);
void downloadDone(bool); void downloadDone(bool);
void downloadDone(int, bool); void downloadDone(int, bool);

View file

@ -41,7 +41,7 @@ bool TalkFileCreator::initEncoder()
bool TalkFileCreator::initTTS() bool TalkFileCreator::initTTS()
{ {
QFileInfo tts(m_TTSexec); QFileInfo tts(m_TTSexec);
if(tts.exists()) if(tts.exists())
{ {
return true; return true;
@ -68,14 +68,14 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
return false; return false;
} }
QApplication::processEvents(); QApplication::processEvents();
connect(logger,SIGNAL(aborted()),this,SLOT(abort())); connect(logger,SIGNAL(aborted()),this,SLOT(abort()));
m_logger->setProgressMax(0); m_logger->setProgressMax(0);
QDirIterator it(m_dir,QDirIterator::Subdirectories); QDirIterator it(m_dir,QDirIterator::Subdirectories);
QSettings installlog(m_mountpoint + "/.rockbox/rbutil.log", QSettings::IniFormat, 0); QSettings installlog(m_mountpoint + "/.rockbox/rbutil.log", QSettings::IniFormat, 0);
installlog.beginGroup("talkfiles"); installlog.beginGroup("talkfiles");
// iterate over all entrys // iterate over all entrys
while (it.hasNext()) while (it.hasNext())
{ {
if(m_abort) if(m_abort)
{ {
@ -88,7 +88,7 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
QString toSpeak; QString toSpeak;
QString filename; QString filename;
QString wavfilename; QString wavfilename;
if(fileInf.fileName() == "." || fileInf.fileName() == ".." || fileInf.suffix() == "talk") if(fileInf.fileName() == "." || fileInf.fileName() == ".." || fileInf.suffix() == "talk")
{ {
it.next(); it.next();
@ -108,10 +108,10 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
filename = fileInf.absoluteFilePath() + ".talk"; filename = fileInf.absoluteFilePath() + ".talk";
} }
wavfilename = filename + ".wav"; wavfilename = filename + ".wav";
QFileInfo filenameInf(filename); QFileInfo filenameInf(filename);
QFileInfo wavfilenameInf(wavfilename); QFileInfo wavfilenameInf(wavfilename);
if(!filenameInf.exists() || m_overwriteTalk) if(!filenameInf.exists() || m_overwriteTalk)
{ {
if(!wavfilenameInf.exists() || m_overwriteWav) if(!wavfilenameInf.exists() || m_overwriteWav)
@ -132,7 +132,7 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
return false; return false;
} }
} }
QString now = QDate::currentDate().toString("yyyyMMdd"); QString now = QDate::currentDate().toString("yyyyMMdd");
if(m_removeWav) if(m_removeWav)
{ {
@ -142,18 +142,18 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
} }
else else
installlog.setValue(wavfilename.remove(m_mountpoint),now); installlog.setValue(wavfilename.remove(m_mountpoint),now);
installlog.setValue(filename.remove(m_mountpoint),now); installlog.setValue(filename.remove(m_mountpoint),now);
it.next(); it.next();
} }
installlog.endGroup(); installlog.endGroup();
m_logger->addItem("Finished creating Talkfiles",LOGOK); m_logger->addItem("Finished creating Talkfiles",LOGOK);
m_logger->setProgressMax(1); m_logger->setProgressMax(1);
m_logger->setProgressValue(1); m_logger->setProgressValue(1);
m_logger->abort(); m_logger->abort();
return true; return true;
} }

View file

@ -38,7 +38,7 @@ public:
void setTTsType(QString tts) { m_curTTS = tts; } void setTTsType(QString tts) { m_curTTS = tts; }
void setTTsOpts(QString opts) {m_TTSOpts=opts;} void setTTsOpts(QString opts) {m_TTSOpts=opts;}
void setTTsTemplate(QString t) { m_curTTSTemplate = t; } void setTTsTemplate(QString t) { m_curTTSTemplate = t; }
void setEncType(QString enc) { m_curEnc = enc; } void setEncType(QString enc) { m_curEnc = enc; }
void setEncOpts(QString opts) {m_EncOpts=opts;} void setEncOpts(QString opts) {m_EncOpts=opts;}
void setEncTemplate(QString t) { m_curEncTemplate = t; } void setEncTemplate(QString t) { m_curEncTemplate = t; }
@ -75,15 +75,15 @@ private:
QString m_EncExec; QString m_EncExec;
QString m_EncOpts; QString m_EncOpts;
QString m_curEncTemplate; QString m_curEncTemplate;
bool m_overwriteTalk; bool m_overwriteTalk;
bool m_overwriteWav; bool m_overwriteWav;
bool m_removeWav; bool m_removeWav;
bool m_recursive; bool m_recursive;
bool m_stripExtensions; bool m_stripExtensions;
ProgressloggerInterface* m_logger; ProgressloggerInterface* m_logger;
bool m_abort; bool m_abort;
}; };

View file

@ -16,11 +16,11 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
****************************************************************************/ ****************************************************************************/
#ifndef UNINSTALL_H #ifndef UNINSTALL_H
#define UNINSTALL_H #define UNINSTALL_H
#include <QtGui> #include <QtGui>
@ -28,36 +28,36 @@
#include "progressloggerinterface.h" #include "progressloggerinterface.h"
class Uninstaller : public QObject class Uninstaller : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
Uninstaller(QObject* parent,QString mountpoint) ; Uninstaller(QObject* parent,QString mountpoint) ;
~Uninstaller(){} ~Uninstaller(){}
void deleteAll(ProgressloggerInterface* dp); void deleteAll(ProgressloggerInterface* dp);
void uninstall(ProgressloggerInterface* dp); void uninstall(ProgressloggerInterface* dp);
bool uninstallPossible(); bool uninstallPossible();
QStringList getAllSections(); QStringList getAllSections();
void setSections(QStringList sections) {uninstallSections = sections;} void setSections(QStringList sections) {uninstallSections = sections;}
private slots: private slots:
private: private:
QString m_mountpoint; QString m_mountpoint;
QStringList uninstallSections; QStringList uninstallSections;
ProgressloggerInterface* m_dp; ProgressloggerInterface* m_dp;
}; };
#endif #endif

View file

@ -24,7 +24,7 @@
UninstallWindow::UninstallWindow(QWidget *parent) : QDialog(parent) UninstallWindow::UninstallWindow(QWidget *parent) : QDialog(parent)
{ {
ui.setupUi(this); ui.setupUi(this);
ui.UninstalllistWidget->setAlternatingRowColors(true); ui.UninstalllistWidget->setAlternatingRowColors(true);
connect(ui.UninstalllistWidget,SIGNAL(itemSelectionChanged()),this,SLOT(selectionChanged())); connect(ui.UninstalllistWidget,SIGNAL(itemSelectionChanged()),this,SLOT(selectionChanged()));
connect(ui.CompleteRadioBtn,SIGNAL(toggled(bool)),this,SLOT(UninstallMethodChanged(bool))); connect(ui.CompleteRadioBtn,SIGNAL(toggled(bool)),this,SLOT(UninstallMethodChanged(bool)));
} }
@ -43,7 +43,7 @@ void UninstallWindow::accept()
{ {
uninstaller->uninstall(logger); uninstaller->uninstall(logger);
} }
connect(logger,SIGNAL(closed()),this,SLOT(close())); connect(logger,SIGNAL(closed()),this,SLOT(close()));
} }
@ -55,7 +55,7 @@ void UninstallWindow::selectionChanged()
{ {
seletedStrings << itemlist.at(i)->text(); seletedStrings << itemlist.at(i)->text();
} }
uninstaller->setSections(seletedStrings); uninstaller->setSections(seletedStrings);
} }
@ -64,7 +64,7 @@ void UninstallWindow::UninstallMethodChanged(bool complete)
if(complete) if(complete)
ui.smartGroupBox->setEnabled(false); ui.smartGroupBox->setEnabled(false);
else else
ui.smartGroupBox->setEnabled(true); ui.smartGroupBox->setEnabled(true);
} }
void UninstallWindow::setDeviceSettings(QSettings *dev) void UninstallWindow::setDeviceSettings(QSettings *dev)
@ -77,12 +77,12 @@ void UninstallWindow::setDeviceSettings(QSettings *dev)
void UninstallWindow::setUserSettings(QSettings *user) void UninstallWindow::setUserSettings(QSettings *user)
{ {
userSettings = user; userSettings = user;
QString mountpoint =userSettings->value("mountpoint").toString(); QString mountpoint =userSettings->value("mountpoint").toString();
uninstaller = new Uninstaller(this,mountpoint); uninstaller = new Uninstaller(this,mountpoint);
// disable smart uninstall, if not possible // disable smart uninstall, if not possible
if(!uninstaller->uninstallPossible()) if(!uninstaller->uninstallPossible())
{ {
ui.smartRadioButton->setEnabled(false); ui.smartRadioButton->setEnabled(false);
ui.smartGroupBox->setEnabled(false); ui.smartGroupBox->setEnabled(false);
@ -90,7 +90,7 @@ void UninstallWindow::setUserSettings(QSettings *user)
} }
else // fill in installed parts else // fill in installed parts
{ {
ui.smartRadioButton->setChecked(true); ui.smartRadioButton->setChecked(true);
ui.UninstalllistWidget->addItems(uninstaller->getAllSections()); ui.UninstalllistWidget->addItems(uninstaller->getAllSections());
} }
} }