diff options
| author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2009-03-22 19:56:13 +0000 |
|---|---|---|
| committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2009-03-22 19:56:13 +0000 |
| commit | 694c830121bd36bcdacc4743b38e3068f2e88a21 (patch) | |
| tree | bd167d9f62c7d6b9762dfed56b0794a4709e52f5 | |
| parent | de74a92e3d8119de8b1371dac7c44fa61f683832 (diff) | |
| download | rockbox-694c830121bd36bcdacc4743b38e3068f2e88a21.zip rockbox-694c830121bd36bcdacc4743b38e3068f2e88a21.tar.gz rockbox-694c830121bd36bcdacc4743b38e3068f2e88a21.tar.bz2 rockbox-694c830121bd36bcdacc4743b38e3068f2e88a21.tar.xz | |
Improve error handling for theme preview image:
- if loading the image failed display the HTTP error and clear any old image.
- make sure the first theme on startup always gets its details refreshed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20469 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | rbutil/rbutilqt/installthemes.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/rbutil/rbutilqt/installthemes.cpp b/rbutil/rbutilqt/installthemes.cpp index 7dd7656..5422338 100644 --- a/rbutil/rbutilqt/installthemes.cpp +++ b/rbutil/rbutilqt/installthemes.cpp @@ -32,6 +32,7 @@ ThemesInstallWindow::ThemesInstallWindow(QWidget *parent) : QDialog(parent) ui.listThemes->setSelectionMode(QAbstractItemView::ExtendedSelection); ui.themePreview->clear(); ui.themePreview->setText(tr("no theme selected")); + currentItem = -1; connect(ui.buttonCancel, SIGNAL(clicked()), this, SLOT(close())); connect(ui.buttonOk, SIGNAL(clicked()), this, SLOT(accept())); @@ -51,7 +52,7 @@ void ThemesInstallWindow::downloadInfo() { // try to get the current build information getter = new HttpGet(this); - + qDebug() << "downloading themes info"; themesInfo.open(); qDebug() << "file:" << themesInfo.fileName(); @@ -198,7 +199,12 @@ void ThemesInstallWindow::updateImage(bool error) { qDebug() << "updateImage(bool) =" << error; - if(error) return; + if(error) { + ui.themePreview->clear(); + ui.themePreview->setText(tr("Retrieving theme preview failed.\n" + "HTTP response code: %1").arg(igetter.httpResponse())); + return; + } QPixmap p; if(!error) { |