summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/mainwindow.cpp18
-rw-r--r--qt-ui/mainwindow.h1
-rw-r--r--qt-ui/mainwindow.ui8
3 files changed, 26 insertions, 1 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());
diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h
index 5f4567f76..7514a0938 100644
--- a/qt-ui/mainwindow.h
+++ b/qt-ui/mainwindow.h
@@ -104,6 +104,7 @@ slots:
void on_actionPrint_triggered();
void on_actionPreferences_triggered();
void on_actionQuit_triggered();
+ void on_actionHash_images_triggered();
/* log menu actions */
void on_actionDownloadDC_triggered();
diff --git a/qt-ui/mainwindow.ui b/qt-ui/mainwindow.ui
index b6cd4a358..41a85bf8a 100644
--- a/qt-ui/mainwindow.ui
+++ b/qt-ui/mainwindow.ui
@@ -50,7 +50,7 @@
<x>0</x>
<y>0</y>
<width>861</width>
- <height>25</height>
+ <height>22</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
@@ -67,6 +67,7 @@
<addaction name="actionPrint"/>
<addaction name="actionPreferences"/>
<addaction name="separator"/>
+ <addaction name="actionHash_images"/>
<addaction name="actionConfigure_Dive_Computer"/>
<addaction name="separator"/>
<addaction name="actionRecent1"/>
@@ -690,6 +691,11 @@
<string>Ctrl+Shift+Z</string>
</property>
</action>
+ <action name="actionHash_images">
+ <property name="text">
+ <string>Hash images</string>
+ </property>
+ </action>
</widget>
<customwidgets>
<customwidget>