src/MainWindow.cpp

Tue, 31 Jan 2023 11:10:14 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Tue, 31 Jan 2023 11:10:14 +0100
changeset 481
8a25dbe682eb
parent 480
94b3def5d778
child 485
83b5c2b3c414
permissions
-rw-r--r--

Added valid flag to the inventory_yeastpack table. Initial false and after record edit set to true. This should prevent the use possible wrong values.

4
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
1 /**
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
2 * MainWindow.cpp is part of bmsapp.
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
3 *
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
4 * bmsapp is free software: you can redistribute it and/or modify
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
5 * it under the terms of the GNU General Public License as published by
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
6 * the Free Software Foundation, either version 3 of the License, or
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
7 * (at your option) any later version.
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
8 *
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
9 * bmsapp is distributed in the hope that it will be useful,
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
12 * GNU General Public License for more details.
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
13 *
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
14 * You should have received a copy of the GNU General Public License
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
16 */
3
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 #include "MainWindow.h"
4
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
18 #include "AboutDialog.h"
81
562ed7d1b74d Added start of the Recipes Tree to select a recipe
Michiel Broek <mbroek@mbse.eu>
parents: 79
diff changeset
19 #include "RecipesTree.h"
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
20 #include "InventorySuppliers.h"
19
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
21 #include "InventoryFermentables.h"
24
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
22 #include "InventoryHops.h"
25
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
23 #include "InventoryYeasts.h"
480
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
24 #include "InventoryYeastPacks.h"
28
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
25 #include "InventoryMiscs.h"
29
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
26 #include "InventoryWaters.h"
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
27 #include "InventoryEquipments.h"
173
8514932b61aa Added menu entry products in production
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
28 #include "ProdInprod.h"
228
c859e8efa470 Added archive products on name.
Michiel Broek <mbroek@mbse.eu>
parents: 173
diff changeset
29 #include "ProdOnName.h"
231
54b5abd46958 Added archive products sorted on code.
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
30 #include "ProdOnCode.h"
234
51aea8b798f0 Add product archive tree by date.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
31 #include "ProdOnDate.h"
232
6d3ba9c44f95 Added the product archives tree by styles.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
32 #include "ProdOnTree.h"
48
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
33 #include "ProfileWaters.h"
49
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
34 #include "ProfileMashs.h"
56
eb6c564192f4 Added styles tables and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
35 #include "ProfileStyles.h"
57
75d11cc05ce4 Added profile fermentation tables and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 56
diff changeset
36 #include "ProfileFerments.h"
310
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
37 #include "MonNodes.h"
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
38 #include "MonFermenters.h"
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
39 #include "MonCO2meters.h"
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
40 #include "MoniSpindels.h"
275
f472f9773782 Added import from xml, equipments and beerstyles.
Michiel Broek <mbroek@mbse.eu>
parents: 254
diff changeset
41 #include "ImportXML.h"
387
7945bf3be1f9 Import brew logs added.
Michiel Broek <mbroek@mbse.eu>
parents: 386
diff changeset
42 #include "ImportBrew.h"
15
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
43 #include "Setup.h"
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents: 49
diff changeset
44 #include "PrinterDialog.h"
3
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
45 #include "../ui/ui_MainWindow.h"
90
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
46 #include "database/database.h"
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
47 #include "config.h"
131
0115b97e8c39 Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
48 #include "global.h"
3
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
49
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
50 #include <QApplication>
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
51 #include <QCloseEvent>
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
52 #include <QDebug>
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
53 #include <QStandardItem>
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
54 #include <QWidget>
65
2ef981980daa Finally found out how to make these databases work on a single main window. And it's dynamic too.
Michiel Broek <mbroek@mbse.eu>
parents: 64
diff changeset
55 #include <QtWidgets/QTableWidget>
2ef981980daa Finally found out how to make these databases work on a single main window. And it's dynamic too.
Michiel Broek <mbroek@mbse.eu>
parents: 64
diff changeset
56 #include <QtWidgets/QGroupBox>
2ef981980daa Finally found out how to make these databases work on a single main window. And it's dynamic too.
Michiel Broek <mbroek@mbse.eu>
parents: 64
diff changeset
57 #include <QtWidgets/QPushButton>
91
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
58 #include <QUrl>
3
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
59
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
60
90
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
61 MainWindow::MainWindow(bool useDevelopOption, bool startConfigOption, QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
3
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
62 {
90
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
63 qDebug() << Q_FUNC_INFO << useDevelopOption << startConfigOption;
4
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
64 ui->setupUi(this);
90
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
65 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
66
90
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
67 readsettings();
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
68 db = new DataBase();
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
69 db->openDataBase(useDevelopOption);
91
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
70
479
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
71 updateDataBase();
133
08635b028dcf Load waters during recipe startup. Started calcWater() function. Load profile_setup record global. The print function uses the globals now too instead of loading from the database.
Michiel Broek <mbroek@mbse.eu>
parents: 131
diff changeset
72 loadSetup();
308
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
73 maintDataBase();
91
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
74 openWS(useDevelopOption);
131
0115b97e8c39 Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
75
357
08f73b616345 Corrected Phosphoric SG value.
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
76 /*
08f73b616345 Corrected Phosphoric SG value.
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
77 * AcidSG are the values at 100% strength.
08f73b616345 Corrected Phosphoric SG value.
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
78 */
131
0115b97e8c39 Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
79 Acid a;
135
e68b27ad8a40 Added dutch translations to the internal acids array. Added slot for calc_acid checkbox. Added more water calculations. The miscs amount fields now have two decimal digits. Show treated waters and good/bad indicators.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
80 a.name_en = "Lactic";
e68b27ad8a40 Added dutch translations to the internal acids array. Added slot for calc_acid checkbox. Added more water calculations. The miscs amount fields now have two decimal digits. Show treated waters and good/bad indicators.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
81 a.name_nl = "Melkzuur";
131
0115b97e8c39 Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
82 a.pK1 = 3.86;
135
e68b27ad8a40 Added dutch translations to the internal acids array. Added slot for calc_acid checkbox. Added more water calculations. The miscs amount fields now have two decimal digits. Show treated waters and good/bad indicators.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
83 a.pK2 = 20.0;
e68b27ad8a40 Added dutch translations to the internal acids array. Added slot for calc_acid checkbox. Added more water calculations. The miscs amount fields now have two decimal digits. Show treated waters and good/bad indicators.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
84 a.pK3 = 20.0;
131
0115b97e8c39 Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
85 a.MolWt = 90.08;
135
e68b27ad8a40 Added dutch translations to the internal acids array. Added slot for calc_acid checkbox. Added more water calculations. The miscs amount fields now have two decimal digits. Show treated waters and good/bad indicators.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
86 a.AcidSG = 1238.0;
e68b27ad8a40 Added dutch translations to the internal acids array. Added slot for calc_acid checkbox. Added more water calculations. The miscs amount fields now have two decimal digits. Show treated waters and good/bad indicators.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
87 a.AcidPrc = 80.0;
131
0115b97e8c39 Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
88 my_acids.append(a);
135
e68b27ad8a40 Added dutch translations to the internal acids array. Added slot for calc_acid checkbox. Added more water calculations. The miscs amount fields now have two decimal digits. Show treated waters and good/bad indicators.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
89 a.name_en = "Hydrochloric";
e68b27ad8a40 Added dutch translations to the internal acids array. Added slot for calc_acid checkbox. Added more water calculations. The miscs amount fields now have two decimal digits. Show treated waters and good/bad indicators.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
90 a.name_nl = "Zoutzuur";
e68b27ad8a40 Added dutch translations to the internal acids array. Added slot for calc_acid checkbox. Added more water calculations. The miscs amount fields now have two decimal digits. Show treated waters and good/bad indicators.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
91 a.pK1 = -7.0;
e68b27ad8a40 Added dutch translations to the internal acids array. Added slot for calc_acid checkbox. Added more water calculations. The miscs amount fields now have two decimal digits. Show treated waters and good/bad indicators.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
92 a.pK2 = 20.0;
e68b27ad8a40 Added dutch translations to the internal acids array. Added slot for calc_acid checkbox. Added more water calculations. The miscs amount fields now have two decimal digits. Show treated waters and good/bad indicators.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
93 a.pK3 = 20.0;
131
0115b97e8c39 Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
94 a.MolWt = 36.46;
135
e68b27ad8a40 Added dutch translations to the internal acids array. Added slot for calc_acid checkbox. Added more water calculations. The miscs amount fields now have two decimal digits. Show treated waters and good/bad indicators.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
95 a.AcidSG = 1497.0;
e68b27ad8a40 Added dutch translations to the internal acids array. Added slot for calc_acid checkbox. Added more water calculations. The miscs amount fields now have two decimal digits. Show treated waters and good/bad indicators.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
96 a.AcidPrc = 28.0;
131
0115b97e8c39 Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
97 my_acids.append(a);
135
e68b27ad8a40 Added dutch translations to the internal acids array. Added slot for calc_acid checkbox. Added more water calculations. The miscs amount fields now have two decimal digits. Show treated waters and good/bad indicators.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
98 a.name_en = "Phosphoric";
e68b27ad8a40 Added dutch translations to the internal acids array. Added slot for calc_acid checkbox. Added more water calculations. The miscs amount fields now have two decimal digits. Show treated waters and good/bad indicators.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
99 a.name_nl = "Fosforzuur";
131
0115b97e8c39 Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
100 a.pK1 = 2.12;
0115b97e8c39 Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
101 a.pK2 = 7.20;
0115b97e8c39 Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
102 a.pK3 = 12.44;
0115b97e8c39 Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
103 a.MolWt = 98.00;
357
08f73b616345 Corrected Phosphoric SG value.
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
104 a.AcidSG = 1773.0;
135
e68b27ad8a40 Added dutch translations to the internal acids array. Added slot for calc_acid checkbox. Added more water calculations. The miscs amount fields now have two decimal digits. Show treated waters and good/bad indicators.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
105 a.AcidPrc = 75.0;
131
0115b97e8c39 Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
106 my_acids.append(a);
135
e68b27ad8a40 Added dutch translations to the internal acids array. Added slot for calc_acid checkbox. Added more water calculations. The miscs amount fields now have two decimal digits. Show treated waters and good/bad indicators.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
107 a.name_en = "Sulfuric";
e68b27ad8a40 Added dutch translations to the internal acids array. Added slot for calc_acid checkbox. Added more water calculations. The miscs amount fields now have two decimal digits. Show treated waters and good/bad indicators.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
108 a.name_nl = "Zwavelzuur";
e68b27ad8a40 Added dutch translations to the internal acids array. Added slot for calc_acid checkbox. Added more water calculations. The miscs amount fields now have two decimal digits. Show treated waters and good/bad indicators.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
109 a.pK1 = -1.0;
131
0115b97e8c39 Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
110 a.pK2 = 1.92;
135
e68b27ad8a40 Added dutch translations to the internal acids array. Added slot for calc_acid checkbox. Added more water calculations. The miscs amount fields now have two decimal digits. Show treated waters and good/bad indicators.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
111 a.pK3 = 20.0;
131
0115b97e8c39 Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
112 a.MolWt = 98.07;
135
e68b27ad8a40 Added dutch translations to the internal acids array. Added slot for calc_acid checkbox. Added more water calculations. The miscs amount fields now have two decimal digits. Show treated waters and good/bad indicators.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
113 a.AcidSG = 1884.0;
e68b27ad8a40 Added dutch translations to the internal acids array. Added slot for calc_acid checkbox. Added more water calculations. The miscs amount fields now have two decimal digits. Show treated waters and good/bad indicators.
Michiel Broek <mbroek@mbse.eu>
parents: 133
diff changeset
114 a.AcidPrc = 93.0;
131
0115b97e8c39 Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
115 my_acids.append(a);
3
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
116 }
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
117
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
118
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
119 MainWindow::~MainWindow()
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
120 {
90
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
121 writesettings();
91
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
122 webSocket->close(QWebSocketProtocol::CloseCodeNormal, "");
90
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
123 db->closeDataBase();
4
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
124 delete ui;
3
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
125 }
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
126
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
127
133
08635b028dcf Load waters during recipe startup. Started calcWater() function. Load profile_setup record global. The print function uses the globals now too instead of loading from the database.
Michiel Broek <mbroek@mbse.eu>
parents: 131
diff changeset
128 void MainWindow::loadSetup()
08635b028dcf Load waters during recipe startup. Started calcWater() function. Load profile_setup record global. The print function uses the globals now too instead of loading from the database.
Michiel Broek <mbroek@mbse.eu>
parents: 131
diff changeset
129 {
08635b028dcf Load waters during recipe startup. Started calcWater() function. Load profile_setup record global. The print function uses the globals now too instead of loading from the database.
Michiel Broek <mbroek@mbse.eu>
parents: 131
diff changeset
130 /*
08635b028dcf Load waters during recipe startup. Started calcWater() function. Load profile_setup record global. The print function uses the globals now too instead of loading from the database.
Michiel Broek <mbroek@mbse.eu>
parents: 131
diff changeset
131 * Load dedaults from the setup.
08635b028dcf Load waters during recipe startup. Started calcWater() function. Load profile_setup record global. The print function uses the globals now too instead of loading from the database.
Michiel Broek <mbroek@mbse.eu>
parents: 131
diff changeset
132 */
08635b028dcf Load waters during recipe startup. Started calcWater() function. Load profile_setup record global. The print function uses the globals now too instead of loading from the database.
Michiel Broek <mbroek@mbse.eu>
parents: 131
diff changeset
133 QSqlQuery query("SELECT * FROM profile_setup WHERE record='1'");
08635b028dcf Load waters during recipe startup. Started calcWater() function. Load profile_setup record global. The print function uses the globals now too instead of loading from the database.
Michiel Broek <mbroek@mbse.eu>
parents: 131
diff changeset
134 query.first();
337
8133cdb19aa1 Added my_height global variable and edit in profile setup. This sets the height of the brewery above or below sealevel. Added calculations for the air pressure, boilpoint and IBU_reduction that all depend on the height. Currently not yet in use. Split out the real IBU calculation from the generic toIBU function. This has no effect on the results.
Michiel Broek <mbroek@mbse.eu>
parents: 332
diff changeset
135 my_brewery_name = query.value("brewery_name").toString();
8133cdb19aa1 Added my_height global variable and edit in profile setup. This sets the height of the brewery above or below sealevel. Added calculations for the air pressure, boilpoint and IBU_reduction that all depend on the height. Currently not yet in use. Split out the real IBU calculation from the generic toIBU function. This has no effect on the results.
Michiel Broek <mbroek@mbse.eu>
parents: 332
diff changeset
136 my_logoByteArray = query.value("brewery_logo").toByteArray();
8133cdb19aa1 Added my_height global variable and edit in profile setup. This sets the height of the brewery above or below sealevel. Added calculations for the air pressure, boilpoint and IBU_reduction that all depend on the height. Currently not yet in use. Split out the real IBU calculation from the generic toIBU function. This has no effect on the results.
Michiel Broek <mbroek@mbse.eu>
parents: 332
diff changeset
137 my_factor_mashhop = query.value("factor_mashhop").toInt();
8133cdb19aa1 Added my_height global variable and edit in profile setup. This sets the height of the brewery above or below sealevel. Added calculations for the air pressure, boilpoint and IBU_reduction that all depend on the height. Currently not yet in use. Split out the real IBU calculation from the generic toIBU function. This has no effect on the results.
Michiel Broek <mbroek@mbse.eu>
parents: 332
diff changeset
138 my_factor_fwh = query.value("factor_fwh").toInt();
380
8f5c03ed4321 Global setup added hop utilisation defaults, these are used by the hops editor. In the hops editor, changing the hop form sets the new default utilisation. Hide and show the time edit entry instead of setting it read-only. The new defaults are loaded at program startup. Changed the global setup for the new utilisation fields and dropped the obsolete factor fields. The toIBU formula doesn't use my_factor_* variables anymore, hop differences now come from the utilisation field per hop. The global database is updated to the new defaults.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
139 my_ut_pellet = query.value("ut_pellet").toDouble();
8f5c03ed4321 Global setup added hop utilisation defaults, these are used by the hops editor. In the hops editor, changing the hop form sets the new default utilisation. Hide and show the time edit entry instead of setting it read-only. The new defaults are loaded at program startup. Changed the global setup for the new utilisation fields and dropped the obsolete factor fields. The toIBU formula doesn't use my_factor_* variables anymore, hop differences now come from the utilisation field per hop. The global database is updated to the new defaults.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
140 my_ut_plug = query.value("ut_plug").toDouble();
8f5c03ed4321 Global setup added hop utilisation defaults, these are used by the hops editor. In the hops editor, changing the hop form sets the new default utilisation. Hide and show the time edit entry instead of setting it read-only. The new defaults are loaded at program startup. Changed the global setup for the new utilisation fields and dropped the obsolete factor fields. The toIBU formula doesn't use my_factor_* variables anymore, hop differences now come from the utilisation field per hop. The global database is updated to the new defaults.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
141 my_ut_leaf = query.value("ut_leaf").toDouble();
8f5c03ed4321 Global setup added hop utilisation defaults, these are used by the hops editor. In the hops editor, changing the hop form sets the new default utilisation. Hide and show the time edit entry instead of setting it read-only. The new defaults are loaded at program startup. Changed the global setup for the new utilisation fields and dropped the obsolete factor fields. The toIBU formula doesn't use my_factor_* variables anymore, hop differences now come from the utilisation field per hop. The global database is updated to the new defaults.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
142 my_ut_wethop = query.value("ut_wethop").toDouble();
8f5c03ed4321 Global setup added hop utilisation defaults, these are used by the hops editor. In the hops editor, changing the hop form sets the new default utilisation. Hide and show the time edit entry instead of setting it read-only. The new defaults are loaded at program startup. Changed the global setup for the new utilisation fields and dropped the obsolete factor fields. The toIBU formula doesn't use my_factor_* variables anymore, hop differences now come from the utilisation field per hop. The global database is updated to the new defaults.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
143 my_ut_t45 = query.value("ut_t45").toDouble();
8f5c03ed4321 Global setup added hop utilisation defaults, these are used by the hops editor. In the hops editor, changing the hop form sets the new default utilisation. Hide and show the time edit entry instead of setting it read-only. The new defaults are loaded at program startup. Changed the global setup for the new utilisation fields and dropped the obsolete factor fields. The toIBU formula doesn't use my_factor_* variables anymore, hop differences now come from the utilisation field per hop. The global database is updated to the new defaults.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
144 my_ut_co2extract = query.value("ut_co2extract").toDouble();
430
ef2638cfc1b7 Added five hop absorption fields to the profile_setup record to set the hop absorption rates. Added edit fields in the global setup. Load global these new variables during application startup.
Michiel Broek <mbroek@mbse.eu>
parents: 411
diff changeset
145 my_ha_pellet = query.value("ha_pellet").toDouble();
ef2638cfc1b7 Added five hop absorption fields to the profile_setup record to set the hop absorption rates. Added edit fields in the global setup. Load global these new variables during application startup.
Michiel Broek <mbroek@mbse.eu>
parents: 411
diff changeset
146 my_ha_plug = query.value("ha_plug").toDouble();
ef2638cfc1b7 Added five hop absorption fields to the profile_setup record to set the hop absorption rates. Added edit fields in the global setup. Load global these new variables during application startup.
Michiel Broek <mbroek@mbse.eu>
parents: 411
diff changeset
147 my_ha_leaf = query.value("ha_leaf").toDouble();
ef2638cfc1b7 Added five hop absorption fields to the profile_setup record to set the hop absorption rates. Added edit fields in the global setup. Load global these new variables during application startup.
Michiel Broek <mbroek@mbse.eu>
parents: 411
diff changeset
148 my_ha_wethop = query.value("ha_wethop").toDouble();
ef2638cfc1b7 Added five hop absorption fields to the profile_setup record to set the hop absorption rates. Added edit fields in the global setup. Load global these new variables during application startup.
Michiel Broek <mbroek@mbse.eu>
parents: 411
diff changeset
149 my_ha_t45 = query.value("ha_t45").toDouble();
337
8133cdb19aa1 Added my_height global variable and edit in profile setup. This sets the height of the brewery above or below sealevel. Added calculations for the air pressure, boilpoint and IBU_reduction that all depend on the height. Currently not yet in use. Split out the real IBU calculation from the generic toIBU function. This has no effect on the results.
Michiel Broek <mbroek@mbse.eu>
parents: 332
diff changeset
150 my_ibu_method = query.value("ibu_method").toInt();
8133cdb19aa1 Added my_height global variable and edit in profile setup. This sets the height of the brewery above or below sealevel. Added calculations for the air pressure, boilpoint and IBU_reduction that all depend on the height. Currently not yet in use. Split out the real IBU calculation from the generic toIBU function. This has no effect on the results.
Michiel Broek <mbroek@mbse.eu>
parents: 332
diff changeset
151 my_color_method = query.value("color_method").toInt();
8133cdb19aa1 Added my_height global variable and edit in profile setup. This sets the height of the brewery above or below sealevel. Added calculations for the air pressure, boilpoint and IBU_reduction that all depend on the height. Currently not yet in use. Split out the real IBU calculation from the generic toIBU function. This has no effect on the results.
Michiel Broek <mbroek@mbse.eu>
parents: 332
diff changeset
152 my_brix_correction = query.value("brix_correction").toDouble();
411
c78f8cf11849 Fixed spelling error
Michiel Broek <mbroek@mbse.eu>
parents: 387
diff changeset
153 my_grain_absorption = query.value("grain_absorption").toDouble();
337
8133cdb19aa1 Added my_height global variable and edit in profile setup. This sets the height of the brewery above or below sealevel. Added calculations for the air pressure, boilpoint and IBU_reduction that all depend on the height. Currently not yet in use. Split out the real IBU calculation from the generic toIBU function. This has no effect on the results.
Michiel Broek <mbroek@mbse.eu>
parents: 332
diff changeset
154 my_default_water = query.value("default_water").toInt();
8133cdb19aa1 Added my_height global variable and edit in profile setup. This sets the height of the brewery above or below sealevel. Added calculations for the air pressure, boilpoint and IBU_reduction that all depend on the height. Currently not yet in use. Split out the real IBU calculation from the generic toIBU function. This has no effect on the results.
Michiel Broek <mbroek@mbse.eu>
parents: 332
diff changeset
155 my_yeastlab = query.value("my_yeastlab").toString();
8133cdb19aa1 Added my_height global variable and edit in profile setup. This sets the height of the brewery above or below sealevel. Added calculations for the air pressure, boilpoint and IBU_reduction that all depend on the height. Currently not yet in use. Split out the real IBU calculation from the generic toIBU function. This has no effect on the results.
Michiel Broek <mbroek@mbse.eu>
parents: 332
diff changeset
156 my_height = query.value("brewery_height").toInt();
133
08635b028dcf Load waters during recipe startup. Started calcWater() function. Load profile_setup record global. The print function uses the globals now too instead of loading from the database.
Michiel Broek <mbroek@mbse.eu>
parents: 131
diff changeset
157
254
b0adda0053c5 Installed MessageHandler for logging
Michiel Broek <mbroek@mbse.eu>
parents: 234
diff changeset
158 qInfo() << "loadSetup" << my_brewery_name;
133
08635b028dcf Load waters during recipe startup. Started calcWater() function. Load profile_setup record global. The print function uses the globals now too instead of loading from the database.
Michiel Broek <mbroek@mbse.eu>
parents: 131
diff changeset
159 }
08635b028dcf Load waters during recipe startup. Started calcWater() function. Load profile_setup record global. The print function uses the globals now too instead of loading from the database.
Michiel Broek <mbroek@mbse.eu>
parents: 131
diff changeset
160
08635b028dcf Load waters during recipe startup. Started calcWater() function. Load profile_setup record global. The print function uses the globals now too instead of loading from the database.
Michiel Broek <mbroek@mbse.eu>
parents: 131
diff changeset
161
308
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
162 /*
479
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
163 * Upgrade database. Check and do upgrades.
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
164 */
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
165 void MainWindow::updateDataBase()
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
166 {
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
167 QSqlQuery query1, query2, query3, query4;
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
168 int count = 0;
480
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
169 bool added_packs = false;
479
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
170
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
171 qDebug() << "updateDatabase() start";
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
172
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
173 /*
480
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
174 * Version 0.4.0.
479
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
175 * Make sure we have the inventory_yeastpack with initial records.
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
176 */
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
177 query1.exec("CREATE TABLE IF NOT EXISTS `inventory_yeastpack` ("
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
178 "`record` int(11) NOT NULL AUTO_INCREMENT,"
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
179 "`uuid` varchar(36) NOT NULL,"
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
180 "`laboratory` varchar(128) NOT NULL,"
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
181 "`form` tinyint(4) NOT NULL DEFAULT 0,"
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
182 "`package` varchar(128) NOT NULL,"
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
183 "`notes` text DEFAULT NULL,"
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
184 "`cells` double NOT NULL DEFAULT 0,"
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
185 "`viability` double NOT NULL DEFAULT 0.99,"
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
186 "`max` tinyint(4) NOT NULL DEFAULT 100,"
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
187 "`size` float NOT NULL DEFAULT 0,"
480
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
188 "`used` int(11) NOT NULL DEFAULT 0,"
481
8a25dbe682eb Added valid flag to the inventory_yeastpack table. Initial false and after record edit set to true. This should prevent the use possible wrong values.
Michiel Broek <mbroek@mbse.eu>
parents: 480
diff changeset
189 "`valid` tinyint(1) NOT NULL DEFAULT 0,"
479
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
190 "PRIMARY KEY (`record`),"
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
191 "UNIQUE KEY `uuid` (`uuid`),"
480
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
192 "UNIQUE KEY `package` (`laboratory`,`form`,`package`),"
479
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
193 "KEY `lab_form` (`laboratory`,`form`) USING BTREE"
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
194 ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Yeast packages data'");
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
195 if (query1.lastError().isValid()) {
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
196 qWarning() << " create inventory_yeastpack" << query1.lastError();
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
197 } else {
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
198 query1.exec("SELECT DISTINCT laboratory,form FROM inventory_yeasts");
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
199 while (query1.next()) {
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
200 query2.prepare("SELECT record FROM inventory_yeastpack WHERE laboratory=:laboratory AND form=:form");
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
201 query2.bindValue(":laboratory", query1.value("laboratory").toString());
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
202 query2.bindValue(":form", query1.value("form").toInt());
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
203 query2.exec();
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
204 if (! query2.first()) {
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
205 qDebug() << " add yeastpack" << query1.value("laboratory").toString() << query1.value("form").toInt();
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
206
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
207 query3.prepare("SELECT record,cells FROM inventory_yeasts WHERE laboratory=:laboratory AND form=:form");
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
208 query3.bindValue(":laboratory", query1.value("laboratory").toString());
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
209 query3.bindValue(":form", query1.value("form").toInt());
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
210 query3.exec();
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
211 query3.first();
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
212 /* Should succeed */
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
213
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
214 query4.prepare("INSERT INTO inventory_yeastpack SET uuid=:uuid, laboratory=:laboratory, "
480
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
215 "form=:form, package=:package, cells=:cells, viability=:viability, max=:max");
479
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
216 query4.bindValue(":uuid", QUuid::createUuid().toString().mid(1, 36));
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
217 query4.bindValue(":laboratory", query1.value("laboratory").toString());
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
218 query4.bindValue(":form", query1.value("form").toInt());
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
219 query4.bindValue(":package", g_yeast_forms[query1.value("form").toInt()]);
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
220 query4.bindValue(":cells", query3.value("cells").toDouble());
480
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
221 switch (query1.value("form").toInt()) {
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
222 case YEAST_FORMS_LIQUID: query4.bindValue(":viability", 0.80);
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
223 query4.bindValue(":max", 97);
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
224 break;
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
225 case YEAST_FORMS_DRY: query4.bindValue(":viability", 0.998);
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
226 query4.bindValue(":max", 100);
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
227 break;
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
228 case YEAST_FORMS_DRIED: query4.bindValue(":viability", 0.92);
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
229 query4.bindValue(":max", 100);
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
230 break;
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
231 default: query4.bindValue(":viability", 0.99);
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
232 query4.bindValue(":max", 97);
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
233 }
479
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
234 query4.exec();
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
235 if (query4.lastError().isValid()) {
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
236 qWarning() << " add yeastpack" << query4.lastError();
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
237 } else {
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
238 count++;
480
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
239 added_packs = true;
479
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
240 }
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
241 }
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
242 }
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
243 }
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
244
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
245 qDebug() << "updateDatabase()" << count << "updates";
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
246 }
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
247
28f0e43e9f08 Version 0.4.0. Added database upgrade procedure on startup. Make sure inventory_yeastpack database is created and has default entries. This will become a table with data for different yeast packs.
Michiel Broek <mbroek@mbse.eu>
parents: 465
diff changeset
248
308
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
249 void MainWindow::maintDataBase()
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
250 {
480
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
251 QSqlQuery query, query1;
308
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
252
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
253 /*
480
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
254 * On the server where bmsd runs, there is a crontask.php that does these checks
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
255 * too. Here we do some of the same commands so that we have the results sooner.
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
256 * Currently this takes 6 to 9 mSecs.
308
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
257 */
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
258 query.exec("UPDATE products SET package_volume = bottle_amount + keg_amount WHERE package_volume='0'");
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
259 if (query.numRowsAffected())
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
260 qInfo() << "Updated" << query.numRowsAffected() << "products to new package_volume value";
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
261 query.exec("UPDATE products SET bottle_priming_water = bottle_amount * bottle_priming_amount / 500 WHERE bottle_priming_water = 0");
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
262 if (query.numRowsAffected())
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
263 qInfo() << "Updated" << query.numRowsAffected() << "products to new bottle_priming_water";
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
264 query.exec("UPDATE products SET keg_priming_water = keg_amount * keg_priming_amount / 500 WHERE keg_priming_water = 0");
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
265 if (query.numRowsAffected())
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
266 qInfo() << "Updated" << query.numRowsAffected() << "products to new keg_priming_water";
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
267
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
268 /*
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
269 * Upgrade inventory_reduced value from old boolean to tiny integer value.
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
270 */
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
271 query.exec("UPDATE products SET inventory_reduced=stage WHERE inventory_reduced = 1");
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
272 if (query.numRowsAffected())
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
273 qInfo() << "Updated" << query.numRowsAffected() << "products to new inventory_reduced value";
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
274
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
275 /*
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
276 * Update stages after packaging depending on the age.
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
277 */
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
278 query.exec("UPDATE products SET stage=7 WHERE stage = 6 AND DATEDIFF(CURDATE(), package_date) > 0");
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
279 if (query.numRowsAffected())
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
280 qInfo() << "Updated" << query.numRowsAffected() << "products to stage 7 (Carbonation)";
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
281 query.exec("UPDATE products SET stage=8 WHERE stage = 7 AND DATEDIFF(CURDATE(), package_date) > 13");
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
282 if (query.numRowsAffected())
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
283 qInfo() << "Updated" << query.numRowsAffected() << "products to stage 8 (Mature)";
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
284 query.exec("UPDATE products SET stage=9 WHERE stage = 8 AND DATEDIFF(CURDATE(), package_date) > 41");
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
285 if (query.numRowsAffected())
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
286 qInfo() << "Updated" << query.numRowsAffected() << "products to stage 9 (Taste)";
480
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
287
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
288 /*
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
289 * Count and update references in inventory_yeastpack to inventory_yeasts
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
290 */
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
291 query.exec("SELECT laboratory,form FROM inventory_yeastpack");
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
292 while (query.next()) {
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
293 query1.prepare("SELECT COUNT(*) FROM inventory_yeasts WHERE laboratory=:laboratory AND form=:form");
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
294 query1.bindValue(":laboratory", query.value("laboratory").toString());
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
295 query1.bindValue(":form", query.value("form").toInt());
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
296 query1.exec();
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
297 if (! query1.first()) {
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
298 qWarning() << "SELECT COUNT(*) FROM inventory_yeasts";
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
299 } else {
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
300 int count = query1.value("COUNT(*)").toInt();
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
301 query1.prepare("UPDATE inventory_yeastpack SET used=:used WHERE laboratory=:laboratory AND form=:form");
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
302 query1.bindValue(":used", count);
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
303 query1.bindValue(":laboratory", query.value("laboratory").toString());
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
304 query1.bindValue(":form", query.value("form").toInt());
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
305 query1.exec();
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
306 }
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
307 }
308
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
308 }
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
309
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
310
91
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
311 bool MainWindow::openWS(bool develop)
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
312 {
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
313 QString server;
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
314 if (develop)
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
315 server = wsDev.host;
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
316 else
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
317 server = wsProd.host;
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
318 QUrl url(QString("ws://%1/ws").arg(server));
254
b0adda0053c5 Installed MessageHandler for logging
Michiel Broek <mbroek@mbse.eu>
parents: 234
diff changeset
319 qInfo() << "Open websocket:" << url;
91
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
320
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
321 webSocket = new QWebSocket;
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
322 QObject::connect(webSocket, &QWebSocket::connected, this, &MainWindow::wsConnected);
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
323 QObject::connect(webSocket, &QWebSocket::disconnected, this, &MainWindow::wsClosed);
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
324
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
325 webSocket->open(QUrl(url));
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
326 return true;
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
327 }
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
328
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
329
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
330 void MainWindow::wsConnected()
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
331 {
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
332 qDebug() << Q_FUNC_INFO;
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
333
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
334 connect(webSocket, &QWebSocket::textMessageReceived, this, &MainWindow::wsTextMessageReceived);
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
335 }
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
336
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
337
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
338 void MainWindow::wsClosed()
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
339 {
254
b0adda0053c5 Installed MessageHandler for logging
Michiel Broek <mbroek@mbse.eu>
parents: 234
diff changeset
340 qWarning() << Q_FUNC_INFO << webSocket->closeReason();
91
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
341
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
342 // Should triger a periodic timer to try to reconnect.
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
343 }
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
344
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
345
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
346 void MainWindow::wsTextMessageReceived(QString message)
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
347 {
308
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
348 //qDebug() << "WS received:" << message;
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
349
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
350 QJsonParseError parseError;
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
351 QJsonDocument jsonMessage = QJsonDocument::fromJson(message.toUtf8(), &parseError);
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
352
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
353 if (parseError.error != QJsonParseError::NoError) {
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
354 qWarning() << "wsTextMessageReceived error:" << parseError.errorString() << "at" << parseError.offset ;
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
355 return;
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
356 }
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
357
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
358 /*
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
359 * Two maingroups, nodes and devices.
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
360 * Node message are detected by the group_id object.
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
361 * Device messages are detected by the device object.
310
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
362 *
311
449116c083bd Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents: 310
diff changeset
363 * Signals can be connected from child widgets so we can emit messages to them.
308
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
364 */
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
365 QString device = jsonMessage.object()["device"].toString();
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
366 QString group_id = jsonMessage.object()["group_id"].toString();
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
367 if (device != "") {
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
368 if (device == "fermenters") {
310
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
369 //qDebug() << "found fermenter" << jsonMessage.object()["node"].toString()+"/"+jsonMessage.object()["unit"].toString();
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
370 emit updateFermenters(jsonMessage.object()["node"].toString()+"/"+jsonMessage.object()["unit"].toString());
308
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
371 } else if (device == "co2meters") {
310
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
372 //qDebug() << "found co2meter" << jsonMessage.object()["node"].toString()+"/"+jsonMessage.object()["unit"].toString();
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
373 emit updateCO2meters(jsonMessage.object()["node"].toString()+"/"+jsonMessage.object()["unit"].toString());
308
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
374 } else if (device == "ispindels") {
311
449116c083bd Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents: 310
diff changeset
375 //qDebug() << "found iSpindel" << jsonMessage.object()["node"].toString()+"/"+jsonMessage.object()["unit"].toString();
310
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
376 emit updateiSpindels(jsonMessage.object()["node"].toString()+"/"+jsonMessage.object()["unit"].toString());
308
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
377 } else {
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
378 qDebug() << "unknown device" << device;
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
379 }
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
380 } else if (group_id != "") {
310
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
381 emit updateNodes(jsonMessage.object()["node"].toString());
311
449116c083bd Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents: 310
diff changeset
382 } else if (jsonMessage.object()["ping"].toInt() ) {
449116c083bd Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents: 310
diff changeset
383 /*
449116c083bd Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents: 310
diff changeset
384 * Reply to ping message. Note that the bmsd ignore's
449116c083bd Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents: 310
diff changeset
385 * our reply, but we send it anyway.
449116c083bd Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents: 310
diff changeset
386 */
449116c083bd Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents: 310
diff changeset
387 webSocket->sendTextMessage(QString("{\"pong\":1}"));
308
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
388 } else {
311
449116c083bd Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents: 310
diff changeset
389 qDebug() << "unknown WS message" << message << jsonMessage;
308
79f100a84f65 Add database maintenance to the startup code. Start some work ok parsing websocket messages.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
390 }
91
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
391 }
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
392
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
393
90
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
394 void MainWindow::readsettings()
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
395 {
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
396 QSettings settings(QSettings::IniFormat, QSettings::UserScope, "mbse", "bmsapp");
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
397
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
398 settings.beginGroup("dbprod");
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
399 dbProd.host = settings.value("host").toString();
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
400 if (dbProd.host.isEmpty()) {
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
401 dbProd.host = "localhost";
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
402 dbProd.port = "3306";
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
403 dbProd.name = "bms_prod";
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
404 dbProd.user = "nobody";
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
405 dbProd.pass = "secret";
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
406 dbProd.charset = "utf8";
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
407 settings.setValue("host", dbProd.host);
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
408 settings.setValue("port", dbProd.port);
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
409 settings.setValue("name", dbProd.name);
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
410 settings.setValue("user", dbProd.user);
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
411 settings.setValue("pass", dbProd.pass);
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
412 settings.setValue("charset", dbProd.charset);
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
413 } else {
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
414 dbProd.port = settings.value("port").toString();
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
415 dbProd.name = settings.value("name").toString();
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
416 dbProd.user = settings.value("user").toString();
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
417 dbProd.pass = settings.value("pass").toString();
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
418 dbProd.charset = settings.value("charset").toString();
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
419 }
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
420 settings.endGroup();
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
421 qDebug() << "MySQL prod" << dbProd.host << dbProd.port << dbProd.name << dbProd.pass;
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
422
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
423 settings.beginGroup("dbdev");
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
424 dbDev.host = settings.value("host").toString();
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
425 if (dbDev.host.isEmpty()) {
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
426 dbDev.host = "localhost";
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
427 dbDev.port = "3306";
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
428 dbDev.name = "bms_dev";
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
429 dbDev.user = "nobody";
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
430 dbDev.pass = "secret";
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
431 dbDev.charset = "utf8";
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
432 settings.setValue("host", dbDev.host);
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
433 settings.setValue("port", dbDev.port);
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
434 settings.setValue("name", dbDev.name);
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
435 settings.setValue("user", dbDev.user);
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
436 settings.setValue("pass", dbDev.pass);
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
437 settings.setValue("charset", dbDev.charset);
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
438 } else {
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
439 dbDev.port = settings.value("port").toString();
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
440 dbDev.name = settings.value("name").toString();
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
441 dbDev.user = settings.value("user").toString();
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
442 dbDev.pass = settings.value("pass").toString();
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
443 dbDev.charset = settings.value("charset").toString();
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
444 }
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
445 settings.endGroup();
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
446 qDebug() << "MySQL dev" << dbDev.host << dbDev.port << dbDev.name << dbDev.pass;
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
447
91
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
448 settings.beginGroup("wsprod");
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
449 wsProd.host = settings.value("host").toString();
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
450 if (wsProd.host.isEmpty()) {
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
451 wsProd.host = "localhost";
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
452 settings.setValue("host", wsProd.host);
90
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
453 }
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
454 settings.endGroup();
91
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
455 qDebug() << "WS prod" << wsProd.host;
90
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
456
91
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
457 settings.beginGroup("wsdev");
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
458 wsDev.host = settings.value("host").toString();
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
459 if (wsDev.host.isEmpty()) {
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
460 wsDev.host = "localhost";
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
461 settings.setValue("host", wsDev.host);
90
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
462 }
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
463 settings.endGroup();
91
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
464 qDebug() << "WS dev" << wsDev.host;
465
8fc909360552 In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents: 430
diff changeset
465
8fc909360552 In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents: 430
diff changeset
466 settings.beginGroup("paths");
8fc909360552 In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents: 430
diff changeset
467 if (settings.value("images").toString().isEmpty()) {
8fc909360552 In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents: 430
diff changeset
468 settings.setValue("download", QDir::homePath());
8fc909360552 In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents: 430
diff changeset
469 settings.setValue("images", QDir::homePath());
8fc909360552 In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents: 430
diff changeset
470 settings.setValue("beerxml", QDir::homePath());
8fc909360552 In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents: 430
diff changeset
471 }
8fc909360552 In EditProduct added tab number 13. When entered, a signal is generated to init this tab so that we can defer loading. Added a AddImage button, we can select an image, give it a type and comment and store it is a separate table. The global settings file now has storage for paths (images, download and beerxml).
Michiel Broek <mbroek@mbse.eu>
parents: 430
diff changeset
472 settings.endGroup();
90
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
473 }
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
474
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
475
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
476 void MainWindow::writesettings()
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
477 {
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
478 QSettings settings(QSettings::IniFormat, QSettings::UserScope, "mbse", "bmsapp");
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
479
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
480 settings.beginGroup("dbprod");
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
481 settings.setValue("host", dbProd.host);
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
482 settings.setValue("port", dbProd.port);
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
483 settings.setValue("name", dbProd.name);
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
484 settings.setValue("user", dbProd.user);
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
485 settings.setValue("pass", dbProd.pass);
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
486 settings.setValue("charset", dbProd.charset);
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
487 settings.endGroup();
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
488
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
489 settings.beginGroup("dbdev");
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
490 settings.setValue("host", dbDev.host);
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
491 settings.setValue("port", dbDev.port);
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
492 settings.setValue("name", dbDev.name);
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
493 settings.setValue("user", dbDev.user);
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
494 settings.setValue("pass", dbDev.pass);
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
495 settings.setValue("charset", dbDev.charset);
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
496 settings.endGroup();
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
497
91
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
498 settings.beginGroup("wsprod");
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
499 settings.setValue("host", wsProd.host);
90
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
500 settings.endGroup();
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
501
91
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
502 settings.beginGroup("wsdev");
409d9c7214be Added websocket connection to the bmsd server. Dropped MQTT, not needed. MySQL and webSockets is enough.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
503 settings.setValue("host", wsDev.host);
90
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
504 settings.endGroup();
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
505
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
506 qDebug() << "writesettings() done.";
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
507 }
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
508
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
509
4
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
510 void MainWindow::on_actionExit_triggered()
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
511 {
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
512 this->close();
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
513 }
3
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
514
4
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
515
275
f472f9773782 Added import from xml, equipments and beerstyles.
Michiel Broek <mbroek@mbse.eu>
parents: 254
diff changeset
516 void MainWindow::fromImportXML()
f472f9773782 Added import from xml, equipments and beerstyles.
Michiel Broek <mbroek@mbse.eu>
parents: 254
diff changeset
517 {
f472f9773782 Added import from xml, equipments and beerstyles.
Michiel Broek <mbroek@mbse.eu>
parents: 254
diff changeset
518 ui->mainStack->setCurrentIndex(-1);
f472f9773782 Added import from xml, equipments and beerstyles.
Michiel Broek <mbroek@mbse.eu>
parents: 254
diff changeset
519 ui->mainStack->removeWidget(ImportXMLWindow);
f472f9773782 Added import from xml, equipments and beerstyles.
Michiel Broek <mbroek@mbse.eu>
parents: 254
diff changeset
520 delete ImportXMLWindow;
f472f9773782 Added import from xml, equipments and beerstyles.
Michiel Broek <mbroek@mbse.eu>
parents: 254
diff changeset
521 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
f472f9773782 Added import from xml, equipments and beerstyles.
Michiel Broek <mbroek@mbse.eu>
parents: 254
diff changeset
522 ui->menuBar->setVisible(true);
f472f9773782 Added import from xml, equipments and beerstyles.
Michiel Broek <mbroek@mbse.eu>
parents: 254
diff changeset
523 }
f472f9773782 Added import from xml, equipments and beerstyles.
Michiel Broek <mbroek@mbse.eu>
parents: 254
diff changeset
524
f472f9773782 Added import from xml, equipments and beerstyles.
Michiel Broek <mbroek@mbse.eu>
parents: 254
diff changeset
525
f472f9773782 Added import from xml, equipments and beerstyles.
Michiel Broek <mbroek@mbse.eu>
parents: 254
diff changeset
526 void MainWindow::on_actionImport_XML_triggered()
f472f9773782 Added import from xml, equipments and beerstyles.
Michiel Broek <mbroek@mbse.eu>
parents: 254
diff changeset
527 {
f472f9773782 Added import from xml, equipments and beerstyles.
Michiel Broek <mbroek@mbse.eu>
parents: 254
diff changeset
528 ImportXMLWindow = new ImportXML(this);
f472f9773782 Added import from xml, equipments and beerstyles.
Michiel Broek <mbroek@mbse.eu>
parents: 254
diff changeset
529 int index = ui->mainStack->count();
f472f9773782 Added import from xml, equipments and beerstyles.
Michiel Broek <mbroek@mbse.eu>
parents: 254
diff changeset
530 ui->mainStack->addWidget(ImportXMLWindow);
f472f9773782 Added import from xml, equipments and beerstyles.
Michiel Broek <mbroek@mbse.eu>
parents: 254
diff changeset
531 ui->mainStack->setCurrentIndex(index);
f472f9773782 Added import from xml, equipments and beerstyles.
Michiel Broek <mbroek@mbse.eu>
parents: 254
diff changeset
532 setWindowTitle( QString("BMSapp - %1 - Import XML").arg(VERSIONSTRING));
f472f9773782 Added import from xml, equipments and beerstyles.
Michiel Broek <mbroek@mbse.eu>
parents: 254
diff changeset
533 ui->menuBar->setVisible(false);
f472f9773782 Added import from xml, equipments and beerstyles.
Michiel Broek <mbroek@mbse.eu>
parents: 254
diff changeset
534 }
f472f9773782 Added import from xml, equipments and beerstyles.
Michiel Broek <mbroek@mbse.eu>
parents: 254
diff changeset
535
f472f9773782 Added import from xml, equipments and beerstyles.
Michiel Broek <mbroek@mbse.eu>
parents: 254
diff changeset
536
387
7945bf3be1f9 Import brew logs added.
Michiel Broek <mbroek@mbse.eu>
parents: 386
diff changeset
537 void MainWindow::fromImportBrew()
7945bf3be1f9 Import brew logs added.
Michiel Broek <mbroek@mbse.eu>
parents: 386
diff changeset
538 {
7945bf3be1f9 Import brew logs added.
Michiel Broek <mbroek@mbse.eu>
parents: 386
diff changeset
539 ui->mainStack->setCurrentIndex(-1);
7945bf3be1f9 Import brew logs added.
Michiel Broek <mbroek@mbse.eu>
parents: 386
diff changeset
540 ui->mainStack->removeWidget(ImportBrewWindow);
7945bf3be1f9 Import brew logs added.
Michiel Broek <mbroek@mbse.eu>
parents: 386
diff changeset
541 delete ImportBrewWindow;
7945bf3be1f9 Import brew logs added.
Michiel Broek <mbroek@mbse.eu>
parents: 386
diff changeset
542 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
7945bf3be1f9 Import brew logs added.
Michiel Broek <mbroek@mbse.eu>
parents: 386
diff changeset
543 ui->menuBar->setVisible(true);
7945bf3be1f9 Import brew logs added.
Michiel Broek <mbroek@mbse.eu>
parents: 386
diff changeset
544 }
7945bf3be1f9 Import brew logs added.
Michiel Broek <mbroek@mbse.eu>
parents: 386
diff changeset
545
7945bf3be1f9 Import brew logs added.
Michiel Broek <mbroek@mbse.eu>
parents: 386
diff changeset
546
7945bf3be1f9 Import brew logs added.
Michiel Broek <mbroek@mbse.eu>
parents: 386
diff changeset
547 void MainWindow::on_actionImport_Brew_triggered()
7945bf3be1f9 Import brew logs added.
Michiel Broek <mbroek@mbse.eu>
parents: 386
diff changeset
548 {
7945bf3be1f9 Import brew logs added.
Michiel Broek <mbroek@mbse.eu>
parents: 386
diff changeset
549 ImportBrewWindow = new ImportBrew(this);
7945bf3be1f9 Import brew logs added.
Michiel Broek <mbroek@mbse.eu>
parents: 386
diff changeset
550 int index = ui->mainStack->count();
7945bf3be1f9 Import brew logs added.
Michiel Broek <mbroek@mbse.eu>
parents: 386
diff changeset
551 ui->mainStack->addWidget(ImportBrewWindow);
7945bf3be1f9 Import brew logs added.
Michiel Broek <mbroek@mbse.eu>
parents: 386
diff changeset
552 ui->mainStack->setCurrentIndex(index);
7945bf3be1f9 Import brew logs added.
Michiel Broek <mbroek@mbse.eu>
parents: 386
diff changeset
553 setWindowTitle( QString("BMSapp - %1 - Import Brewlog").arg(VERSIONSTRING));
7945bf3be1f9 Import brew logs added.
Michiel Broek <mbroek@mbse.eu>
parents: 386
diff changeset
554 ui->menuBar->setVisible(false);
7945bf3be1f9 Import brew logs added.
Michiel Broek <mbroek@mbse.eu>
parents: 386
diff changeset
555 }
7945bf3be1f9 Import brew logs added.
Michiel Broek <mbroek@mbse.eu>
parents: 386
diff changeset
556
7945bf3be1f9 Import brew logs added.
Michiel Broek <mbroek@mbse.eu>
parents: 386
diff changeset
557
310
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
558 void MainWindow::fromMonNodes()
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
559 {
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
560 ui->mainStack->setCurrentIndex(-1);
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
561 ui->mainStack->removeWidget(MonNodesWindow);
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
562 delete MonNodesWindow;
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
563 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
564 ui->menuBar->setVisible(true);
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
565 }
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
566
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
567
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
568 void MainWindow::on_actionMon_Nodes_triggered()
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
569 {
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
570 MonNodesWindow = new MonNodes(this);
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
571 int index = ui->mainStack->count();
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
572 ui->mainStack->addWidget(MonNodesWindow);
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
573 ui->mainStack->setCurrentIndex(index);
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
574 setWindowTitle( QString("BMSapp - %1 - Monitor Nodes").arg(VERSIONSTRING));
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
575 ui->menuBar->setVisible(false);
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
576 }
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
577
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
578
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
579 void MainWindow::fromMonFermenters()
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
580 {
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
581 ui->mainStack->setCurrentIndex(-1);
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
582 ui->mainStack->removeWidget(MonFermentersWindow);
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
583 delete MonFermentersWindow;
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
584 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
585 ui->menuBar->setVisible(true);
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
586 }
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
587
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
588
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
589 void MainWindow::on_actionMon_Fermenters_triggered()
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
590 {
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
591 MonFermentersWindow = new MonFermenters(this);
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
592 int index = ui->mainStack->count();
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
593 ui->mainStack->addWidget(MonFermentersWindow);
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
594 ui->mainStack->setCurrentIndex(index);
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
595 setWindowTitle( QString("BMSapp - %1 - Monitor Fermenters").arg(VERSIONSTRING));
311
449116c083bd Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents: 310
diff changeset
596 ui->menuBar->setVisible(false);
310
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
597 }
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
598
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
599
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
600 void MainWindow::fromMonCO2meters()
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
601 {
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
602 ui->mainStack->setCurrentIndex(-1);
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
603 ui->mainStack->removeWidget(MonCO2metersWindow);
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
604 delete MonCO2metersWindow;
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
605 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
606 ui->menuBar->setVisible(true);
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
607 }
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
608
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
609
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
610 void MainWindow::on_actionMon_CO2meters_triggered()
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
611 {
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
612 MonCO2metersWindow = new MonCO2meters(this);
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
613 int index = ui->mainStack->count();
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
614 ui->mainStack->addWidget(MonCO2metersWindow);
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
615 ui->mainStack->setCurrentIndex(index);
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
616 setWindowTitle( QString("BMSapp - %1 - Monitor CO2meters").arg(VERSIONSTRING));
332
146874d7bb47 Added carbonation chart to it's own function. Added this chart to DetailCO2meter too.
Michiel Broek <mbroek@mbse.eu>
parents: 311
diff changeset
617 ui->menuBar->setVisible(false);
310
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
618 }
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
619
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
620
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
621 void MainWindow::fromMoniSpindels()
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
622 {
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
623 ui->mainStack->setCurrentIndex(-1);
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
624 ui->mainStack->removeWidget(MoniSpindelsWindow);
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
625 delete MoniSpindelsWindow;
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
626 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
627 ui->menuBar->setVisible(true);
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
628 }
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
629
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
630
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
631 void MainWindow::on_actionMon_iSpindels_triggered()
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
632 {
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
633 MoniSpindelsWindow = new MoniSpindels(this);
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
634 int index = ui->mainStack->count();
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
635 ui->mainStack->addWidget(MoniSpindelsWindow);
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
636 ui->mainStack->setCurrentIndex(index);
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
637 setWindowTitle( QString("BMSapp - %1 - Monitor iSpindels").arg(VERSIONSTRING));
311
449116c083bd Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents: 310
diff changeset
638 ui->menuBar->setVisible(false);
310
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
639 }
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
640
bdaac24b86ed Added monitor nodes overview
Michiel Broek <mbroek@mbse.eu>
parents: 308
diff changeset
641
81
562ed7d1b74d Added start of the Recipes Tree to select a recipe
Michiel Broek <mbroek@mbse.eu>
parents: 79
diff changeset
642 void MainWindow::fromRecipesTree()
562ed7d1b74d Added start of the Recipes Tree to select a recipe
Michiel Broek <mbroek@mbse.eu>
parents: 79
diff changeset
643 {
562ed7d1b74d Added start of the Recipes Tree to select a recipe
Michiel Broek <mbroek@mbse.eu>
parents: 79
diff changeset
644 ui->mainStack->setCurrentIndex(-1);
562ed7d1b74d Added start of the Recipes Tree to select a recipe
Michiel Broek <mbroek@mbse.eu>
parents: 79
diff changeset
645 ui->mainStack->removeWidget(RecipesTreeWindow);
562ed7d1b74d Added start of the Recipes Tree to select a recipe
Michiel Broek <mbroek@mbse.eu>
parents: 79
diff changeset
646 delete RecipesTreeWindow;
562ed7d1b74d Added start of the Recipes Tree to select a recipe
Michiel Broek <mbroek@mbse.eu>
parents: 79
diff changeset
647 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
562ed7d1b74d Added start of the Recipes Tree to select a recipe
Michiel Broek <mbroek@mbse.eu>
parents: 79
diff changeset
648 ui->menuBar->setVisible(true);
562ed7d1b74d Added start of the Recipes Tree to select a recipe
Michiel Broek <mbroek@mbse.eu>
parents: 79
diff changeset
649 }
562ed7d1b74d Added start of the Recipes Tree to select a recipe
Michiel Broek <mbroek@mbse.eu>
parents: 79
diff changeset
650
562ed7d1b74d Added start of the Recipes Tree to select a recipe
Michiel Broek <mbroek@mbse.eu>
parents: 79
diff changeset
651
562ed7d1b74d Added start of the Recipes Tree to select a recipe
Michiel Broek <mbroek@mbse.eu>
parents: 79
diff changeset
652 void MainWindow::on_actionRecipes_triggered()
562ed7d1b74d Added start of the Recipes Tree to select a recipe
Michiel Broek <mbroek@mbse.eu>
parents: 79
diff changeset
653 {
562ed7d1b74d Added start of the Recipes Tree to select a recipe
Michiel Broek <mbroek@mbse.eu>
parents: 79
diff changeset
654 RecipesTreeWindow = new RecipesTree(this);
562ed7d1b74d Added start of the Recipes Tree to select a recipe
Michiel Broek <mbroek@mbse.eu>
parents: 79
diff changeset
655 int index = ui->mainStack->count();
562ed7d1b74d Added start of the Recipes Tree to select a recipe
Michiel Broek <mbroek@mbse.eu>
parents: 79
diff changeset
656 ui->mainStack->addWidget(RecipesTreeWindow);
562ed7d1b74d Added start of the Recipes Tree to select a recipe
Michiel Broek <mbroek@mbse.eu>
parents: 79
diff changeset
657 ui->mainStack->setCurrentIndex(index);
562ed7d1b74d Added start of the Recipes Tree to select a recipe
Michiel Broek <mbroek@mbse.eu>
parents: 79
diff changeset
658 setWindowTitle( QString("BMSapp - %1 - Recipes").arg(VERSIONSTRING));
103
6da4e93b6ceb Experiment with checkboxes in the fermentable table.
Michiel Broek <mbroek@mbse.eu>
parents: 91
diff changeset
659 ui->menuBar->setVisible(false);
81
562ed7d1b74d Added start of the Recipes Tree to select a recipe
Michiel Broek <mbroek@mbse.eu>
parents: 79
diff changeset
660 }
562ed7d1b74d Added start of the Recipes Tree to select a recipe
Michiel Broek <mbroek@mbse.eu>
parents: 79
diff changeset
661
562ed7d1b74d Added start of the Recipes Tree to select a recipe
Michiel Broek <mbroek@mbse.eu>
parents: 79
diff changeset
662
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
663 void MainWindow::fromInventorySuppliers()
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
664 {
65
2ef981980daa Finally found out how to make these databases work on a single main window. And it's dynamic too.
Michiel Broek <mbroek@mbse.eu>
parents: 64
diff changeset
665 ui->mainStack->setCurrentIndex(-1);
2ef981980daa Finally found out how to make these databases work on a single main window. And it's dynamic too.
Michiel Broek <mbroek@mbse.eu>
parents: 64
diff changeset
666 ui->mainStack->removeWidget(InventorySuppliersWindow);
2ef981980daa Finally found out how to make these databases work on a single main window. And it's dynamic too.
Michiel Broek <mbroek@mbse.eu>
parents: 64
diff changeset
667 delete InventorySuppliersWindow;
64
b0d30697af67 First step in loading the Inventory Suppliers database on the mainscreen. But, it is loaded at program start en not removed when done. Weird programming to get this working.
Michiel Broek <mbroek@mbse.eu>
parents: 57
diff changeset
668 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
66
72386c164f54 Added texts on the buttons. Removed a number of debug messages. Hide and show the main menubar during edit. Removed unused and unneeded stackable window pages.
Michiel Broek <mbroek@mbse.eu>
parents: 65
diff changeset
669 ui->menuBar->setVisible(true);
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
670 }
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
671
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
672
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
673 void MainWindow::on_actionSuppliers_triggered()
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
674 {
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
675 InventorySuppliersWindow = new InventorySuppliers(this);
66
72386c164f54 Added texts on the buttons. Removed a number of debug messages. Hide and show the main menubar during edit. Removed unused and unneeded stackable window pages.
Michiel Broek <mbroek@mbse.eu>
parents: 65
diff changeset
676 int index = ui->mainStack->count();
65
2ef981980daa Finally found out how to make these databases work on a single main window. And it's dynamic too.
Michiel Broek <mbroek@mbse.eu>
parents: 64
diff changeset
677 ui->mainStack->addWidget(InventorySuppliersWindow);
66
72386c164f54 Added texts on the buttons. Removed a number of debug messages. Hide and show the main menubar during edit. Removed unused and unneeded stackable window pages.
Michiel Broek <mbroek@mbse.eu>
parents: 65
diff changeset
678 ui->mainStack->setCurrentIndex(index);
64
b0d30697af67 First step in loading the Inventory Suppliers database on the mainscreen. But, it is loaded at program start en not removed when done. Weird programming to get this working.
Michiel Broek <mbroek@mbse.eu>
parents: 57
diff changeset
679 setWindowTitle( QString("BMSapp - %1 - Inventory Suppliers").arg(VERSIONSTRING));
66
72386c164f54 Added texts on the buttons. Removed a number of debug messages. Hide and show the main menubar during edit. Removed unused and unneeded stackable window pages.
Michiel Broek <mbroek@mbse.eu>
parents: 65
diff changeset
680 ui->menuBar->setVisible(false);
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
681 }
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
682
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
683
19
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
684 void MainWindow::fromInventoryFermentables()
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
685 {
68
abac28effb21 Inventory Fermentables now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 66
diff changeset
686 ui->mainStack->setCurrentIndex(-1);
abac28effb21 Inventory Fermentables now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 66
diff changeset
687 ui->mainStack->removeWidget(InventoryFermentablesWindow);
19
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
688 delete InventoryFermentablesWindow;
68
abac28effb21 Inventory Fermentables now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 66
diff changeset
689 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
abac28effb21 Inventory Fermentables now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 66
diff changeset
690 ui->menuBar->setVisible(true);
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
691 statusBar()->clearMessage();
19
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
692 }
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
693
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
694
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
695 void MainWindow::on_actionFermentables_triggered()
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
696 {
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
697 InventoryFermentablesWindow = new InventoryFermentables(this);
68
abac28effb21 Inventory Fermentables now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 66
diff changeset
698 int index = ui->mainStack->count();
abac28effb21 Inventory Fermentables now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 66
diff changeset
699 ui->mainStack->addWidget(InventoryFermentablesWindow);
abac28effb21 Inventory Fermentables now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 66
diff changeset
700 ui->mainStack->setCurrentIndex(index);
abac28effb21 Inventory Fermentables now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 66
diff changeset
701 setWindowTitle(QString("BMSapp - %1 - Inventory Fermentables").arg(VERSIONSTRING));
abac28effb21 Inventory Fermentables now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 66
diff changeset
702 ui->menuBar->setVisible(false);
19
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
703 }
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
704
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
705
24
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
706 void MainWindow::fromInventoryHops()
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
707 {
69
228cb2a01acf Inventory Hops now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 68
diff changeset
708 ui->mainStack->setCurrentIndex(-1);
228cb2a01acf Inventory Hops now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 68
diff changeset
709 ui->mainStack->removeWidget(InventoryHopsWindow);
24
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
710 delete InventoryHopsWindow;
69
228cb2a01acf Inventory Hops now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 68
diff changeset
711 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
228cb2a01acf Inventory Hops now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 68
diff changeset
712 ui->menuBar->setVisible(true);
79
e726db72da3c All inventory and profiles now show the items sizes in the statusbar.
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
713 statusBar()->clearMessage();
24
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
714 }
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
715
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
716
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
717 void MainWindow::on_actionHops_triggered()
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
718 {
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
719 InventoryHopsWindow = new InventoryHops(this);
69
228cb2a01acf Inventory Hops now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 68
diff changeset
720 int index = ui->mainStack->count();
228cb2a01acf Inventory Hops now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 68
diff changeset
721 ui->mainStack->addWidget(InventoryHopsWindow);
228cb2a01acf Inventory Hops now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 68
diff changeset
722 ui->mainStack->setCurrentIndex(index);
228cb2a01acf Inventory Hops now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 68
diff changeset
723 setWindowTitle(QString("BMSapp - %1 - Inventory Hops").arg(VERSIONSTRING));
228cb2a01acf Inventory Hops now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 68
diff changeset
724 ui->menuBar->setVisible(false);
24
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
725 }
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
726
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
727
25
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
728 void MainWindow::fromInventoryYeasts()
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
729 {
70
556b4202c5e7 Inventory Yeasts now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 69
diff changeset
730 ui->mainStack->setCurrentIndex(-1);
556b4202c5e7 Inventory Yeasts now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 69
diff changeset
731 ui->mainStack->removeWidget(InventoryYeastsWindow);
25
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
732 delete InventoryYeastsWindow;
70
556b4202c5e7 Inventory Yeasts now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 69
diff changeset
733 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
556b4202c5e7 Inventory Yeasts now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 69
diff changeset
734 ui->menuBar->setVisible(true);
79
e726db72da3c All inventory and profiles now show the items sizes in the statusbar.
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
735 statusBar()->clearMessage();
25
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
736 }
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
737
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
738
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
739 void MainWindow::on_actionYeasts_triggered()
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
740 {
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
741 InventoryYeastsWindow = new InventoryYeasts(this);
70
556b4202c5e7 Inventory Yeasts now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 69
diff changeset
742 int index = ui->mainStack->count();
556b4202c5e7 Inventory Yeasts now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 69
diff changeset
743 ui->mainStack->addWidget(InventoryYeastsWindow);
556b4202c5e7 Inventory Yeasts now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 69
diff changeset
744 ui->mainStack->setCurrentIndex(index);
556b4202c5e7 Inventory Yeasts now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 69
diff changeset
745 setWindowTitle(QString("BMSapp - %1 - Inventory Yeasts").arg(VERSIONSTRING));
556b4202c5e7 Inventory Yeasts now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 69
diff changeset
746 ui->menuBar->setVisible(false);
25
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
747 }
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
748
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
749
480
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
750 void MainWindow::fromInventoryYeastPacks()
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
751 {
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
752 ui->mainStack->setCurrentIndex(-1);
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
753 ui->mainStack->removeWidget(InventoryYeastPacksWindow);
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
754 delete InventoryYeastPacksWindow;
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
755 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
756 ui->menuBar->setVisible(true);
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
757 statusBar()->clearMessage();
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
758 }
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
759
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
760
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
761 void MainWindow::on_actionYeastPacks_triggered()
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
762 {
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
763 InventoryYeastPacksWindow = new InventoryYeastPacks(this);
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
764 int index = ui->mainStack->count();
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
765 ui->mainStack->addWidget(InventoryYeastPacksWindow);
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
766 ui->mainStack->setCurrentIndex(index);
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
767 setWindowTitle(QString("BMSapp - %1 - Inventory Yeasts").arg(VERSIONSTRING));
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
768 ui->menuBar->setVisible(false);
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
769 }
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
770
94b3def5d778 Added yeastpack editor. Expanded the database upgrade. On startup, recount the yeastpack used fields.
Michiel Broek <mbroek@mbse.eu>
parents: 479
diff changeset
771
28
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
772 void MainWindow::fromInventoryMiscs()
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
773 {
71
5bd0d7be0167 Inventory Miscs now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
774 ui->mainStack->setCurrentIndex(-1);
5bd0d7be0167 Inventory Miscs now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
775 ui->mainStack->removeWidget(InventoryMiscsWindow);
28
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
776 delete InventoryMiscsWindow;
71
5bd0d7be0167 Inventory Miscs now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
777 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
5bd0d7be0167 Inventory Miscs now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
778 ui->menuBar->setVisible(true);
79
e726db72da3c All inventory and profiles now show the items sizes in the statusbar.
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
779 statusBar()->clearMessage();
28
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
780 }
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
781
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
782
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
783 void MainWindow::on_actionMiscs_triggered()
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
784 {
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
785 InventoryMiscsWindow = new InventoryMiscs(this);
71
5bd0d7be0167 Inventory Miscs now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
786 int index = ui->mainStack->count();
5bd0d7be0167 Inventory Miscs now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
787 ui->mainStack->addWidget(InventoryMiscsWindow);
5bd0d7be0167 Inventory Miscs now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
788 ui->mainStack->setCurrentIndex(index);
72
7992c686e349 Inventory Waters now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 71
diff changeset
789 setWindowTitle(QString("BMSapp - %1 - Inventory Miscs").arg(VERSIONSTRING));
71
5bd0d7be0167 Inventory Miscs now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 70
diff changeset
790 ui->menuBar->setVisible(false);
28
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
791 }
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
792
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
793
29
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
794 void MainWindow::fromInventoryWaters()
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
795 {
72
7992c686e349 Inventory Waters now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 71
diff changeset
796 ui->mainStack->setCurrentIndex(-1);
7992c686e349 Inventory Waters now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 71
diff changeset
797 ui->mainStack->removeWidget(InventoryWatersWindow);
29
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
798 delete InventoryWatersWindow;
72
7992c686e349 Inventory Waters now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 71
diff changeset
799 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
7992c686e349 Inventory Waters now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 71
diff changeset
800 ui->menuBar->setVisible(true);
79
e726db72da3c All inventory and profiles now show the items sizes in the statusbar.
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
801 statusBar()->clearMessage();
29
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
802 }
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
803
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
804
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
805 void MainWindow::on_actionWaters_triggered()
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
806 {
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
807 InventoryWatersWindow = new InventoryWaters(this);
72
7992c686e349 Inventory Waters now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 71
diff changeset
808 int index = ui->mainStack->count();
7992c686e349 Inventory Waters now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 71
diff changeset
809 ui->mainStack->addWidget(InventoryWatersWindow);
7992c686e349 Inventory Waters now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 71
diff changeset
810 ui->mainStack->setCurrentIndex(index);
7992c686e349 Inventory Waters now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 71
diff changeset
811 setWindowTitle(QString("BMSapp - %1 - Inventory Waters").arg(VERSIONSTRING));
7992c686e349 Inventory Waters now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 71
diff changeset
812 ui->menuBar->setVisible(false);
29
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
813 }
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
814
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
815
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
816 void MainWindow::fromInventoryEquipments()
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
817 {
73
ebd2fc719b1a Inventory Equipments now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
818 ui->mainStack->setCurrentIndex(-1);
ebd2fc719b1a Inventory Equipments now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
819 ui->mainStack->removeWidget(InventoryEquipmentsWindow);
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
820 delete InventoryEquipmentsWindow;
73
ebd2fc719b1a Inventory Equipments now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
821 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
ebd2fc719b1a Inventory Equipments now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
822 ui->menuBar->setVisible(true);
79
e726db72da3c All inventory and profiles now show the items sizes in the statusbar.
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
823 statusBar()->clearMessage();
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
824 }
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
825
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
826
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
827 void MainWindow::on_actionEquipments_triggered()
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
828 {
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
829 InventoryEquipmentsWindow = new InventoryEquipments(this);
73
ebd2fc719b1a Inventory Equipments now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
830 int index = ui->mainStack->count();
ebd2fc719b1a Inventory Equipments now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
831 ui->mainStack->addWidget(InventoryEquipmentsWindow);
ebd2fc719b1a Inventory Equipments now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
832 ui->mainStack->setCurrentIndex(index);
ebd2fc719b1a Inventory Equipments now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
833 setWindowTitle(QString("BMSapp - %1 - Inventory Equipments").arg(VERSIONSTRING));
ebd2fc719b1a Inventory Equipments now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
834 ui->menuBar->setVisible(false);
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
835 }
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
836
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
837
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents: 49
diff changeset
838 void MainWindow::on_actionSupplies_list_triggered()
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents: 49
diff changeset
839 {
88
64cf5468fd22 Improve the CMakeLists.txt. Cleanup unused variables. Removed som debug messages.
Michiel Broek <mbroek@mbse.eu>
parents: 81
diff changeset
840 PrinterDialog(PR_SUPPLIES, -1, this);
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents: 49
diff changeset
841 }
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents: 49
diff changeset
842
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents: 49
diff changeset
843
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents: 49
diff changeset
844 void MainWindow::on_actionYeast_bank_triggered()
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents: 49
diff changeset
845 {
88
64cf5468fd22 Improve the CMakeLists.txt. Cleanup unused variables. Removed som debug messages.
Michiel Broek <mbroek@mbse.eu>
parents: 81
diff changeset
846 PrinterDialog(PR_YEASTBANK, -1, this);
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents: 49
diff changeset
847 }
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents: 49
diff changeset
848
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents: 49
diff changeset
849
173
8514932b61aa Added menu entry products in production
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
850 void MainWindow::fromProdInprod()
8514932b61aa Added menu entry products in production
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
851 {
8514932b61aa Added menu entry products in production
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
852 ui->mainStack->setCurrentIndex(-1);
8514932b61aa Added menu entry products in production
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
853 ui->mainStack->removeWidget(ProdInprodWindow);
8514932b61aa Added menu entry products in production
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
854 delete ProdInprodWindow;
8514932b61aa Added menu entry products in production
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
855 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
8514932b61aa Added menu entry products in production
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
856 ui->menuBar->setVisible(true);
8514932b61aa Added menu entry products in production
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
857 statusBar()->clearMessage();
8514932b61aa Added menu entry products in production
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
858 }
8514932b61aa Added menu entry products in production
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
859
8514932b61aa Added menu entry products in production
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
860
8514932b61aa Added menu entry products in production
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
861 void MainWindow::on_actionProd_inprod_triggered()
8514932b61aa Added menu entry products in production
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
862 {
8514932b61aa Added menu entry products in production
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
863 ProdInprodWindow = new ProdInprod(this);
8514932b61aa Added menu entry products in production
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
864 int index = ui->mainStack->count();
8514932b61aa Added menu entry products in production
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
865 ui->mainStack->addWidget(ProdInprodWindow);
8514932b61aa Added menu entry products in production
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
866 ui->mainStack->setCurrentIndex(index);
8514932b61aa Added menu entry products in production
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
867 setWindowTitle(QString("BMSapp - %1 - Products in production").arg(VERSIONSTRING));
8514932b61aa Added menu entry products in production
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
868 ui->menuBar->setVisible(false);
8514932b61aa Added menu entry products in production
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
869 }
8514932b61aa Added menu entry products in production
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
870
8514932b61aa Added menu entry products in production
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
871
228
c859e8efa470 Added archive products on name.
Michiel Broek <mbroek@mbse.eu>
parents: 173
diff changeset
872 void MainWindow::fromProdOnName()
c859e8efa470 Added archive products on name.
Michiel Broek <mbroek@mbse.eu>
parents: 173
diff changeset
873 {
c859e8efa470 Added archive products on name.
Michiel Broek <mbroek@mbse.eu>
parents: 173
diff changeset
874 ui->mainStack->setCurrentIndex(-1);
c859e8efa470 Added archive products on name.
Michiel Broek <mbroek@mbse.eu>
parents: 173
diff changeset
875 ui->mainStack->removeWidget(ProdOnNameWindow);
c859e8efa470 Added archive products on name.
Michiel Broek <mbroek@mbse.eu>
parents: 173
diff changeset
876 delete ProdOnNameWindow;
c859e8efa470 Added archive products on name.
Michiel Broek <mbroek@mbse.eu>
parents: 173
diff changeset
877 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
c859e8efa470 Added archive products on name.
Michiel Broek <mbroek@mbse.eu>
parents: 173
diff changeset
878 ui->menuBar->setVisible(true);
c859e8efa470 Added archive products on name.
Michiel Broek <mbroek@mbse.eu>
parents: 173
diff changeset
879 statusBar()->clearMessage();
c859e8efa470 Added archive products on name.
Michiel Broek <mbroek@mbse.eu>
parents: 173
diff changeset
880 }
c859e8efa470 Added archive products on name.
Michiel Broek <mbroek@mbse.eu>
parents: 173
diff changeset
881
c859e8efa470 Added archive products on name.
Michiel Broek <mbroek@mbse.eu>
parents: 173
diff changeset
882
c859e8efa470 Added archive products on name.
Michiel Broek <mbroek@mbse.eu>
parents: 173
diff changeset
883 void MainWindow::on_actionOn_Name_triggered()
c859e8efa470 Added archive products on name.
Michiel Broek <mbroek@mbse.eu>
parents: 173
diff changeset
884 {
c859e8efa470 Added archive products on name.
Michiel Broek <mbroek@mbse.eu>
parents: 173
diff changeset
885 ProdOnNameWindow = new ProdOnName(this);
c859e8efa470 Added archive products on name.
Michiel Broek <mbroek@mbse.eu>
parents: 173
diff changeset
886 int index = ui->mainStack->count();
c859e8efa470 Added archive products on name.
Michiel Broek <mbroek@mbse.eu>
parents: 173
diff changeset
887 ui->mainStack->addWidget(ProdOnNameWindow);
c859e8efa470 Added archive products on name.
Michiel Broek <mbroek@mbse.eu>
parents: 173
diff changeset
888 ui->mainStack->setCurrentIndex(index);
c859e8efa470 Added archive products on name.
Michiel Broek <mbroek@mbse.eu>
parents: 173
diff changeset
889 setWindowTitle(QString("BMSapp - %1 - Products archive on name").arg(VERSIONSTRING));
c859e8efa470 Added archive products on name.
Michiel Broek <mbroek@mbse.eu>
parents: 173
diff changeset
890 ui->menuBar->setVisible(false);
c859e8efa470 Added archive products on name.
Michiel Broek <mbroek@mbse.eu>
parents: 173
diff changeset
891 }
c859e8efa470 Added archive products on name.
Michiel Broek <mbroek@mbse.eu>
parents: 173
diff changeset
892
c859e8efa470 Added archive products on name.
Michiel Broek <mbroek@mbse.eu>
parents: 173
diff changeset
893
231
54b5abd46958 Added archive products sorted on code.
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
894 void MainWindow::fromProdOnCode()
54b5abd46958 Added archive products sorted on code.
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
895 {
54b5abd46958 Added archive products sorted on code.
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
896 ui->mainStack->setCurrentIndex(-1);
54b5abd46958 Added archive products sorted on code.
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
897 ui->mainStack->removeWidget(ProdOnCodeWindow);
54b5abd46958 Added archive products sorted on code.
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
898 delete ProdOnCodeWindow;
54b5abd46958 Added archive products sorted on code.
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
899 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
54b5abd46958 Added archive products sorted on code.
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
900 ui->menuBar->setVisible(true);
54b5abd46958 Added archive products sorted on code.
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
901 statusBar()->clearMessage();
54b5abd46958 Added archive products sorted on code.
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
902 }
54b5abd46958 Added archive products sorted on code.
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
903
54b5abd46958 Added archive products sorted on code.
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
904
54b5abd46958 Added archive products sorted on code.
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
905 void MainWindow::on_actionOn_Code_triggered()
54b5abd46958 Added archive products sorted on code.
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
906 {
54b5abd46958 Added archive products sorted on code.
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
907 ProdOnCodeWindow = new ProdOnCode(this);
54b5abd46958 Added archive products sorted on code.
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
908 int index = ui->mainStack->count();
54b5abd46958 Added archive products sorted on code.
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
909 ui->mainStack->addWidget(ProdOnCodeWindow);
54b5abd46958 Added archive products sorted on code.
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
910 ui->mainStack->setCurrentIndex(index);
54b5abd46958 Added archive products sorted on code.
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
911 setWindowTitle(QString("BMSapp - %1 - Products archive on code").arg(VERSIONSTRING));
54b5abd46958 Added archive products sorted on code.
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
912 ui->menuBar->setVisible(false);
54b5abd46958 Added archive products sorted on code.
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
913 }
54b5abd46958 Added archive products sorted on code.
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
914
54b5abd46958 Added archive products sorted on code.
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
915
234
51aea8b798f0 Add product archive tree by date.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
916 void MainWindow::fromProdOnDate()
51aea8b798f0 Add product archive tree by date.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
917 {
51aea8b798f0 Add product archive tree by date.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
918 ui->mainStack->setCurrentIndex(-1);
51aea8b798f0 Add product archive tree by date.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
919 ui->mainStack->removeWidget(ProdOnDateWindow);
51aea8b798f0 Add product archive tree by date.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
920 delete ProdOnDateWindow;
51aea8b798f0 Add product archive tree by date.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
921 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
51aea8b798f0 Add product archive tree by date.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
922 ui->menuBar->setVisible(true);
51aea8b798f0 Add product archive tree by date.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
923 statusBar()->clearMessage();
51aea8b798f0 Add product archive tree by date.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
924 }
51aea8b798f0 Add product archive tree by date.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
925
51aea8b798f0 Add product archive tree by date.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
926
51aea8b798f0 Add product archive tree by date.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
927 void MainWindow::on_actionOn_Date_triggered()
51aea8b798f0 Add product archive tree by date.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
928 {
51aea8b798f0 Add product archive tree by date.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
929 ProdOnDateWindow = new ProdOnDate(this);
51aea8b798f0 Add product archive tree by date.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
930 int index = ui->mainStack->count();
51aea8b798f0 Add product archive tree by date.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
931 ui->mainStack->addWidget(ProdOnDateWindow);
51aea8b798f0 Add product archive tree by date.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
932 ui->mainStack->setCurrentIndex(index);
51aea8b798f0 Add product archive tree by date.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
933 setWindowTitle(QString("BMSapp - %1 - Products archive on date").arg(VERSIONSTRING));
51aea8b798f0 Add product archive tree by date.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
934 ui->menuBar->setVisible(false);
51aea8b798f0 Add product archive tree by date.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
935 }
51aea8b798f0 Add product archive tree by date.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
936
51aea8b798f0 Add product archive tree by date.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
937
232
6d3ba9c44f95 Added the product archives tree by styles.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
938 void MainWindow::fromProdOnTree()
6d3ba9c44f95 Added the product archives tree by styles.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
939 {
6d3ba9c44f95 Added the product archives tree by styles.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
940 ui->mainStack->setCurrentIndex(-1);
6d3ba9c44f95 Added the product archives tree by styles.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
941 ui->mainStack->removeWidget(ProdOnTreeWindow);
6d3ba9c44f95 Added the product archives tree by styles.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
942 delete ProdOnTreeWindow;
6d3ba9c44f95 Added the product archives tree by styles.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
943 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
6d3ba9c44f95 Added the product archives tree by styles.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
944 ui->menuBar->setVisible(true);
6d3ba9c44f95 Added the product archives tree by styles.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
945 statusBar()->clearMessage();
6d3ba9c44f95 Added the product archives tree by styles.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
946 }
6d3ba9c44f95 Added the product archives tree by styles.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
947
6d3ba9c44f95 Added the product archives tree by styles.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
948
6d3ba9c44f95 Added the product archives tree by styles.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
949 void MainWindow::on_actionOn_Tree_triggered()
6d3ba9c44f95 Added the product archives tree by styles.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
950 {
6d3ba9c44f95 Added the product archives tree by styles.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
951 ProdOnTreeWindow = new ProdOnTree(this);
6d3ba9c44f95 Added the product archives tree by styles.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
952 int index = ui->mainStack->count();
6d3ba9c44f95 Added the product archives tree by styles.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
953 ui->mainStack->addWidget(ProdOnTreeWindow);
6d3ba9c44f95 Added the product archives tree by styles.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
954 ui->mainStack->setCurrentIndex(index);
6d3ba9c44f95 Added the product archives tree by styles.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
955 setWindowTitle(QString("BMSapp - %1 - Products archive on beerstyle").arg(VERSIONSTRING));
6d3ba9c44f95 Added the product archives tree by styles.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
956 ui->menuBar->setVisible(false);
6d3ba9c44f95 Added the product archives tree by styles.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
957 }
6d3ba9c44f95 Added the product archives tree by styles.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
958
6d3ba9c44f95 Added the product archives tree by styles.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
959
386
2e30c9c20d22 Added reports, total production, fermentations and efficiency.
Michiel Broek <mbroek@mbse.eu>
parents: 380
diff changeset
960 void MainWindow::on_actionRep_Production_triggered()
2e30c9c20d22 Added reports, total production, fermentations and efficiency.
Michiel Broek <mbroek@mbse.eu>
parents: 380
diff changeset
961 {
2e30c9c20d22 Added reports, total production, fermentations and efficiency.
Michiel Broek <mbroek@mbse.eu>
parents: 380
diff changeset
962 PrinterDialog(PR_REP_TOTAL, -1, this);
2e30c9c20d22 Added reports, total production, fermentations and efficiency.
Michiel Broek <mbroek@mbse.eu>
parents: 380
diff changeset
963 }
2e30c9c20d22 Added reports, total production, fermentations and efficiency.
Michiel Broek <mbroek@mbse.eu>
parents: 380
diff changeset
964
2e30c9c20d22 Added reports, total production, fermentations and efficiency.
Michiel Broek <mbroek@mbse.eu>
parents: 380
diff changeset
965
2e30c9c20d22 Added reports, total production, fermentations and efficiency.
Michiel Broek <mbroek@mbse.eu>
parents: 380
diff changeset
966 void MainWindow::on_actionRep_Efficiency_triggered()
2e30c9c20d22 Added reports, total production, fermentations and efficiency.
Michiel Broek <mbroek@mbse.eu>
parents: 380
diff changeset
967 {
2e30c9c20d22 Added reports, total production, fermentations and efficiency.
Michiel Broek <mbroek@mbse.eu>
parents: 380
diff changeset
968 PrinterDialog(PR_REP_EFF, -1, this);
2e30c9c20d22 Added reports, total production, fermentations and efficiency.
Michiel Broek <mbroek@mbse.eu>
parents: 380
diff changeset
969 }
2e30c9c20d22 Added reports, total production, fermentations and efficiency.
Michiel Broek <mbroek@mbse.eu>
parents: 380
diff changeset
970
2e30c9c20d22 Added reports, total production, fermentations and efficiency.
Michiel Broek <mbroek@mbse.eu>
parents: 380
diff changeset
971
2e30c9c20d22 Added reports, total production, fermentations and efficiency.
Michiel Broek <mbroek@mbse.eu>
parents: 380
diff changeset
972 void MainWindow::on_actionRep_Fermentation_triggered()
2e30c9c20d22 Added reports, total production, fermentations and efficiency.
Michiel Broek <mbroek@mbse.eu>
parents: 380
diff changeset
973 {
2e30c9c20d22 Added reports, total production, fermentations and efficiency.
Michiel Broek <mbroek@mbse.eu>
parents: 380
diff changeset
974 PrinterDialog(PR_REP_SVG, -1, this);
2e30c9c20d22 Added reports, total production, fermentations and efficiency.
Michiel Broek <mbroek@mbse.eu>
parents: 380
diff changeset
975 }
2e30c9c20d22 Added reports, total production, fermentations and efficiency.
Michiel Broek <mbroek@mbse.eu>
parents: 380
diff changeset
976
2e30c9c20d22 Added reports, total production, fermentations and efficiency.
Michiel Broek <mbroek@mbse.eu>
parents: 380
diff changeset
977
48
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
978 void MainWindow::fromProfileWaters()
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
979 {
74
4ac38457a709 Profile Waters now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 73
diff changeset
980 ui->mainStack->setCurrentIndex(-1);
4ac38457a709 Profile Waters now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 73
diff changeset
981 ui->mainStack->removeWidget(ProfileWatersWindow);
48
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
982 delete ProfileWatersWindow;
74
4ac38457a709 Profile Waters now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 73
diff changeset
983 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
4ac38457a709 Profile Waters now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 73
diff changeset
984 ui->menuBar->setVisible(true);
79
e726db72da3c All inventory and profiles now show the items sizes in the statusbar.
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
985 statusBar()->clearMessage();
48
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
986 }
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
987
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
988
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
989 void MainWindow::on_actionWater_profiles_triggered()
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
990 {
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
991 ProfileWatersWindow = new ProfileWaters(this);
74
4ac38457a709 Profile Waters now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 73
diff changeset
992 int index = ui->mainStack->count();
4ac38457a709 Profile Waters now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 73
diff changeset
993 ui->mainStack->addWidget(ProfileWatersWindow);
4ac38457a709 Profile Waters now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 73
diff changeset
994 ui->mainStack->setCurrentIndex(index);
75
5f953abbd73c Profile Mashs now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 74
diff changeset
995 setWindowTitle(QString("BMSapp - %1 - Water Profiles").arg(VERSIONSTRING));
5f953abbd73c Profile Mashs now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 74
diff changeset
996 ui->menuBar->setVisible(false);
48
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
997 }
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
998
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
999
49
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
1000 void MainWindow::fromProfileMashs()
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
1001 {
75
5f953abbd73c Profile Mashs now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 74
diff changeset
1002 ui->mainStack->setCurrentIndex(-1);
5f953abbd73c Profile Mashs now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 74
diff changeset
1003 ui->mainStack->removeWidget(ProfileMashsWindow);
49
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
1004 delete ProfileMashsWindow;
75
5f953abbd73c Profile Mashs now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 74
diff changeset
1005 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
5f953abbd73c Profile Mashs now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 74
diff changeset
1006 ui->menuBar->setVisible(true);
79
e726db72da3c All inventory and profiles now show the items sizes in the statusbar.
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1007 statusBar()->clearMessage();
49
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
1008 }
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
1009
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
1010
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
1011 void MainWindow::on_actionMash_profiles_triggered()
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
1012 {
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
1013 ProfileMashsWindow = new ProfileMashs(this);
75
5f953abbd73c Profile Mashs now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 74
diff changeset
1014 int index = ui->mainStack->count();
5f953abbd73c Profile Mashs now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 74
diff changeset
1015 ui->mainStack->addWidget(ProfileMashsWindow);
5f953abbd73c Profile Mashs now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 74
diff changeset
1016 ui->mainStack->setCurrentIndex(index);
5f953abbd73c Profile Mashs now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 74
diff changeset
1017 setWindowTitle(QString("BMSapp - %1 - Mash Profiles").arg(VERSIONSTRING));
5f953abbd73c Profile Mashs now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 74
diff changeset
1018 ui->menuBar->setVisible(false);
49
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
1019 }
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
1020
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
1021
56
eb6c564192f4 Added styles tables and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
1022 void MainWindow::fromProfileStyles()
eb6c564192f4 Added styles tables and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
1023 {
76
93395c4d6c8d Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
1024 ui->mainStack->setCurrentIndex(-1);
93395c4d6c8d Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
1025 ui->mainStack->removeWidget(ProfileStylesWindow);
56
eb6c564192f4 Added styles tables and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
1026 delete ProfileStylesWindow;
76
93395c4d6c8d Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
1027 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
93395c4d6c8d Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
1028 ui->menuBar->setVisible(true);
79
e726db72da3c All inventory and profiles now show the items sizes in the statusbar.
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1029 statusBar()->clearMessage();
56
eb6c564192f4 Added styles tables and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
1030 }
eb6c564192f4 Added styles tables and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
1031
eb6c564192f4 Added styles tables and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
1032
eb6c564192f4 Added styles tables and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
1033 void MainWindow::on_actionStyles_profiles_triggered()
eb6c564192f4 Added styles tables and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
1034 {
eb6c564192f4 Added styles tables and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
1035 ProfileStylesWindow = new ProfileStyles(this);
76
93395c4d6c8d Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
1036 int index = ui->mainStack->count();
93395c4d6c8d Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
1037 ui->mainStack->addWidget(ProfileStylesWindow);
93395c4d6c8d Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
1038 ui->mainStack->setCurrentIndex(index);
93395c4d6c8d Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
1039 setWindowTitle(QString("BMSapp - %1 - Styles Profiles").arg(VERSIONSTRING));
93395c4d6c8d Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
1040 ui->menuBar->setVisible(false);
56
eb6c564192f4 Added styles tables and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
1041 }
eb6c564192f4 Added styles tables and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
1042
eb6c564192f4 Added styles tables and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 52
diff changeset
1043
57
75d11cc05ce4 Added profile fermentation tables and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 56
diff changeset
1044 void MainWindow::fromProfileFerments()
75d11cc05ce4 Added profile fermentation tables and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 56
diff changeset
1045 {
77
86a3277a7317 Profile Ferments now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
1046 ui->mainStack->setCurrentIndex(-1);
86a3277a7317 Profile Ferments now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
1047 ui->mainStack->removeWidget(ProfileFermentsWindow);
57
75d11cc05ce4 Added profile fermentation tables and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 56
diff changeset
1048 delete ProfileFermentsWindow;
77
86a3277a7317 Profile Ferments now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
1049 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
86a3277a7317 Profile Ferments now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
1050 ui->menuBar->setVisible(true);
79
e726db72da3c All inventory and profiles now show the items sizes in the statusbar.
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1051 statusBar()->clearMessage();
57
75d11cc05ce4 Added profile fermentation tables and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 56
diff changeset
1052 }
75d11cc05ce4 Added profile fermentation tables and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 56
diff changeset
1053
75d11cc05ce4 Added profile fermentation tables and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 56
diff changeset
1054
75d11cc05ce4 Added profile fermentation tables and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 56
diff changeset
1055 void MainWindow::on_actionFerments_profiles_triggered()
75d11cc05ce4 Added profile fermentation tables and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 56
diff changeset
1056 {
75d11cc05ce4 Added profile fermentation tables and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 56
diff changeset
1057 ProfileFermentsWindow = new ProfileFerments(this);
77
86a3277a7317 Profile Ferments now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
1058 int index = ui->mainStack->count();
86a3277a7317 Profile Ferments now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
1059 ui->mainStack->addWidget(ProfileFermentsWindow);
86a3277a7317 Profile Ferments now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
1060 ui->mainStack->setCurrentIndex(index);
86a3277a7317 Profile Ferments now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
1061 setWindowTitle(QString("BMSapp - %1 - Fermentation Profiles").arg(VERSIONSTRING));
86a3277a7317 Profile Ferments now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents: 76
diff changeset
1062 ui->menuBar->setVisible(false);
57
75d11cc05ce4 Added profile fermentation tables and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 56
diff changeset
1063 }
75d11cc05ce4 Added profile fermentation tables and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 56
diff changeset
1064
75d11cc05ce4 Added profile fermentation tables and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 56
diff changeset
1065
15
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
1066 void MainWindow::fromSetup()
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
1067 {
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
1068 ui->mainStack->setCurrentIndex(-1);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
1069 ui->mainStack->removeWidget(SetupWindow);
15
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
1070 delete SetupWindow;
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
1071 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
1072 ui->menuBar->setVisible(true);
133
08635b028dcf Load waters during recipe startup. Started calcWater() function. Load profile_setup record global. The print function uses the globals now too instead of loading from the database.
Michiel Broek <mbroek@mbse.eu>
parents: 131
diff changeset
1073 loadSetup();
15
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
1074 }
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
1075
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
1076
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
1077 void MainWindow::on_actionSetup_triggered()
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
1078 {
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
1079 SetupWindow = new Setup(this);
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
1080 int index = ui->mainStack->count();
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
1081 ui->mainStack->addWidget(SetupWindow);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
1082 ui->mainStack->setCurrentIndex(index);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
1083 ui->menuBar->setVisible(false);
15
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
1084 }
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
1085
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
1086
4
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
1087 void MainWindow::on_actionAbout_triggered()
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
1088 {
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
1089 AboutDialog dialog(this);
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
1090 dialog.setModal(true);
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
1091 dialog.exec();
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
1092 }
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
1093
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
1094
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
1095 void MainWindow::windowTitle(QString msg)
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
1096 {
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
1097 setWindowTitle(QString("BMSapp - %1 - %2").arg(VERSIONSTRING).arg(msg));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
1098 }
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
1099
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
1100
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
1101 void MainWindow::statusMsg(QString msg)
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
1102 {
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
1103 statusBar()->showMessage(msg);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
1104 }
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
1105

mercurial