Skip to content

Commit ee824df

Browse files
committed
Merge branch 'master' of github.com:classmodel/modelgui
2 parents da9f53d + d0d11e0 commit ee824df

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

mainwindow.cpp

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,7 @@ void MainWindow::saveRuns()
10581058
{
10591059
storeFormData();
10601060

1061+
QString casename_in = casename; // Save case name, in case user aborts the save
10611062
QString filename = QFileDialog::getSaveFileName(this, "CLASS - Save session", casename);
10621063

10631064
// Get file name from path, update current casename, set window title
@@ -1069,6 +1070,8 @@ void MainWindow::saveRuns()
10691070
if(!file.open(QFile::WriteOnly | QFile::Truncate))
10701071
{
10711072
std::cout << "Error! Cannot open file! Abort saving..." << std::endl;
1073+
casename = casename_in; // Restore case name
1074+
this->setWindowTitle("CLASS main | " + casename_in); // set window title
10721075
return;
10731076
}
10741077
QTextStream out(&file); // we will serialize the data into the file
@@ -1861,21 +1864,13 @@ void MainWindow::switch_ls(int state)
18611864
ui->soil_properties_group->setEnabled(checkstate);
18621865
ui->advanced_surface_switches_group->setEnabled(checkstate);
18631866

1864-
//ui->input_surfacelayer_z0m->setEnabled(!checkstate);
1865-
//ui->label_surfacelayer_z0m->setEnabled(!checkstate);
1866-
//ui->unitlabel_surfacelayer_z0m->setEnabled(!checkstate);
1867-
//if(checkstate)
1868-
// ui->input_surfacelayer_z0m->setToolTip("If SURFACE is enabled, z0m is set in SURFACE tab");
1869-
//else
1870-
// ui->input_surfacelayer_z0m->setToolTip("roughness length for momentum");
1871-
1872-
//ui->input_surfacelayer_z0h->setEnabled(!checkstate);
1873-
//ui->label_surfacelayer_z0h->setEnabled(!checkstate);
1874-
//ui->unitlabel_surfacelayer_z0h->setEnabled(!checkstate);
1875-
//if(checkstate)
1876-
// ui->input_surfacelayer_z0h->setToolTip("If SURFACE is enabled, z0h is set in SURFACE tab");
1877-
//else
1878-
ui->input_surfacelayer_z0h->setToolTip("roughness length for scalars");
1867+
if(checkstate == false)
1868+
{
1869+
ui->sw_surface_advanced->setCheckState(Qt::Unchecked);
1870+
ui->sw_soil_advanced->setCheckState(Qt::Unchecked);
1871+
}
1872+
1873+
ui->input_surfacelayer_z0h->setToolTip("roughness length for scalars");
18791874

18801875
updateStatusBar();
18811876
}

0 commit comments

Comments
 (0)