summaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2013-10-16 22:05:19 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-10-16 12:44:07 -0700
commit4c49670cdba403090067d8b92940b577d16ba550 (patch)
treec6d331e238d934e95e54a05e4967a7eec564784c /qt-ui/mainwindow.cpp
parent80bced4f560047874515536979e3cba1e519e147 (diff)
downloadsubsurface-4c49670cdba403090067d8b92940b577d16ba550.tar.gz
GUI for CSV import
This patch implements GUI for importing CSV log files. One is able to configure what columns contain time, depth and temperature fields. Pre-configured log applications currently included are ADP log viewer and XP5. (Both of these use actually tab as separator, so the field separator currently hard-coded.) [Dirk Hohndel: minor fixes] Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r--qt-ui/mainwindow.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 247cfdf2f..3b56134c1 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -34,6 +34,7 @@
#include "diveplanner.h"
#include "about.h"
#include "printdialog.h"
+#include "csvimportdialog.h"
static MainWindow* instance = 0;
@@ -801,3 +802,17 @@ void MainWindow::loadFiles(const QStringList fileNames)
WSInfoModel *wsim = WSInfoModel::instance();
wsim->updateInfo();
}
+
+void MainWindow::on_actionImportCSV_triggered()
+{
+ CSVImportDialog *csvImport = new(CSVImportDialog);
+ csvImport->show();
+ process_dives(TRUE, FALSE);
+
+ ui.InfoWidget->reload();
+ ui.globe->reload();
+ ui.ListWidget->reload(DiveTripModel::TREE);
+ ui.ListWidget->setFocus();
+ WSInfoModel *wsim = WSInfoModel::instance();
+ wsim->updateInfo();
+}