Skip to content

Commit

Permalink
save button
Browse files Browse the repository at this point in the history
  • Loading branch information
ftomei committed Dec 17, 2024
1 parent 5b3f9f6 commit 7743a7a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions agrolib/soilWidget/soilWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,15 +616,17 @@ void Crit3DSoilWidget::on_actionParameterRestriction()

void Crit3DSoilWidget::on_actionSave()
{
QString errorStr;
QString soilCodeChanged = QString::fromStdString(mySoil.code);
if (mySoil.code.empty())
return;

QString soilCodeChanged = QString::fromStdString(mySoil.code);
QString msg = "Are you sure you want to save " + soilCodeChanged + " ?";
QMessageBox::StandardButton confirm = QMessageBox::question(nullptr, "Warning", msg, QMessageBox::Yes|QMessageBox::No, QMessageBox::No);
if (confirm == QMessageBox::No)
return;

if (!updateSoilData(dbSoil, soilCodeChanged, mySoil, errorStr))
QString errorStr;
if (! updateSoilData(dbSoil, soilCodeChanged, mySoil, errorStr))
{
QMessageBox::critical(nullptr, "Error in update horizon table!", errorStr);
return;
Expand Down

0 comments on commit 7743a7a

Please sign in to comment.