#1761 Use eclipse case directory as default path when selecting SourSim file

This commit is contained in:
Bjørnar Grip Fjær 2017-08-11 16:08:21 +02:00
parent 93502706be
commit e6fda31255
3 changed files with 11 additions and 1 deletions

View File

@ -532,6 +532,7 @@ void RimEclipseResultCase::defineEditorAttribute(const caf::PdmFieldHandle* fiel
if (myAttr) if (myAttr)
{ {
myAttr->m_fileSelectionFilter = "SourSim (*.sourres)"; myAttr->m_fileSelectionFilter = "SourSim (*.sourres)";
myAttr->m_defaultPath = QFileInfo(caseFileName()).absolutePath();
} }
} }
} }

View File

@ -154,7 +154,14 @@ void PdmUiFilePathEditor::fileSelectionClicked()
QString defaultPath; QString defaultPath;
if ( m_lineEdit->text().isEmpty()) if ( m_lineEdit->text().isEmpty())
{ {
defaultPath = QDir::homePath(); if (m_attributes.m_defaultPath.isNull())
{
defaultPath = QDir::homePath();
}
else
{
defaultPath = m_attributes.m_defaultPath;
}
} }
else else
{ {

View File

@ -61,6 +61,7 @@ public:
m_selectSaveFileName = false; m_selectSaveFileName = false;
m_fileSelectionFilter = "All files (*.* *)"; m_fileSelectionFilter = "All files (*.* *)";
m_defaultPath = QString();
m_selectDirectory = false; m_selectDirectory = false;
m_appendUiSelectedFolderToText = false; m_appendUiSelectedFolderToText = false;
m_multipleItemSeparator = ';'; m_multipleItemSeparator = ';';
@ -69,6 +70,7 @@ public:
bool m_selectSaveFileName; bool m_selectSaveFileName;
QString m_fileSelectionFilter; QString m_fileSelectionFilter;
QString m_defaultPath;
bool m_selectDirectory; bool m_selectDirectory;
bool m_appendUiSelectedFolderToText; bool m_appendUiSelectedFolderToText;
QChar m_multipleItemSeparator; QChar m_multipleItemSeparator;