mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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 <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
646c6ba58b
commit
b052b790df
8 changed files with 93 additions and 59 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue