From 2016ab4c96f920efbeecf85dc1dfe188b9356c16 Mon Sep 17 00:00:00 2001 From: Dominik Wenger Date: Tue, 1 Apr 2008 18:02:56 +0000 Subject: rbutil: let rbutil use the new voice.zip files. Also make the download cache working again. (make sure to connect signals before calling getFile() ). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16917 a1c6a512-1295-4272-9138-f99709370657 --- rbutil/rbutilqt/installbootloader.cpp | 22 ++++++++++++++++------ rbutil/rbutilqt/installthemes.cpp | 2 +- rbutil/rbutilqt/installzip.cpp | 5 +++-- rbutil/rbutilqt/rbutilqt.cpp | 20 +++++++++++++++----- rbutil/rbutilqt/rbutilqt.h | 1 + rbutil/rbutilqt/voicefile.cpp | 5 +++-- 6 files changed, 39 insertions(+), 16 deletions(-) diff --git a/rbutil/rbutilqt/installbootloader.cpp b/rbutil/rbutilqt/installbootloader.cpp index c567dcd418..05b7be4e49 100644 --- a/rbutil/rbutilqt/installbootloader.cpp +++ b/rbutil/rbutilqt/installbootloader.cpp @@ -320,11 +320,12 @@ void BootloaderInstaller::gigabeatPrepare() // get the real file. getter = new HttpGet(this); getter->setFile(&downloadFile); - getter->getFile(QUrl(url)); // connect signals from HttpGet connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool))); connect(getter, SIGNAL(dataReadProgress(int, int)), this, SLOT(updateDataReadProgress(int, int))); connect(m_dp, SIGNAL(aborted()), getter, SLOT(abort())); + + getter->getFile(QUrl(url)); } else //UnInstallation { @@ -518,11 +519,12 @@ void BootloaderInstaller::h10Prepare() // get the real file. getter = new HttpGet(this); getter->setFile(&downloadFile); - getter->getFile(QUrl(url)); // connect signals from HttpGet connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool))); connect(getter, SIGNAL(dataReadProgress(int, int)), this, SLOT(updateDataReadProgress(int, int))); connect(m_dp, SIGNAL(aborted()), getter, SLOT(abort())); + + getter->getFile(QUrl(url)); } else // Uninstallation { @@ -670,11 +672,13 @@ void BootloaderInstaller::mrobe100Prepare() // get the real file. getter = new HttpGet(this); getter->setFile(&downloadFile); - getter->getFile(QUrl(url)); + // connect signals from HttpGet connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool))); connect(getter, SIGNAL(dataReadProgress(int, int)), this, SLOT(updateDataReadProgress(int, int))); connect(m_dp, SIGNAL(aborted()), getter, SLOT(abort())); + + getter->getFile(QUrl(url)); } else // Uninstallation { @@ -835,11 +839,13 @@ void BootloaderInstaller::ipodPrepare() // get the real file. getter = new HttpGet(this); getter->setFile(&downloadFile); - getter->getFile(QUrl(url)); + // connect signals from HttpGet connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool))); connect(getter, SIGNAL(dataReadProgress(int, int)), this, SLOT(updateDataReadProgress(int, int))); connect(m_dp, SIGNAL(aborted()), getter, SLOT(abort())); + + getter->getFile(QUrl(url)); } else // Uninstallation { @@ -1077,11 +1083,13 @@ void BootloaderInstaller::sansaPrepare() // get the real file. getter = new HttpGet(this); getter->setFile(&downloadFile); - getter->getFile(QUrl(url)); + // connect signals from HttpGet connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool))); connect(getter, SIGNAL(dataReadProgress(int, int)), this, SLOT(updateDataReadProgress(int, int))); connect(m_dp, SIGNAL(aborted()), getter, SLOT(abort())); + + getter->getFile(QUrl(url)); } else // Uninstallation { @@ -1265,11 +1273,13 @@ void BootloaderInstaller::iriverPrepare() // get the real file. getter = new HttpGet(this); getter->setFile(&downloadFile); - getter->getFile(QUrl(url)); + // connect signals from HttpGet connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool))); connect(getter, SIGNAL(dataReadProgress(int, int)), this, SLOT(updateDataReadProgress(int, int))); connect(m_dp, SIGNAL(aborted()), getter, SLOT(abort())); + + getter->getFile(QUrl(url)); } void BootloaderInstaller::iriverFinish() diff --git a/rbutil/rbutilqt/installthemes.cpp b/rbutil/rbutilqt/installthemes.cpp index 37e2d9ebd7..2d0b1dfcd5 100644 --- a/rbutil/rbutilqt/installthemes.cpp +++ b/rbutil/rbutilqt/installthemes.cpp @@ -183,8 +183,8 @@ void ThemesInstallWindow::updateDetails(int row) } igetter.setCache(infocachedir); } - igetter.getFile(img); connect(&igetter, SIGNAL(done(bool)), this, SLOT(updateImage(bool))); + igetter.getFile(img); } diff --git a/rbutil/rbutilqt/installzip.cpp b/rbutil/rbutilqt/installzip.cpp index 3948e7ea75..880082a86d 100644 --- a/rbutil/rbutilqt/installzip.cpp +++ b/rbutil/rbutilqt/installzip.cpp @@ -90,11 +90,12 @@ void ZipInstaller::installStart() getter->setCache(true); } getter->setFile(downloadFile); - getter->getFile(QUrl(m_url)); - + connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool))); connect(getter, SIGNAL(dataReadProgress(int, int)), this, SLOT(updateDataReadProgress(int, int))); connect(m_dp, SIGNAL(aborted()), getter, SLOT(abort())); + + getter->getFile(QUrl(m_url)); } diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp index 041fafdd60..71415d70eb 100644 --- a/rbutil/rbutilqt/rbutilqt.cpp +++ b/rbutil/rbutilqt/rbutilqt.cpp @@ -55,6 +55,8 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent) settings = new RbSettings(); settings->open(); + m_gotInfo = false; + // manual tab updateSettings(); ui.radioPdf->setChecked(true); @@ -186,6 +188,8 @@ void RbUtilQt::downloadBleedingDone(bool error) versmap.insert("bleed_rev", info.value("bleeding/rev").toString()); versmap.insert("bleed_date", info.value("bleeding/timestamp").toString()); qDebug() << "versmap =" << versmap; + + m_gotInfo = true; } @@ -624,6 +628,14 @@ void RbUtilQt::installFonts() void RbUtilQt::installVoice() { if(chkConfig(true)) return; + + if(m_gotInfo == false) + { + QMessageBox::warning(this, tr("Warning"), + tr("The Application is still downloading Information about new Builds. Please try again shortly.")); + return; + } + if(QMessageBox::question(this, tr("Confirm Installation"), tr("Do you really want to install the voice file?"), QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return; @@ -633,19 +645,17 @@ void RbUtilQt::installVoice() // create zip installer installer = new ZipInstaller(this); - installer->setUnzip(false); - - QString voiceurl = settings->voiceUrl() + "/" ; + + QString voiceurl = settings->voiceUrl(); voiceurl += settings->curVoiceName() + "-" + - versmap.value("arch_date") + "-english.voice"; + versmap.value("arch_date") + "-english.zip"; qDebug() << voiceurl; installer->setUrl(voiceurl); installer->setLogSection("Voice"); installer->setLogVersion(versmap.value("arch_date")); installer->setMountPoint(settings->mountpoint()); - installer->setTarget("/.rockbox/langs/english.voice"); if(!settings->cacheDisabled()) installer->setCache(true); installer->install(logger); diff --git a/rbutil/rbutilqt/rbutilqt.h b/rbutil/rbutilqt/rbutilqt.h index 35dbf0f30e..76d05c1175 100644 --- a/rbutil/rbutilqt/rbutilqt.h +++ b/rbutil/rbutilqt/rbutilqt.h @@ -61,6 +61,7 @@ class RbUtilQt : public QMainWindow volatile bool m_installed; volatile bool m_error; + bool m_gotInfo; private slots: void about(void); diff --git a/rbutil/rbutilqt/voicefile.cpp b/rbutil/rbutilqt/voicefile.cpp index 08b39fdfef..f949839cf1 100644 --- a/rbutil/rbutilqt/voicefile.cpp +++ b/rbutil/rbutilqt/voicefile.cpp @@ -91,11 +91,12 @@ bool VoiceFileCreator::createVoiceFile(ProgressloggerInterface* logger) // get the real file. getter = new HttpGet(this); getter->setFile(downloadFile); - getter->getFile(genlangUrl); - + connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool))); connect(getter, SIGNAL(dataReadProgress(int, int)), this, SLOT(updateDataReadProgress(int, int))); connect(m_logger, SIGNAL(aborted()), getter, SLOT(abort())); + + getter->getFile(genlangUrl); return true; } -- cgit v1.2.3