diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2018-09-25 20:34:25 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-10-12 08:22:44 -0700 |
commit | ef0e76bc6958e4793b14482f6177d7058cc565ee (patch) | |
tree | 74dcfa02bf22cc7c5f97edefc519a848e6da78d5 /desktop-widgets | |
parent | 497c1248d4672524fc17e012f0fd3d4cb5137c8e (diff) | |
download | subsurface-ef0e76bc6958e4793b14482f6177d7058cc565ee.tar.gz |
Bluetooth: show the user that we are waiting to connect to DC
Previously nothing was shown while we were trying to connect; now we show a busy
indication in the progress bar and ensure that the 'waiting to connect' text is
displayed. The progress bar switches back to showing actual progress once we have
connected and are downloading data.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/downloadfromdivecomputer.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/desktop-widgets/downloadfromdivecomputer.cpp b/desktop-widgets/downloadfromdivecomputer.cpp index b0687bb3a..f55613581 100644 --- a/desktop-widgets/downloadfromdivecomputer.cpp +++ b/desktop-widgets/downloadfromdivecomputer.cpp @@ -170,19 +170,25 @@ void DownloadFromDCWidget::updateProgressBar() progress_bar_text = ""; } if (!empty_string(progress_bar_text)) { + // once the progress bar text is set, setup the maximum so the user sees actual progress ui.progressBar->setFormat(progress_bar_text); + ui.progressBar->setMaximum(100); #if defined(Q_OS_MAC) // on mac the progress bar doesn't show its text ui.progressText->setText(progress_bar_text); #endif } else { if (IS_FP_SAME(progress_bar_fraction, 0.0)) { + // while we are waiting to connect, set the maximum to 0 so we get a busy indication + ui.progressBar->setMaximum(0); ui.progressBar->setFormat(tr("Connecting to dive computer")); #if defined(Q_OS_MAC) // on mac the progress bar doesn't show its text ui.progressText->setText(tr("Connecting to dive computer")); #endif } else { + // we have some progress - reset the maximum so the user sees actual progress + ui.progressBar->setMaximum(100); ui.progressBar->setFormat("%p%"); #if defined(Q_OS_MAC) // on mac the progress bar doesn't show its text |