mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-20 21:43:20 -06:00
#3911 Ensemble import : Remember separate file path for ensemble
This commit is contained in:
parent
bc86158ff6
commit
f7a7a943d7
@ -63,7 +63,8 @@ bool RicImportEnsembleFeature::isCommandEnabled()
|
||||
void RicImportEnsembleFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
QStringList fileNames = RicImportSummaryCasesFeature::runRecursiveSummaryCaseFileSearchDialog("Import Ensemble");
|
||||
QString pathCacheName = "ENSEMBLE_FILES";
|
||||
QStringList fileNames = RicImportSummaryCasesFeature::runRecursiveSummaryCaseFileSearchDialog("Import Ensemble", pathCacheName);
|
||||
|
||||
if (fileNames.isEmpty()) return;
|
||||
|
||||
|
@ -70,7 +70,8 @@ bool RicImportSummaryCasesFeature::isCommandEnabled()
|
||||
void RicImportSummaryCasesFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
QStringList fileNames = runRecursiveSummaryCaseFileSearchDialog("Import Summary Cases");
|
||||
QString pathCacheName = "INPUT_FILES";
|
||||
QStringList fileNames = runRecursiveSummaryCaseFileSearchDialog("Import Summary Cases", pathCacheName);
|
||||
|
||||
std::vector<RimSummaryCase*> cases;
|
||||
if (!fileNames.isEmpty()) createSummaryCasesFromFiles(fileNames, &cases);
|
||||
@ -217,10 +218,11 @@ void RicImportSummaryCasesFeature::addCasesToGroupIfRelevant(const std::vector<R
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QStringList RicImportSummaryCasesFeature::runRecursiveSummaryCaseFileSearchDialog(const QString& dialogTitle)
|
||||
QStringList RicImportSummaryCasesFeature::runRecursiveSummaryCaseFileSearchDialog(const QString& dialogTitle,
|
||||
const QString& pathCacheName)
|
||||
{
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
QString defaultDir = app->lastUsedDialogDirectory("INPUT_FILES");
|
||||
QString defaultDir = app->lastUsedDialogDirectory(pathCacheName);
|
||||
|
||||
RicFileHierarchyDialogResult result = RicFileHierarchyDialog::runRecursiveSearchDialog(nullptr,
|
||||
dialogTitle,
|
||||
@ -236,7 +238,7 @@ QStringList RicImportSummaryCasesFeature::runRecursiveSummaryCaseFileSearchDialo
|
||||
if (!result.ok) return QStringList();
|
||||
|
||||
// Remember the path to next time
|
||||
app->setLastUsedDialogDirectory("INPUT_FILES", QFileInfo(result.rootDir).absoluteFilePath());
|
||||
app->setLastUsedDialogDirectory(pathCacheName, QFileInfo(result.rootDir).absoluteFilePath());
|
||||
|
||||
return result.files;
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ public:
|
||||
static void addSummaryCases(const std::vector<RimSummaryCase*> cases);
|
||||
static void addCasesToGroupIfRelevant(const std::vector<RimSummaryCase*> cases);
|
||||
|
||||
static QStringList runRecursiveSummaryCaseFileSearchDialog(const QString& dialogTitle);
|
||||
static QStringList runRecursiveSummaryCaseFileSearchDialog(const QString& dialogTitle, const QString& pathCacheName);
|
||||
|
||||
protected:
|
||||
// Overrides
|
||||
|
@ -61,7 +61,8 @@ bool RicImportSummaryGroupFeature::isCommandEnabled()
|
||||
void RicImportSummaryGroupFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
QStringList fileNames = RicImportSummaryCasesFeature::runRecursiveSummaryCaseFileSearchDialog("Import Summary Case Group");
|
||||
QString pathCacheName = "INPUT_FILES";
|
||||
QStringList fileNames = RicImportSummaryCasesFeature::runRecursiveSummaryCaseFileSearchDialog("Import Summary Case Group", pathCacheName);
|
||||
|
||||
if (fileNames.isEmpty()) return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user