mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-26 23:20:29 -05:00
RiaPreferences: Add option to use recently used folder as default in file dialogs
This commit is contained in:
1 parent
99cf71c538
commit
570fbf111f
3 files changed
+33
-1
No files matched your search
@@ -22,6 +22,7 @@
|
||||
#include "RiaFilePathTools.h"
|
||||
#include "RiaFileSearchTools.h"
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaStdStringTools.h"
|
||||
#include "RiaStringListSerializer.h"
|
||||
|
||||
@@ -234,7 +235,15 @@ RicRecursiveFileSearchDialogResult RicRecursiveFileSearchDialog::runRecursiveSea
|
||||
dialog.m_fileFilterField->setCurrentText( fileNameFilter );
|
||||
dialog.m_fileFilterField->setEditable( true );
|
||||
|
||||
dialog.m_pathFilterField->setCurrentText( QDir::toNativeSeparators( pathFilterText ) );
|
||||
// Use most recently used path from registry (index 1) when preference is enabled, otherwise use constructed fallback (index 0)
|
||||
if ( RiaPreferences::current()->useRecentlyUsedFolderAsDefault() && dialog.m_pathFilterField->count() > 1 )
|
||||
{
|
||||
dialog.m_pathFilterField->setCurrentIndex( 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
dialog.m_pathFilterField->setCurrentText( QDir::toNativeSeparators( pathFilterText ) );
|
||||
}
|
||||
dialog.m_pathFilterField->setEditable( true );
|
||||
|
||||
if ( !fileTypes.empty() )
|
||||
|
||||
Reference in new issue
Block a user