summaryrefslogtreecommitdiffstats
path: root/qt-ui/subsurfacewebservices.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-15 15:33:04 +0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-15 15:33:04 +0700
commit78cdded90273fe6fd00cdd856fae3e54186c725b (patch)
tree383958bac89cf5c13fd0fcaae94eac876b3e20b5 /qt-ui/subsurfacewebservices.cpp
parent07c116ecd211fc71fb42197a7b6c6e7491c8beb7 (diff)
downloadsubsurface-78cdded90273fe6fd00cdd856fae3e54186c725b.tar.gz
Improve the download from Subsurface webservice dialog
- make the User ID input field wide enough - use the progress bar for an explanatory text - mark it as 100% completed once the download succeeds Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/subsurfacewebservices.cpp')
-rw-r--r--qt-ui/subsurfacewebservices.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp
index 30efbad93..fb437d11f 100644
--- a/qt-ui/subsurfacewebservices.cpp
+++ b/qt-ui/subsurfacewebservices.cpp
@@ -319,6 +319,9 @@ SubsurfaceWebServices::SubsurfaceWebServices(QWidget* parent, Qt::WindowFlags f)
ui.userID->setText(s.value("subsurface_webservice_uid").toString().toUpper());
hidePassword();
hideUpload();
+ ui.progressBar->setFormat("Enter User ID and click Download");
+ ui.progressBar->setRange(0,1);
+ ui.progressBar->setValue(-1);
}
void SubsurfaceWebServices::buttonClicked(QAbstractButton* button)
@@ -370,6 +373,7 @@ void SubsurfaceWebServices::startDownload()
request.setRawHeader("Accept", "text/xml");
reply = manager()->get(request);
ui.status->setText(tr("Connecting..."));
+ ui.progressBar->setEnabled(true);
ui.progressBar->setRange(0,0); // this makes the progressbar do an 'infinite spin'
ui.download->setEnabled(false);
ui.buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
@@ -382,6 +386,8 @@ void SubsurfaceWebServices::downloadFinished()
return;
ui.progressBar->setRange(0,1);
+ ui.progressBar->setValue(1);
+ ui.progressBar->setFormat("%p%");
downloadedData = reply->readAll();
ui.download->setEnabled(true);