diff -r 9ede9c75cb54 -r 08635b028dcf src/MainWindow.cpp --- a/src/MainWindow.cpp Tue Apr 12 22:33:24 2022 +0200 +++ b/src/MainWindow.cpp Thu Apr 14 21:54:37 2022 +0200 @@ -56,6 +56,7 @@ db = new DataBase(); db->openDataBase(useDevelopOption); + loadSetup(); openWS(useDevelopOption); Acid a; @@ -108,6 +109,32 @@ +void MainWindow::loadSetup() +{ + /* + * Load dedaults from the setup. + */ + QSqlQuery query("SELECT * FROM profile_setup WHERE record='1'"); + query.first(); + my_brewery_name = query.value(1).toString(); + my_logoByteArray = query.value(2).toByteArray(); + my_factor_mashhop = query.value(3).toInt(); + my_factor_fwh = query.value(4).toInt(); + my_factor_pellet = query.value(5).toInt(); + my_factor_plug = query.value(6).toInt(); + my_factor_wethop = query.value(7).toInt(); + my_factor_cryohop = query.value(8).toInt(); + my_ibu_method = query.value(9).toInt(); + my_color_method = query.value(10).toInt(); + my_brix_correction = query.value(11).toDouble(); + my_grain_absorbtion = query.value(12).toDouble(); + my_default_water = query.value(13).toInt(); + my_yeastlab = query.value(14).toString(); + + qDebug() << "loadSetup" << my_brewery_name; +} + + bool MainWindow::openWS(bool develop) { QString server; @@ -575,6 +602,7 @@ delete SetupWindow; setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) ); ui->menuBar->setVisible(true); + loadSetup(); }