mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-08 06:16:16 +00:00
More code cleanup.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b28237309a
commit
a6615f67cd
1 changed files with 4 additions and 12 deletions
|
@ -99,11 +99,10 @@ void MainWindow::on_actionNew_triggered()
|
||||||
|
|
||||||
void MainWindow::on_actionOpen_triggered()
|
void MainWindow::on_actionOpen_triggered()
|
||||||
{
|
{
|
||||||
QString lastDir = lastUsedDir();
|
QString filename = QFileDialog::getOpenFileName(this, tr("Open File"), lastUsedDir(), filter());
|
||||||
QString filename = QFileDialog::getOpenFileName(this, tr("Open File"), lastDir, filter());
|
|
||||||
if (filename.isEmpty())
|
if (filename.isEmpty())
|
||||||
return;
|
return;
|
||||||
updateLastUsedDir(filename);
|
updateLastUsedDir(QFileInfo(filename).dir().path());
|
||||||
on_actionClose_triggered();
|
on_actionClose_triggered();
|
||||||
loadFiles( QStringList() << filename );
|
loadFiles( QStringList() << filename );
|
||||||
}
|
}
|
||||||
|
@ -150,12 +149,9 @@ void MainWindow::on_actionClose_triggered()
|
||||||
|
|
||||||
void MainWindow::on_actionImport_triggered()
|
void MainWindow::on_actionImport_triggered()
|
||||||
{
|
{
|
||||||
QString lastDir = lastUsedDir();
|
QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Import Files"), lastUsedDir(), filter());
|
||||||
|
|
||||||
QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Import Files"), lastDir, filter());
|
|
||||||
if (!fileNames.size())
|
if (!fileNames.size())
|
||||||
return; // no selection
|
return; // no selection
|
||||||
|
|
||||||
updateLastUsedDir(QFileInfo(fileNames.at(0)).dir().path());
|
updateLastUsedDir(QFileInfo(fileNames.at(0)).dir().path());
|
||||||
importFiles(fileNames);
|
importFiles(fileNames);
|
||||||
}
|
}
|
||||||
|
@ -181,10 +177,8 @@ void MainWindow::updateLastUsedDir(const QString& dir)
|
||||||
|
|
||||||
void MainWindow::on_actionExportUDDF_triggered()
|
void MainWindow::on_actionExportUDDF_triggered()
|
||||||
{
|
{
|
||||||
QString filename;
|
|
||||||
QFileInfo fi(system_default_filename());
|
QFileInfo fi(system_default_filename());
|
||||||
|
QString filename = QFileDialog::getSaveFileName(this, tr("Save File as"), fi.absolutePath(),
|
||||||
filename = QFileDialog::getSaveFileName(this, tr("Save File as"), fi.absolutePath(),
|
|
||||||
tr("UDDF files (*.uddf *.UDDF)"));
|
tr("UDDF files (*.uddf *.UDDF)"));
|
||||||
if (!filename.isNull() && !filename.isEmpty())
|
if (!filename.isNull() && !filename.isEmpty())
|
||||||
export_dives_uddf((const char *)filename.toStdString().c_str(), false);
|
export_dives_uddf((const char *)filename.toStdString().c_str(), false);
|
||||||
|
@ -228,7 +222,6 @@ void MainWindow::showProfile()
|
||||||
ui.infoPane->setCurrentIndex(MAINTAB);
|
ui.infoPane->setCurrentIndex(MAINTAB);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::on_actionPreferences_triggered()
|
void MainWindow::on_actionPreferences_triggered()
|
||||||
{
|
{
|
||||||
PreferencesDialog::instance()->show();
|
PreferencesDialog::instance()->show();
|
||||||
|
@ -820,7 +813,6 @@ void MainWindow::on_actionImportCSV_triggered()
|
||||||
refreshDisplay();
|
refreshDisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::editCurrentDive()
|
void MainWindow::editCurrentDive()
|
||||||
{
|
{
|
||||||
if(DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING){
|
if(DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING){
|
||||||
|
|
Loading…
Add table
Reference in a new issue