diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2010-04-01 22:06:49 +0000 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2010-04-01 22:06:49 +0000 |
commit | 0d6828e064eee6c4bdac1dd9e9ce9bf522f9754a (patch) | |
tree | 7c76dd9df809c61b260dfee777b9836e0d04ab93 /rbutil/rbutilqt | |
parent | 44e48393665f5fdb0dbe93fdab5f9b94057ad658 (diff) | |
download | rockbox-0d6828e064eee6c4bdac1dd9e9ce9bf522f9754a.tar.gz rockbox-0d6828e064eee6c4bdac1dd9e9ce9bf522f9754a.zip |
Fix multiple warnings when network is unreachable.
Don't listen to requestFinished() signals for background downloads. The
only information needed is the done() signal. Fixes multiple error
messages popping up on unreachable network.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25430 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt')
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.cpp | 28 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.h | 1 |
2 files changed, 10 insertions, 19 deletions
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp index 739b7f42d0..575b381e3b 100644 --- a/rbutil/rbutilqt/rbutilqt.cpp +++ b/rbutil/rbutilqt/rbutilqt.cpp | |||
@@ -188,7 +188,6 @@ void RbUtilQt::downloadInfo() | |||
188 | // try to get the current build information | 188 | // try to get the current build information |
189 | daily = new HttpGet(this); | 189 | daily = new HttpGet(this); |
190 | connect(daily, SIGNAL(done(bool)), this, SLOT(downloadDone(bool))); | 190 | connect(daily, SIGNAL(done(bool)), this, SLOT(downloadDone(bool))); |
191 | connect(daily, SIGNAL(requestFinished(int, bool)), this, SLOT(downloadDone(int, bool))); | ||
192 | connect(qApp, SIGNAL(lastWindowClosed()), daily, SLOT(abort())); | 191 | connect(qApp, SIGNAL(lastWindowClosed()), daily, SLOT(abort())); |
193 | if(RbSettings::value(RbSettings::CacheOffline).toBool()) | 192 | if(RbSettings::value(RbSettings::CacheOffline).toBool()) |
194 | daily->setCache(true); | 193 | daily->setCache(true); |
@@ -207,7 +206,9 @@ void RbUtilQt::downloadDone(bool error) | |||
207 | qDebug() << "[RbUtil] network error:" << daily->error(); | 206 | qDebug() << "[RbUtil] network error:" << daily->error(); |
208 | ui.statusbar->showMessage(tr("Can't get version information!")); | 207 | ui.statusbar->showMessage(tr("Can't get version information!")); |
209 | QMessageBox::critical(this, tr("Network error"), | 208 | QMessageBox::critical(this, tr("Network error"), |
210 | tr("Can't get version information.")); | 209 | tr("Can't get version information.\n" |
210 | "Network error: %1. Please check your network and proxy settings.") | ||
211 | .arg(daily->errorString())); | ||
211 | return; | 212 | return; |
212 | } | 213 | } |
213 | qDebug() << "[RbUtil] network status:" << daily->error(); | 214 | qDebug() << "[RbUtil] network status:" << daily->error(); |
@@ -217,10 +218,9 @@ void RbUtilQt::downloadDone(bool error) | |||
217 | ServerInfo::readBuildInfo(buildInfo.fileName()); | 218 | ServerInfo::readBuildInfo(buildInfo.fileName()); |
218 | buildInfo.close(); | 219 | buildInfo.close(); |
219 | 220 | ||
220 | //start bleeding info download | 221 | // start bleeding info download |
221 | bleeding = new HttpGet(this); | 222 | bleeding = new HttpGet(this); |
222 | connect(bleeding, SIGNAL(done(bool)), this, SLOT(downloadBleedingDone(bool))); | 223 | connect(bleeding, SIGNAL(done(bool)), this, SLOT(downloadBleedingDone(bool))); |
223 | connect(bleeding, SIGNAL(requestFinished(int, bool)), this, SLOT(downloadDone(int, bool))); | ||
224 | connect(qApp, SIGNAL(lastWindowClosed()), bleeding, SLOT(abort())); | 224 | connect(qApp, SIGNAL(lastWindowClosed()), bleeding, SLOT(abort())); |
225 | if(RbSettings::value(RbSettings::CacheOffline).toBool()) | 225 | if(RbSettings::value(RbSettings::CacheOffline).toBool()) |
226 | bleeding->setCache(true); | 226 | bleeding->setCache(true); |
@@ -235,6 +235,12 @@ void RbUtilQt::downloadBleedingDone(bool error) | |||
235 | { | 235 | { |
236 | if(error) { | 236 | if(error) { |
237 | qDebug() << "[RbUtil] network error:" << bleeding->error(); | 237 | qDebug() << "[RbUtil] network error:" << bleeding->error(); |
238 | ui.statusbar->showMessage(tr("Can't get version information!")); | ||
239 | QMessageBox::critical(this, tr("Network error"), | ||
240 | tr("Can't get version information.\n" | ||
241 | "Network error: %1. Please check your network and proxy settings.") | ||
242 | .arg(bleeding->errorString())); | ||
243 | return; | ||
238 | } | 244 | } |
239 | else { | 245 | else { |
240 | bleedingInfo.open(); | 246 | bleedingInfo.open(); |
@@ -251,19 +257,6 @@ void RbUtilQt::downloadBleedingDone(bool error) | |||
251 | } | 257 | } |
252 | 258 | ||
253 | 259 | ||
254 | void RbUtilQt::downloadDone(int id, bool error) | ||
255 | { | ||
256 | QString errorString; | ||
257 | errorString = tr("Network error: %1. Please check your network and proxy settings.") | ||
258 | .arg(daily->errorString()); | ||
259 | if(error) { | ||
260 | QMessageBox::about(this, "Network Error", errorString); | ||
261 | m_networkerror = daily->errorString(); | ||
262 | } | ||
263 | qDebug() << "[RbUtil] downloadDone:" << id << "error:" << error; | ||
264 | } | ||
265 | |||
266 | |||
267 | void RbUtilQt::about() | 260 | void RbUtilQt::about() |
268 | { | 261 | { |
269 | QDialog *window = new QDialog(this); | 262 | QDialog *window = new QDialog(this); |
@@ -1249,7 +1242,6 @@ void RbUtilQt::checkUpdate(void) | |||
1249 | 1242 | ||
1250 | update = new HttpGet(this); | 1243 | update = new HttpGet(this); |
1251 | connect(update, SIGNAL(done(bool)), this, SLOT(downloadUpdateDone(bool))); | 1244 | connect(update, SIGNAL(done(bool)), this, SLOT(downloadUpdateDone(bool))); |
1252 | connect(update, SIGNAL(requestFinished(int, bool)), this, SLOT(downloadDone(int, bool))); | ||
1253 | connect(qApp, SIGNAL(lastWindowClosed()), update, SLOT(abort())); | 1245 | connect(qApp, SIGNAL(lastWindowClosed()), update, SLOT(abort())); |
1254 | if(RbSettings::value(RbSettings::CacheOffline).toBool()) | 1246 | if(RbSettings::value(RbSettings::CacheOffline).toBool()) |
1255 | update->setCache(true); | 1247 | update->setCache(true); |
diff --git a/rbutil/rbutilqt/rbutilqt.h b/rbutil/rbutilqt/rbutilqt.h index afe8c5fd48..76747bca07 100644 --- a/rbutil/rbutilqt/rbutilqt.h +++ b/rbutil/rbutilqt/rbutilqt.h | |||
@@ -99,7 +99,6 @@ class RbUtilQt : public QMainWindow | |||
99 | void createTalkFiles(void); | 99 | void createTalkFiles(void); |
100 | void createVoiceFile(void); | 100 | void createVoiceFile(void); |
101 | void downloadDone(bool); | 101 | void downloadDone(bool); |
102 | void downloadDone(int, bool); | ||
103 | void downloadBleedingDone(bool); | 102 | void downloadBleedingDone(bool); |
104 | void downloadInfo(void); | 103 | void downloadInfo(void); |
105 | 104 | ||