mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3107 Hierarchy dialog. Warning to user when invalid chars are detected in file pattern
This commit is contained in:
parent
db08061f98
commit
5151cde6bd
@ -45,6 +45,7 @@
|
||||
#include <QAbstractItemView>
|
||||
#include <QMenu>
|
||||
#include <QTime>
|
||||
#include <QToolTip>
|
||||
|
||||
#include <vector>
|
||||
#include <time.h>
|
||||
@ -569,6 +570,22 @@ void RicFileHierarchyDialog::setOkButtonEnabled(bool enabled)
|
||||
m_buttons->button(QDialogButtonBox::Ok)->setEnabled(enabled);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicFileHierarchyDialog::warningIfInvalidCharacters()
|
||||
{
|
||||
if (m_fileFilter->text().contains(QRegExp("[\\\\/:]")))
|
||||
{
|
||||
QToolTip::showText(m_fileFilter->mapToGlobal(QPoint(0, 0)), "File pattern contains invalid characters");
|
||||
m_effectiveFilter->setText("(Invalid filter)");
|
||||
}
|
||||
else
|
||||
{
|
||||
QToolTip::hideText();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -576,6 +593,7 @@ void RicFileHierarchyDialog::slotFilterChanged(const QString& text)
|
||||
{
|
||||
clearFileList();
|
||||
updateEffectiveFilter();
|
||||
warningIfInvalidCharacters();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -87,6 +87,8 @@ private:
|
||||
|
||||
void setOkButtonEnabled(bool enabled);
|
||||
|
||||
void warningIfInvalidCharacters();
|
||||
|
||||
private slots:
|
||||
void slotFilterChanged(const QString& text);
|
||||
void slotFileListCustomMenuRequested(const QPoint& point);
|
||||
|
Loading…
Reference in New Issue
Block a user