From 66ac97d7adf5b47cf1a6cedab7b74fa1dc387558 Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Wed, 29 Apr 2015 22:17:59 +0200 Subject: Display a notification while image hashing is ongoing. Signed-off-by: Robert C. Helling Signed-off-by: Dirk Hohndel --- qt-ui/mainwindow.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'qt-ui/mainwindow.cpp') diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index e22f34035..23f9551f1 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -330,6 +330,7 @@ void learnImageDirs(QStringList dirnames) void MainWindow::on_actionHash_images_triggered() { + QFuture future; QFileDialog dialog(this, tr("Traverse image directories"), lastUsedDir(), filter()); dialog.setFileMode(QFileDialog::Directory); dialog.setViewMode(QFileDialog::Detail); @@ -340,7 +341,10 @@ void MainWindow::on_actionHash_images_triggered() dirnames = dialog.selectedFiles(); if (dirnames.isEmpty()) return; - QtConcurrent::run(learnImageDirs,dirnames); + future = QtConcurrent::run(learnImageDirs,dirnames); + MainWindow::instance()->getNotificationWidget()->showNotification(tr("Scanning images...(this can take a while)"), KMessageWidget::Information); + MainWindow::instance()->getNotificationWidget()->setFuture(future); + } ProfileWidget2 *MainWindow::graphics() const -- cgit v1.2.3-70-g09d2