diff options
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/downloadfromdivecomputer.cpp | 33 | ||||
-rw-r--r-- | desktop-widgets/downloadfromdivecomputer.ui | 7 |
2 files changed, 38 insertions, 2 deletions
diff --git a/desktop-widgets/downloadfromdivecomputer.cpp b/desktop-widgets/downloadfromdivecomputer.cpp index 5eaee68b7..424cf277a 100644 --- a/desktop-widgets/downloadfromdivecomputer.cpp +++ b/desktop-widgets/downloadfromdivecomputer.cpp @@ -112,11 +112,24 @@ void DownloadFromDCWidget::updateProgressBar() } if (!same_string(progress_bar_text , "")) { ui.progressBar->setFormat(progress_bar_text); +#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)) + if (IS_FP_SAME(progress_bar_fraction, 0.0)) { ui.progressBar->setFormat(tr("Connecting to dive computer")); - else +#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 { ui.progressBar->setFormat("%p%"); +#if defined(Q_OS_MAC) + // on mac the progress bar doesn't show its text + ui.progressText->setText(QString("%1%").arg(lrint(progress_bar_fraction * 100))); +#endif + } } ui.progressBar->setValue(lrint(progress_bar_fraction * 100)); free(last_text); @@ -134,6 +147,10 @@ void DownloadFromDCWidget::updateState(states state) markChildrenAsEnabled(); timer->stop(); progress_bar_text = ""; +#if defined(Q_OS_MAC) + // on mac we show the text in a label + ui.progressText->setText(progress_bar_text); +#endif } // tries to cancel an on going download @@ -156,6 +173,10 @@ void DownloadFromDCWidget::updateState(states state) ui.progressBar->hide(); markChildrenAsEnabled(); progress_bar_text = ""; +#if defined(Q_OS_MAC) + // on mac we show the text in a label + ui.progressText->setText(progress_bar_text); +#endif } // DOWNLOAD is finally done, but we don't know if there was an error as libdivecomputer doesn't pass @@ -173,6 +194,10 @@ void DownloadFromDCWidget::updateState(states state) ui.progressBar->setValue(100); markChildrenAsEnabled(); } +#if defined(Q_OS_MAC) + // on mac we show the text in a label + ui.progressText->setText(progress_bar_text); +#endif } // DOWNLOAD is started. @@ -192,6 +217,10 @@ void DownloadFromDCWidget::updateState(states state) markChildrenAsEnabled(); progress_bar_text = ""; ui.progressBar->hide(); +#if defined(Q_OS_MAC) + // on mac we show the text in a label + ui.progressText->setText(progress_bar_text); +#endif } // properly updating the widget state diff --git a/desktop-widgets/downloadfromdivecomputer.ui b/desktop-widgets/downloadfromdivecomputer.ui index b1f152034..10d654b46 100644 --- a/desktop-widgets/downloadfromdivecomputer.ui +++ b/desktop-widgets/downloadfromdivecomputer.ui @@ -190,6 +190,13 @@ </widget> </item> <item> + <widget class="QLabel" name="progressText"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> <spacer name="aboveOKCancelSpacer"> <property name="orientation"> <enum>Qt::Vertical</enum> |