From 694c830121bd36bcdacc4743b38e3068f2e88a21 Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Sun, 22 Mar 2009 19:56:13 +0000 Subject: 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 --- rbutil/rbutilqt/installthemes.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'rbutil/rbutilqt/installthemes.cpp') diff --git a/rbutil/rbutilqt/installthemes.cpp b/rbutil/rbutilqt/installthemes.cpp index 7dd765627b..5422338dd6 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) { -- cgit v1.2.3