From b2b51c833a2c6f71fe411b5f99ccbf3107ef9677 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 17 Jun 2017 23:22:37 -0700 Subject: 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 --- desktop-widgets/mainwindow.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'desktop-widgets') 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())); } -- cgit v1.2.3-70-g09d2