mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge remote-tracking branch 'origin/dev' into pre-proto
This commit is contained in:
@@ -251,4 +251,20 @@ QString Utils::fileExtension(const QString & fileName)
|
||||
return fi.suffix();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool Utils::isStringMatch(const QString& filterString, const QString& value)
|
||||
{
|
||||
if (filterString.isEmpty()) return true;
|
||||
if (filterString.trimmed() == "*")
|
||||
{
|
||||
if (!value.isEmpty()) return true;
|
||||
else return false;
|
||||
}
|
||||
|
||||
QRegExp searcher(filterString, Qt::CaseInsensitive, QRegExp::WildcardUnix);
|
||||
return searcher.exactMatch(value);
|
||||
}
|
||||
|
||||
} // namespace caf
|
||||
|
||||
@@ -66,6 +66,8 @@ public:
|
||||
|
||||
static bool fileExists(const QString& fileName);
|
||||
static QString fileExtension(const QString& fileName);
|
||||
|
||||
static bool isStringMatch(const QString& filterString, const QString& value);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public: // Virtual
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) {}
|
||||
|
||||
/// Method to re-implement to supply option values for a specific field
|
||||
virtual QList<PdmOptionItemInfo>
|
||||
virtual QList<caf::PdmOptionItemInfo>
|
||||
calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) { return QList<PdmOptionItemInfo>(); }
|
||||
|
||||
protected:
|
||||
|
||||
@@ -154,7 +154,14 @@ void PdmUiFilePathEditor::fileSelectionClicked()
|
||||
QString defaultPath;
|
||||
if ( m_lineEdit->text().isEmpty())
|
||||
{
|
||||
defaultPath = QDir::homePath();
|
||||
if (m_attributes.m_defaultPath.isNull())
|
||||
{
|
||||
defaultPath = QDir::homePath();
|
||||
}
|
||||
else
|
||||
{
|
||||
defaultPath = m_attributes.m_defaultPath;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -61,6 +61,7 @@ public:
|
||||
m_selectSaveFileName = false;
|
||||
m_fileSelectionFilter = "All files (*.* *)";
|
||||
|
||||
m_defaultPath = QString();
|
||||
m_selectDirectory = false;
|
||||
m_appendUiSelectedFolderToText = false;
|
||||
m_multipleItemSeparator = ';';
|
||||
@@ -69,6 +70,7 @@ public:
|
||||
bool m_selectSaveFileName;
|
||||
QString m_fileSelectionFilter;
|
||||
|
||||
QString m_defaultPath;
|
||||
bool m_selectDirectory;
|
||||
bool m_appendUiSelectedFolderToText;
|
||||
QChar m_multipleItemSeparator;
|
||||
|
||||
Reference in New Issue
Block a user