diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2017-06-17 23:22:37 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-06-17 23:22:37 -0700 |
commit | b2b51c833a2c6f71fe411b5f99ccbf3107ef9677 (patch) | |
tree | db7a3bf3ddb6450a6c4514d684f4b03c9c97f4cf /desktop-widgets/mainwindow.cpp | |
parent | 2d5f023b5811ffde028d5c9b680cd99f9f1448f9 (diff) | |
download | subsurface-b2b51c833a2c6f71fe411b5f99ccbf3107ef9677.tar.gz |
QML UI: redesign the user notification
The old system of cloud access updates with fake percentages just wasn't
helpful. Even worse, it hid a lot important information from the user.
This should be more useful (but it will require that we localize the
messages sent from the git progress notifications and make them more
'user ready').
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/mainwindow.cpp')
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 9df50663e..c8eaecaa2 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -66,16 +66,17 @@ QProgressDialog *progressDialog = NULL; bool progressDialogCanceled = false; -extern "C" int updateProgress(bool reset, const char *text) +extern "C" int updateProgress(const char *text) { - static int percent; - - if (reset) - percent = 0; + static int progress = 0; if (verbose) - qDebug() << "git storage:" << +percent << "% (" << text << ")"; - if (progressDialog) - progressDialog->setValue(percent); + qDebug() << "git storage:" << text; + if (progressDialog) { + progressDialog->setLabelText(text); + progressDialog->setValue(++progress); + if (progress == 100) + progress = 0; // yes this is silly, but we really don't know how long it will take + } qApp->processEvents(); return progressDialogCanceled; } @@ -2015,7 +2016,7 @@ void MainWindow::showProgressBar() progressDialog = new QProgressDialog(tr("Contacting cloud service..."), tr("Cancel"), 0, 100, this); progressDialog->setWindowModality(Qt::WindowModal); - progressDialog->setMinimumDuration(200); + progressDialog->setMinimumDuration(0); progressDialogCanceled = false; connect(progressDialog, SIGNAL(canceled()), this, SLOT(cancelCloudStorageOperation())); } |