1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-29 22:06:45 +00:00

improved adjuster widget problem reporting

This commit is contained in:
Marc Zinnschlag 2015-08-06 12:58:52 +02:00
parent b83f9445a9
commit 4fd3097c1c

View file

@ -64,6 +64,7 @@ void CSVDoc::AdjusterWidget::setName (const QString& name, bool addon)
QString message; QString message;
mValid = (!name.isEmpty()); mValid = (!name.isEmpty());
bool warning = false;
if (!mValid) if (!mValid)
{ {
@ -106,13 +107,14 @@ void CSVDoc::AdjusterWidget::setName (const QString& name, bool addon)
{ {
/// \todo add an user setting to make this an error. /// \todo add an user setting to make this an error.
message += "<p>A file with the same name already exists. If you continue, it will be overwritten."; message += "<p>A file with the same name already exists. If you continue, it will be overwritten.";
warning = true;
} }
} }
} }
mMessage->setText (message); mMessage->setText (message);
mIcon->setPixmap (style()->standardIcon ( mIcon->setPixmap (style()->standardIcon (
mValid ? QStyle::SP_MessageBoxInformation : QStyle::SP_MessageBoxWarning). mValid ? (warning ? QStyle::SP_MessageBoxWarning : QStyle::SP_MessageBoxInformation) : QStyle::SP_MessageBoxCritical).
pixmap (QSize (16, 16))); pixmap (QSize (16, 16)));
emit stateChanged (mValid); emit stateChanged (mValid);