From 1e4a96d79d076af3c4c6a6609d74a8f3bacd1761 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 14 Sep 2016 09:44:32 +0200 Subject: [PATCH] #821 Remember export path and replace default file name including '/' with '_' --- ApplicationCode/Commands/RicExportToLasFileFeature.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ApplicationCode/Commands/RicExportToLasFileFeature.cpp b/ApplicationCode/Commands/RicExportToLasFileFeature.cpp index 860b99eb0e..46e3951d1d 100644 --- a/ApplicationCode/Commands/RicExportToLasFileFeature.cpp +++ b/ApplicationCode/Commands/RicExportToLasFileFeature.cpp @@ -57,13 +57,17 @@ void RicExportToLasFileFeature::onActionTriggered(bool isChecked) defaultFileName.replace(":", "_"); defaultFileName.replace(";", "_"); defaultFileName.replace(" ", "_"); + defaultFileName.replace("/", "_"); defaultFileName.replace(QRegExp("_+"), "_"); defaultFileName.append(".las"); - QString fileName = QFileDialog::getSaveFileName(RiuMainWindow::instance(), tr("Export Curve Data To LAS File"), QDir(defaultDir).absoluteFilePath(defaultFileName), tr("LAS Files (*.las);;All files(*.*)")); + QString fileName = QFileDialog::getSaveFileName(NULL, tr("Export Curve Data To LAS File"), QDir(defaultDir).absoluteFilePath(defaultFileName), tr("LAS Files (*.las);;All files(*.*)")); if (!fileName.isEmpty()) { RigWellLogFile::exportToLasFile(curve, fileName); + + // Remember the path to next time + RiaApplication::instance()->setDefaultFileDialogDirectory("WELL_LOGS_DIR", QFileInfo(fileName).absolutePath()); } } }