From b052b790dfe1cddccebf1ea52197c6781eeaf775 Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Sun, 29 Dec 2013 18:11:20 +0200 Subject: Refactoring import to DiveLogImportDialog Changing the import stuff to DiveLogImport. Now we should have one import function/dialog for importing divelogs instead of multiple menu entries. Signed-off-by: Miika Turkia Signed-off-by: Dirk Hohndel --- qt-ui/mainwindow.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'qt-ui/mainwindow.cpp') diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index ad52c7d7f..c6e05faa4 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -35,7 +35,7 @@ #include "diveplanner.h" #include "about.h" #include "printdialog.h" -#include "csvimportdialog.h" +#include "divelogimportdialog.h" static MainWindow* instance = 0; @@ -167,15 +167,6 @@ void MainWindow::on_actionClose_triggered() clear_events(); } -void MainWindow::on_actionImport_triggered() -{ - QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Import Files"), lastUsedDir(), filter()); - if (!fileNames.size()) - return; // no selection - updateLastUsedDir(QFileInfo(fileNames.at(0)).dir().path()); - importFiles(fileNames); -} - QString MainWindow::lastUsedDir() { QSettings settings; @@ -864,10 +855,10 @@ void MainWindow::loadFiles(const QStringList fileNames) ui.actionAutoGroup->setChecked(autogroup); } -void MainWindow::on_actionImportCSV_triggered() +void MainWindow::on_actionImportDiveLog_triggered() { - CSVImportDialog *csvImport = new CSVImportDialog(); - csvImport->show(); + DiveLogImportDialog *diveLogImport = new DiveLogImportDialog(); + diveLogImport->show(); process_dives(TRUE, FALSE); refreshDisplay(); } -- cgit v1.2.3-70-g09d2