From ef0e76bc6958e4793b14482f6177d7058cc565ee Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 25 Sep 2018 20:34:25 -0700 Subject: 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 --- desktop-widgets/downloadfromdivecomputer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- cgit v1.2.3-70-g09d2