diff options
author | Robert C. Helling <helling@atdotde.de> | 2015-02-26 14:44:27 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-02-27 06:30:49 +0100 |
commit | e6482bbdc8a1359d51c70aaf847d3aac7895b960 (patch) | |
tree | aab14f7043fd1d19d182578e7549f4d9a8da151f /qt-ui/mainwindow.cpp | |
parent | b02bf002a677e45dbaa4d28edadbaafc89a7badc (diff) | |
download | subsurface-e6482bbdc8a1359d51c70aaf847d3aac7895b960.tar.gz |
UI to learn hashes of local image files
This addes a menu entry for the user to select a directory that is recursively
traversed to look for image files and compute the hashes of those images (for
those images to be available to be displayed in dives according to their hash values).
This traversal and hash computation happens in and independend thread and so far
the only feedback to the user is that upon completion the dispayed images are updated.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r-- | qt-ui/mainwindow.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 8c3b44c48..8dcb59c90 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -319,6 +319,24 @@ void MainWindow::on_actionSaveAs_triggered() file_save_as(); } +void MainWindow::on_actionHash_images_triggered() +{ + QFileDialog dialog(this, tr("Traverse image directories"), lastUsedDir(), filter()); + dialog.setFileMode(QFileDialog::Directory); + dialog.setViewMode(QFileDialog::Detail); + dialog.setLabelText(QFileDialog::Accept, tr("Scan")); + dialog.setLabelText(QFileDialog::Reject, tr("Cancel")); + QStringList dirnames; + if (dialog.exec()) + dirnames = dialog.selectedFiles(); + if (dirnames.isEmpty()) + return; + foreach (QString dir, dirnames) { + QtConcurrent::run(learnImages, QDir(dir), 10, false); + } + +} + ProfileWidget2 *MainWindow::graphics() const { return qobject_cast<ProfileWidget2*>(applicationState["Default"].topRight->layout()->itemAt(1)->widget()); |