#882 RiaApplication : Renamed to lastUsedDialogDirectory and added currentProjectPath. Use project path as fallback path for LAS export

This commit is contained in:
Magne Sjaastad
2016-09-21 09:46:17 +02:00
parent ae6397c5c6
commit 33abbed1fd
15 changed files with 84 additions and 65 deletions

View File

@@ -50,11 +50,15 @@ void RicExportToLasFileFeature::onActionTriggered(bool isChecked)
std::vector<RimWellLogCurve*> curves = selectedWellLogPlotCurves();
if (curves.size() == 0) return;
QString defaultDir = RiaApplication::instance()->defaultFileDialogDirectory("WELL_LOGS_DIR");
RiaApplication* app = RiaApplication::instance();
QString projectFolder = app->currentProjectPath();
QString defaultDir = RiaApplication::instance()->lastUsedDialogDirectoryWithFallback("WELL_LOGS_DIR", projectFolder);
RicExportToLasFileResampleUi featureUi;
featureUi.exportFolder = defaultDir;
caf::PdmUiPropertyViewDialog propertyDialog(NULL, &featureUi, "Export Curve Data to LAS file(s)", "", QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
propertyDialog.resize(QSize(350, 200));
if (propertyDialog.exec() == QDialog::Accepted &&
!featureUi.exportFolder().isEmpty())
@@ -69,7 +73,7 @@ void RicExportToLasFileFeature::onActionTriggered(bool isChecked)
lasExporter.writeToFolder(featureUi.exportFolder());
// Remember the path to next time
RiaApplication::instance()->setDefaultFileDialogDirectory("WELL_LOGS_DIR", featureUi.exportFolder());
RiaApplication::instance()->setLastUsedDialogDirectory("WELL_LOGS_DIR", featureUi.exportFolder());
}
}