17 #ifndef QGSNEWNAMEDIALOG_H
18 #define QGSNEWNAMEDIALOG_H
25 #include <QRegularExpression>
50 QgsNewNameDialog(
const QString &source = QString(),
const QString &initial = QString(),
51 const QStringList &extensions = QStringList(),
const QStringList &existing = QStringList(),
52 Qt::CaseSensitivity cs = Qt::CaseSensitive,
53 QWidget *parent
SIP_TRANSFERTHIS =
nullptr, Qt::WindowFlags flags = QgsGuiUtils::ModalDialogFlags );
62 void setHintString(
const QString &hintString );
70 QString hintString()
const;
79 void setOverwriteEnabled(
bool enabled );
94 void setAllowEmptyName(
bool allowed );
109 void setConflictingNameWarning(
const QString &
string );
123 void setRegularExpression(
const QString &expression );
130 QString name()
const;
140 static bool exists(
const QString &name,
const QStringList &extensions,
141 const QStringList &existing, Qt::CaseSensitivity cs = Qt::CaseSensitive );
150 void newNameChanged();
159 Qt::CaseSensitivity mCaseSensitivity = Qt::CaseSensitive;
160 QLabel *mHintLabel =
nullptr;
161 QLineEdit *mLineEdit =
nullptr;
163 QLabel *mNamesLabel =
nullptr;
164 QLabel *mErrorLabel =
nullptr;
167 bool mOverwriteEnabled =
true;
168 bool mAllowEmptyName =
false;
171 QString highlightText(
const QString &text );
172 static QStringList fullNames(
const QString &name,
const QStringList &extensions );
174 static QStringList matching(
const QStringList &newNames,
const QStringList &existingNames,
175 Qt::CaseSensitivity cs = Qt::CaseSensitive );
178 #endif // QGSNEWNAMEDIALOG_H