From 9f5b13c287281a2c433c74a48c74c3e2cae03a04 Mon Sep 17 00:00:00 2001 From: garakmon Date: Sun, 17 May 2020 21:10:31 -0400 Subject: [PATCH] use a more descriptive warning message for the new map dimensions --- forms/newmappopup.ui | 2 +- src/ui/newmappopup.cpp | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/forms/newmappopup.ui b/forms/newmappopup.ui index 3b759041..747c2950 100644 --- a/forms/newmappopup.ui +++ b/forms/newmappopup.ui @@ -314,7 +314,7 @@ - + false diff --git a/src/ui/newmappopup.cpp b/src/ui/newmappopup.cpp index e4369a5b..ef840445 100644 --- a/src/ui/newmappopup.cpp +++ b/src/ui/newmappopup.cpp @@ -47,7 +47,16 @@ bool NewMapPopup::checkNewMapDimensions() { if (numMetatiles > maxMetatiles) { ui->frame_NewMap_Warning->setVisible(true); - ui->label_NewMap_WarningMessage->setText("WARNING: The specified map dimensions are too large."); + //ui->label_NewMap_WarningMessage->setText("WARNING: The specified map dimensions are too large."); + QString errorText = QString("Error: The specified width and height are too large.\n" + "The maximum map width and height is the following: (width + 15) * (height + 14) <= %1\n" + "The specified map width and height was: (%2 + 15) * (%3 + 14) = %4") + .arg(maxMetatiles) + .arg(ui->spinBox_NewMap_Width->value()) + .arg(ui->spinBox_NewMap_Height->value()) + .arg(numMetatiles); + ui->label_NewMap_WarningMessage->setText(errorText); + ui->label_NewMap_WarningMessage->setWordWrap(true); return false; } else { @@ -62,6 +71,8 @@ void NewMapPopup::connectSignals() { ui->spinBox_NewMap_Height->setMinimum(1); ui->spinBox_NewMap_Width->setMaximum(project->getMaxMapWidth()); ui->spinBox_NewMap_Height->setMaximum(project->getMaxMapHeight()); + + ui->toolButton_NewMap_DimensionWarning->setIcon(); //ui->icon_NewMap_WarningIcon->setPixmap(); connect(ui->spinBox_NewMap_Width, QOverload::of(&QSpinBox::valueChanged), [=](int){checkNewMapDimensions();});