src/Setup.cpp

Thu, 18 Aug 2022 20:34:15 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Thu, 18 Aug 2022 20:34:15 +0200
changeset 401
583148eb6e01
parent 380
8f5c03ed4321
child 411
c78f8cf11849
permissions
-rw-r--r--

Init est_carb field for new products.

15
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 /**
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2 * Setup.cpp is part of bmsapp.
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 *
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4 * bmsapp is free software: you can redistribute it and/or modify
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 * it under the terms of the GNU General Public License as published by
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 * the Free Software Foundation, either version 3 of the License, or
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 * (at your option) any later version.
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 *
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 * bmsapp is distributed in the hope that it will be useful,
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 * GNU General Public License for more details.
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 *
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 */
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 #include "Setup.h"
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 #include "config.h"
336
e97f9e87d94b IBU method names are now global.
Michiel Broek <mbroek@mbse.eu>
parents: 309
diff changeset
19 #include "global.h"
90
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
20 #include "MainWindow.h"
15
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
23
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
24 Setup::Setup(QWidget *parent) : QDialog(parent)
15
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
25 {
16
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
26 QSqlQuery query;
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
27 QGridLayout *gridLayout;
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
28 QWidget *topWidget;
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
29 QFrame *line;
16
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
30
15
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
31 qDebug() << "Setup start";
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
32
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
33 gridLayout = new QGridLayout(this);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
34 gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
35 topWidget = new QWidget(this);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
36 topWidget->setObjectName(QString::fromUtf8("topWidget"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
37
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
38 breweryLabel = new QLabel(topWidget);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
39 breweryLabel->setObjectName(QString::fromUtf8("breweryLabel"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
40 breweryLabel->setGeometry(QRect(60, 20, 131, 20));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
41 breweryLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
42 breweryLabel->setText(tr("Brewery name:"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
43 breweryEdit = new QLineEdit(topWidget);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
44 breweryEdit->setObjectName(QString::fromUtf8("breweryEdit"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
45 breweryEdit->setGeometry(QRect(212, 20, 941, 23));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
46 breweryEdit->setToolTip(tr("The name for this brewery."));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
47
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
48 line = new QFrame(topWidget);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
49 line->setObjectName(QString::fromUtf8("line"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
50 line->setGeometry(QRect(0, 60, 1251, 20));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
51 line->setFrameShape(QFrame::HLine);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
52 line->setFrameShadow(QFrame::Sunken);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
53
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
54 fwhLabel = new QLabel(topWidget);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
55 fwhLabel->setObjectName(QString::fromUtf8("fwhLabel"));
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: 344
diff changeset
56 fwhLabel->setGeometry(QRect(10, 120, 181, 20));
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
57 fwhLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
58 fwhLabel->setText(tr("First Wort Hop factor:"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
59
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
60 mashhopLabel = new QLabel(topWidget);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
61 mashhopLabel->setObjectName(QString::fromUtf8("mashhopLabel"));
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: 344
diff changeset
62 mashhopLabel->setGeometry(QRect(10, 150, 181, 20));
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
63 mashhopLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
64 mashhopLabel->setText(tr("Mash Hop factor:"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
65
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
66 pelletLabel = new QLabel(topWidget);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
67 pelletLabel->setObjectName(QString::fromUtf8("pelletLabel"));
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: 344
diff changeset
68 pelletLabel->setGeometry(QRect(10, 210, 181, 20));
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
69 pelletLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
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: 344
diff changeset
70 pelletLabel->setText(tr("Hop Pellets utilisation:"));
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
71
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
72 hopplugLabel = new QLabel(topWidget);
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: 344
diff changeset
73 hopplugLabel->setObjectName(QString::fromUtf8("plugsLabel"));
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: 344
diff changeset
74 hopplugLabel->setGeometry(QRect(10, 240, 181, 20));
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
75 hopplugLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
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: 344
diff changeset
76 hopplugLabel->setText(tr("Hop Plugs utilisation:"));
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: 344
diff changeset
77
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: 344
diff changeset
78 leafLabel = new QLabel(topWidget);
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: 344
diff changeset
79 leafLabel->setObjectName(QString::fromUtf8("leafLabel"));
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: 344
diff changeset
80 leafLabel->setGeometry(QRect(10, 270, 181, 20));
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: 344
diff changeset
81 leafLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
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: 344
diff changeset
82 leafLabel->setText(tr("Hop Leafs utilisation:"));
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
83
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
84 wethopLabel = new QLabel(topWidget);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
85 wethopLabel->setObjectName(QString::fromUtf8("wethopLabel"));
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: 344
diff changeset
86 wethopLabel->setGeometry(QRect(10, 300, 181, 20));
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
87 wethopLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
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: 344
diff changeset
88 wethopLabel->setText(tr("Wet Hop utilisation:"));
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
89
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
90 cryohopLabel = new QLabel(topWidget);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
91 cryohopLabel->setObjectName(QString::fromUtf8("cryohopLabel"));
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: 344
diff changeset
92 cryohopLabel->setGeometry(QRect(10, 330, 181, 20));
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
93 cryohopLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
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: 344
diff changeset
94 cryohopLabel->setText(tr("Cryo Hop\302\256 utilisation:"));
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: 344
diff changeset
95
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: 344
diff changeset
96 extractLabel = new QLabel(topWidget);
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: 344
diff changeset
97 extractLabel->setObjectName(QString::fromUtf8("extractLabel"));
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: 344
diff changeset
98 extractLabel->setGeometry(QRect(10, 360, 181, 20));
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: 344
diff changeset
99 extractLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
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: 344
diff changeset
100 extractLabel->setText(tr("CO2 Hop Extract utilisation:"));
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: 344
diff changeset
101
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
102
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
103 fwhEdit = new QSpinBox(topWidget);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
104 fwhEdit->setObjectName(QString::fromUtf8("fwhEdit"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
105 fwhEdit->setGeometry(QRect(210, 120, 81, 24));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
106 fwhEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
107 fwhEdit->setAccelerated(true);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
108 fwhEdit->setMinimum(-50);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
109 fwhEdit->setMaximum(50);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
110 fwhEdit->setToolTip(tr("The efficiency for First Wort Hopping."));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
111 fwhEdit->setSuffix(tr("%"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
112
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
113 mashhopEdit = new QSpinBox(topWidget);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
114 mashhopEdit->setObjectName(QString::fromUtf8("mashhopEdit"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
115 mashhopEdit->setGeometry(QRect(210, 150, 81, 24));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
116 mashhopEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
117 mashhopEdit->setAccelerated(true);
344
9ffac162000c Setting mash hopping efficiency now between -95 and +50. Refresh all after changing the IBU method. Added own part for Mash Hopping. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 337
diff changeset
118 mashhopEdit->setMinimum(-95);
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
119 mashhopEdit->setMaximum(50);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
120 mashhopEdit->setToolTip(tr("The efficiency for Mash hopping."));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
121 mashhopEdit->setSuffix(tr("%"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
122
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: 344
diff changeset
123 pelletEdit = new QDoubleSpinBox(topWidget);
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
124 pelletEdit->setObjectName(QString::fromUtf8("pelletEdit"));
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: 344
diff changeset
125 pelletEdit->setGeometry(QRect(210, 210, 81, 24));
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
126 pelletEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
127 pelletEdit->setAccelerated(true);
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: 344
diff changeset
128 pelletEdit->setMaximum(100);
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: 344
diff changeset
129 pelletEdit->setDecimals(1);
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: 344
diff changeset
130 pelletEdit->setToolTip(tr("The utilisation for hop pellets, default 22"));
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
131 pelletEdit->setSuffix(tr("%"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
132
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: 344
diff changeset
133 hopplugEdit = new QDoubleSpinBox(topWidget);
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
134 hopplugEdit->setObjectName(QString::fromUtf8("hopplugEdit"));
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: 344
diff changeset
135 hopplugEdit->setGeometry(QRect(210, 240, 81, 24));
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
136 hopplugEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
137 hopplugEdit->setAccelerated(true);
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: 344
diff changeset
138 hopplugEdit->setMaximum(100);
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: 344
diff changeset
139 hopplugEdit->setDecimals(1);
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: 344
diff changeset
140 hopplugEdit->setToolTip(tr("The utilisation for hop plugs, default 20.4"));
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
141 hopplugEdit->setSuffix(tr("%"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
142
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: 344
diff changeset
143 leafEdit = new QDoubleSpinBox(topWidget);
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: 344
diff changeset
144 leafEdit->setObjectName(QString::fromUtf8("leafEdit"));
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: 344
diff changeset
145 leafEdit->setGeometry(QRect(210, 270, 81, 24));
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: 344
diff changeset
146 leafEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
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: 344
diff changeset
147 leafEdit->setAccelerated(true);
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: 344
diff changeset
148 leafEdit->setMaximum(100);
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: 344
diff changeset
149 leafEdit->setDecimals(1);
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: 344
diff changeset
150 leafEdit->setToolTip(tr("The utilisation for hop leafs, default 20"));
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: 344
diff changeset
151 leafEdit->setSuffix(tr("%"));
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: 344
diff changeset
152
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: 344
diff changeset
153 wethopEdit = new QDoubleSpinBox(topWidget);
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
154 wethopEdit->setObjectName(QString::fromUtf8("wethopEdit"));
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: 344
diff changeset
155 wethopEdit->setGeometry(QRect(210, 300, 81, 24));
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
156 wethopEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
157 wethopEdit->setAccelerated(true);
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: 344
diff changeset
158 wethopEdit->setMaximum(100);
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: 344
diff changeset
159 wethopEdit->setDecimals(1);
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: 344
diff changeset
160 wethopEdit->setToolTip(tr("The uyilisation for fresh hops, default 3.6"));
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
161 wethopEdit->setSuffix(tr("%"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
162
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: 344
diff changeset
163 cryohopEdit = new QDoubleSpinBox(topWidget);
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
164 cryohopEdit->setObjectName(QString::fromUtf8("cryohopEdit"));
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: 344
diff changeset
165 cryohopEdit->setGeometry(QRect(210, 330, 81, 24));
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
166 cryohopEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
167 cryohopEdit->setAccelerated(true);
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: 344
diff changeset
168 cryohopEdit->setMaximum(100);
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: 344
diff changeset
169 cryohopEdit->setDecimals(1);
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: 344
diff changeset
170 cryohopEdit->setToolTip(tr("The utilisation for using Cryo Hop\302\256, default 50"));
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
171 cryohopEdit->setSuffix(tr("%"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
172
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: 344
diff changeset
173 extractEdit = new QDoubleSpinBox(topWidget);
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: 344
diff changeset
174 extractEdit->setObjectName(QString::fromUtf8("extractEdit"));
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: 344
diff changeset
175 extractEdit->setGeometry(QRect(210, 360, 81, 24));
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: 344
diff changeset
176 extractEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
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: 344
diff changeset
177 extractEdit->setAccelerated(true);
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: 344
diff changeset
178 extractEdit->setMaximum(100);
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: 344
diff changeset
179 extractEdit->setDecimals(1);
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: 344
diff changeset
180 extractEdit->setToolTip(tr("The utilisation for using CO2 hop extract, default 35"));
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: 344
diff changeset
181 extractEdit->setSuffix(tr("%"));
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: 344
diff changeset
182
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
183 grainLabel = new QLabel(topWidget);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
184 grainLabel->setObjectName(QString::fromUtf8("grainLabel"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
185 grainLabel->setGeometry(QRect(400, 120, 161, 20));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
186 grainLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
187 grainLabel->setText(tr("Grain Absorbtion:"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
188
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
189 brixLabel = new QLabel(topWidget);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
190 brixLabel->setObjectName(QString::fromUtf8("brixLabel"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
191 brixLabel->setGeometry(QRect(400, 150, 161, 20));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
192 brixLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
193 brixLabel->setText(tr("Brix Correction factor:"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
194
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: 336
diff changeset
195 heightLabel = new QLabel(topWidget);
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: 336
diff changeset
196 heightLabel->setObjectName(QString::fromUtf8("heightLabel"));
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: 336
diff changeset
197 heightLabel->setGeometry(QRect(400, 180, 161, 20));
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: 336
diff changeset
198 heightLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
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: 336
diff changeset
199 heightLabel->setText(tr("Brewery height meters:"));
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: 336
diff changeset
200
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
201 titleLabel = new QLabel(topWidget);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
202 titleLabel->setObjectName(QString::fromUtf8("titleLabel"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
203 titleLabel->setGeometry(QRect(5, 80, 1251, 20));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
204 QFont font;
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
205 font.setFamily(QString::fromUtf8("DejaVu Sans"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
206 font.setPointSize(12);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
207 font.setBold(true);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
208 font.setWeight(75);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
209 titleLabel->setFont(font);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
210 titleLabel->setAlignment(Qt::AlignCenter);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
211 titleLabel->setText(tr("Brew settings."));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
212
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
213 colorLabel = new QLabel(topWidget);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
214 colorLabel->setObjectName(QString::fromUtf8("colorLabel"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
215 colorLabel->setGeometry(QRect(800, 120, 121, 16));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
216 colorLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
217 colorLabel->setText(tr("Color Calculation:"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
218
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
219 ibuLabel = new QLabel(topWidget);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
220 ibuLabel->setObjectName(QString::fromUtf8("ibuLabel"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
221 ibuLabel->setGeometry(QRect(800, 150, 121, 16));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
222 ibuLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
223 ibuLabel->setText(tr("IBU Calculation:"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
224
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
225 waterLabel = new QLabel(topWidget);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
226 waterLabel->setObjectName(QString::fromUtf8("waterLabel"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
227 waterLabel->setGeometry(QRect(800, 180, 121, 16));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
228 waterLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
229 waterLabel->setText(tr("Default Water:"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
230
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
231 yeastLabel = new QLabel(topWidget);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
232 yeastLabel->setObjectName(QString::fromUtf8("yeastLabel"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
233 yeastLabel->setGeometry(QRect(800, 210, 121, 16));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
234 yeastLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
235 yeastLabel->setText(tr("Private Yeast bank:"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
236
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
237 grainEdit = new QDoubleSpinBox(topWidget);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
238 grainEdit->setObjectName(QString::fromUtf8("grainEdit"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
239 grainEdit->setGeometry(QRect(580, 120, 101, 24));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
240 grainEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
241 grainEdit->setAccelerated(true);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
242 grainEdit->setMinimum(0.500000000000000);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
243 grainEdit->setMaximum(1.100000000000000);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
244 grainEdit->setSingleStep(0.010000000000000);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
245 grainEdit->setStepType(QAbstractSpinBox::DefaultStepType);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
246 grainEdit->setValue(1.000000000000000);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
247 grainEdit->setToolTip(tr("Absorbtion with water by the grain (L/Kg)"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
248 grainEdit->setSuffix(tr(" L/Kg"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
249
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
250 brixEdit = new QDoubleSpinBox(topWidget);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
251 brixEdit->setObjectName(QString::fromUtf8("brixEdit"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
252 brixEdit->setGeometry(QRect(580, 150, 101, 24));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
253 brixEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
254 brixEdit->setAccelerated(true);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
255 brixEdit->setMinimum(1.000000000000000);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
256 brixEdit->setMaximum(1.090000000000000);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
257 brixEdit->setSingleStep(0.010000000000000);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
258 brixEdit->setStepType(QAbstractSpinBox::DefaultStepType);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
259 brixEdit->setValue(1.000000000000000);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
260 brixEdit->setToolTip(tr("Plato to Brix conversion factor."));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
261
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: 336
diff changeset
262 heightEdit = new QSpinBox(topWidget);
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: 336
diff changeset
263 heightEdit->setObjectName(QString::fromUtf8("heightEdit"));
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: 336
diff changeset
264 heightEdit->setGeometry(QRect(580, 180, 101, 24));
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: 336
diff changeset
265 heightEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
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: 336
diff changeset
266 heightEdit->setAccelerated(true);
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: 336
diff changeset
267 heightEdit->setMinimum(-430);
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: 336
diff changeset
268 heightEdit->setMaximum(8849);
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: 336
diff changeset
269 heightEdit->setStepType(QAbstractSpinBox::DefaultStepType);
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: 336
diff changeset
270 heightEdit->setValue(0);
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: 336
diff changeset
271 heightEdit->setToolTip(tr("Height in meters above/below sealevel to calculate the exact boiling point and hop isomerizon."));
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: 336
diff changeset
272
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
273 colorEdit = new QComboBox(topWidget);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
274 colorEdit->setObjectName(QString::fromUtf8("colorEdit"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
275 colorEdit->setGeometry(QRect(940, 120, 161, 23));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
276 colorEdit->setMinimumContentsLength(4);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
277 colorEdit->setIconSize(QSize(0, 0));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
278 colorEdit->setCurrentText(QString());
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
279 colorEdit->setPlaceholderText(tr("Choose color"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
280
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
281 ibuEdit = new QComboBox(topWidget);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
282 ibuEdit->setObjectName(QString::fromUtf8("ibuEdit"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
283 ibuEdit->setGeometry(QRect(940, 150, 161, 23));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
284 ibuEdit->setMinimumContentsLength(4);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
285 ibuEdit->setIconSize(QSize(0, 0));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
286 ibuEdit->setCurrentText(QString());
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
287 ibuEdit->setPlaceholderText(tr("Choose color"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
288
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
289 waterEdit = new QComboBox(topWidget);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
290 waterEdit->setObjectName(QString::fromUtf8("waterEdit"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
291 waterEdit->setGeometry(QRect(940, 180, 211, 23));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
292 waterEdit->setMinimumContentsLength(4);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
293 waterEdit->setIconSize(QSize(0, 0));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
294 waterEdit->setCurrentText(QString());
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
295 waterEdit->setPlaceholderText(tr("Choose color"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
296
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
297 yeastEdit = new QComboBox(topWidget);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
298 yeastEdit->setObjectName(QString::fromUtf8("yeastEdit"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
299 yeastEdit->setGeometry(QRect(940, 210, 211, 23));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
300 yeastEdit->setMinimumContentsLength(4);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
301 yeastEdit->setIconSize(QSize(0, 0));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
302 yeastEdit->setCurrentText(QString());
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
303 yeastEdit->setPlaceholderText(tr("Choose color"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
304
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
305 logoLabel = new QLabel(topWidget);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
306 logoLabel->setObjectName(QString::fromUtf8("logoLabel"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
307 logoLabel->setGeometry(QRect(940, 260, 211, 211));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
308 logoLabel->setAlignment(Qt::AlignCenter);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
309 logoLabel->setText(tr("Logo here"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
310
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
311 quitButton = new QPushButton(topWidget);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
312 quitButton->setObjectName(QString::fromUtf8("quitButton"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
313 quitButton->setGeometry(QRect(50, 520, 80, 23));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
314 QIcon icon;
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
315 icon.addFile(QString::fromUtf8(":icons/silk/door_out.png"), QSize(), QIcon::Normal, QIcon::Off);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
316 quitButton->setIcon(icon);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
317 quitButton->setText(tr("Quit"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
318
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
319 saveButton = new QPushButton(topWidget);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
320 saveButton->setObjectName(QString::fromUtf8("saveButton"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
321 saveButton->setGeometry(QRect(200, 520, 80, 23));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
322 QIcon icon1;
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
323 icon1.addFile(QString::fromUtf8(":icons/silk/disk.png"), QSize(), QIcon::Normal, QIcon::Off);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
324 saveButton->setIcon(icon1);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
325 saveButton->setText(tr("Save"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
326 saveButton->setEnabled(false);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
327
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
328 openButton = new QPushButton(topWidget);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
329 openButton->setObjectName(QString::fromUtf8("openButton"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
330 openButton->setGeometry(QRect(810, 260, 111, 23));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
331 QIcon icon2;
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
332 icon2.addFile(QString::fromUtf8(":/icons/silk/folder_picture.png"), QSize(), QIcon::Normal, QIcon::Off);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
333 openButton->setIcon(icon2);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
334 openButton->setText(tr("Load logo"));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
335
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
336 gridLayout->addWidget(topWidget, 0, 0, 1, 1);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
337
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
338 connect(quitButton, SIGNAL(clicked()), this, SLOT(on_quitButton_clicked()));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
339 connect(saveButton, SIGNAL(clicked()), this, SLOT(on_saveButton_clicked()));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
340 connect(openButton, SIGNAL(clicked()), this, SLOT(on_openButton_clicked()));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
341 connect(this, SIGNAL(firstWindow()), parent, SLOT(fromSetup()));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
342 connect(this, SIGNAL(setTitle(QString)), parent, SLOT(windowTitle(QString)));
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
343
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
344 emit setTitle(QString(tr("Setup")));
15
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
345
16
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
346 query.prepare("SELECT * FROM profile_setup WHERE record='1'");
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
347 query.exec();
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
348 query.next();
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
349
309
8678a0731737 Using names for profile_setup query
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
350 breweryEdit->setText(query.value("brewery_name").toString()); // max 128
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
351 connect(breweryEdit, &QLineEdit::textChanged, this, &Setup::is_changed);
16
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
352
309
8678a0731737 Using names for profile_setup query
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
353 fwhEdit->setValue(query.value("factor_fwh").toInt());
8678a0731737 Using names for profile_setup query
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
354 mashhopEdit->setValue(query.value("factor_mashhop").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: 344
diff changeset
355 pelletEdit->setValue(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: 344
diff changeset
356 hopplugEdit->setValue(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: 344
diff changeset
357 leafEdit->setValue(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: 344
diff changeset
358 wethopEdit->setValue(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: 344
diff changeset
359 cryohopEdit->setValue(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: 344
diff changeset
360 extractEdit->setValue(query.value("ut_co2extract").toDouble());
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
361 connect(fwhEdit, &QSpinBox::textChanged, this, &Setup::is_changed);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
362 connect(mashhopEdit, &QSpinBox::textChanged, this, &Setup::is_changed);
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: 344
diff changeset
363 connect(pelletEdit, &QDoubleSpinBox::textChanged, this, &Setup::is_changed);
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: 344
diff changeset
364 connect(hopplugEdit, &QDoubleSpinBox::textChanged, this, &Setup::is_changed);
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: 344
diff changeset
365 connect(leafEdit, &QDoubleSpinBox::textChanged, this, &Setup::is_changed);
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: 344
diff changeset
366 connect(wethopEdit, &QDoubleSpinBox::textChanged, this, &Setup::is_changed);
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: 344
diff changeset
367 connect(cryohopEdit, &QDoubleSpinBox::textChanged, this, &Setup::is_changed);
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: 344
diff changeset
368 connect(extractEdit, &QDoubleSpinBox::textChanged, this, &Setup::is_changed);
16
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
369
309
8678a0731737 Using names for profile_setup query
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
370 grainEdit->setValue(query.value("grain_absorbtion").toDouble());
8678a0731737 Using names for profile_setup query
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
371 brixEdit->setValue(query.value("brix_correction").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: 336
diff changeset
372 heightEdit->setValue(query.value("brewery_height").toInt());
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
373 connect(grainEdit, &QDoubleSpinBox::textChanged, this, &Setup::is_changed);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
374 connect(brixEdit, &QDoubleSpinBox::textChanged, this, &Setup::is_changed);
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: 336
diff changeset
375 connect(heightEdit, &QSpinBox::textChanged, this, &Setup::is_changed);
16
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
376
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
377 colorEdit->addItem("Morey");
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
378 colorEdit->addItem("Mosher");
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
379 colorEdit->addItem("Daniels");
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
380 colorEdit->addItem("Halberstadt");
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
381 colorEdit->addItem("Naudts");
309
8678a0731737 Using names for profile_setup query
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
382 colorEdit->setCurrentIndex(query.value("color_method").toInt());
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
383 connect(colorEdit, &QComboBox::currentTextChanged, this, &Setup::is_changed);
16
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
384
336
e97f9e87d94b IBU method names are now global.
Michiel Broek <mbroek@mbse.eu>
parents: 309
diff changeset
385 for (int i = 0; i < 3; i++)
e97f9e87d94b IBU method names are now global.
Michiel Broek <mbroek@mbse.eu>
parents: 309
diff changeset
386 ibuEdit->addItem(g_ibu_method[i]);
309
8678a0731737 Using names for profile_setup query
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
387 ibuEdit->setCurrentIndex(query.value("ibu_method").toInt());
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
388 connect(ibuEdit, &QComboBox::currentTextChanged, this, &Setup::is_changed);
16
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
389
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
390 QSqlQuery query2("SELECT record,name FROM inventory_waters");
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
391 query2.first();
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
392 int pos = -1;
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
393 waterEdit->setEditable(true);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
394 waterEdit->setPlaceholderText(tr("Choose default water"));
16
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
395 for (int i = 0 ; i < query2.size() ; i++ ) {
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
396 waterEdit->addItem(query2.value(1).toString());
309
8678a0731737 Using names for profile_setup query
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
397 if (query2.value(0).toInt() == query.value("default_water").toInt()) {
16
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
398 pos = i;
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
399 }
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
400 query2.next();
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
401 }
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
402 if (pos >= 0)
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
403 waterEdit->setCurrentIndex(pos);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
404 connect(waterEdit, &QComboBox::currentTextChanged, this, &Setup::is_changed);
16
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
405
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
406 QSqlQuery query3("SELECT DISTINCT laboratory FROM inventory_yeasts ORDER BY laboratory");
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
407 query3.first();
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
408 pos = -1;
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
409 yeastEdit->setEditable(true);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
410 yeastEdit->setPlaceholderText(tr("Choose laboratory"));
16
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
411 for (int i = 0 ; i < query3.size() ; i++ ) {
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
412 yeastEdit->addItem(query3.value(0).toString());
309
8678a0731737 Using names for profile_setup query
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
413 if (QString::compare(query.value("my_yeastlab").toString(), query3.value(0).toString(), Qt::CaseSensitive) == 0)
16
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
414 pos = i;
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
415 query3.next();
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
416 }
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
417 if (pos >= 0)
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
418 yeastEdit->setCurrentIndex(pos);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
419 connect(yeastEdit, &QComboBox::currentTextChanged, this, &Setup::is_changed);
16
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
420
41
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
421 /* logo */
309
8678a0731737 Using names for profile_setup query
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
422 logoByteArray = query.value("brewery_logo").toByteArray();
41
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
423 QPixmap outPixmap = QPixmap();
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
424 outPixmap.loadFromData(logoByteArray);
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
425 logoLabel->setPixmap(outPixmap);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
426 logoLabel->adjustSize();
15
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
427 }
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
428
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
429
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
430 Setup::~Setup() {}
15
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
431
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
432
41
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
433 bool Setup::loadFile(const QString &fileName)
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
434 {
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
435 QImageReader reader(fileName);
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
436 reader.setAutoTransform(true);
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
437 const QImage newImage = reader.read();
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
438 if (newImage.isNull()) {
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
439 QMessageBox::information(this, QGuiApplication::applicationDisplayName(), tr("Cannot load %1: %2")
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
440 .arg(QDir::toNativeSeparators(fileName), reader.errorString()));
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
441 return false;
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
442 }
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
443 setImage(newImage);
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
444 setWindowFilePath(fileName);
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
445 is_changed();
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
446 return true;
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
447 }
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
448
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
449
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
450 void Setup::setImage(const QImage &newImage)
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
451 {
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
452 image = newImage;
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
453
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
454 qDebug() << "setImage" << image.width() << image.height() << "size" << image.sizeInBytes();
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
455
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
456 QBuffer buffer(&logoByteArray);
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
457 buffer.open(QIODevice::WriteOnly);
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
458 image.save(&buffer, "PNG"); // writes image into logoByteArray in PNG format
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
459
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
460 this->logoLabel->setPixmap(QPixmap::fromImage(image));
41
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
461 scaleFactor = 1.0;
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
462
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
463 // this->logoLabel->resize(scaleFactor * ui->logoLabel->pixmap(Qt::ReturnByValue).size());
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
464 this->logoLabel->adjustSize();
41
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
465 }
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
466
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
467
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
468 void Setup::on_openButton_clicked()
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
469 {
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
470 static bool firstDialog = true;
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
471
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
472 qDebug() << "Setup open";
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
473
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
474 QFileDialog dialog(this, tr("Open File"));
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
475
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
476 if (firstDialog) {
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
477 firstDialog = false;
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
478 const QStringList picturesLocations = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation);
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
479 dialog.setDirectory(picturesLocations.isEmpty() ? QDir::currentPath() : picturesLocations.last());
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
480 }
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
481
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
482 /* Only a few image formats are valid */
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
483 QStringList mimeTypeFilters ({ "image/bmp", "image/gif", "image/jpeg", "image/png", "image/svg+xml" });
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
484 dialog.setMimeTypeFilters(mimeTypeFilters);
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
485 dialog.setNameFilter("Images (*.bmp *.BMP *.gif *.GIF *.jpg *.JPG *.png *.PNG *.svg *.SVG)");
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
486 dialog.setAcceptMode(QFileDialog::AcceptOpen);
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
487
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
488 while (dialog.exec() == QDialog::Accepted && !loadFile(dialog.selectedFiles().constFirst())) {}
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
489 }
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
490
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
491
16
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
492 /*
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
493 * Also called from the Quit button if there are changes to save.
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
494 */
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
495 void Setup::on_saveButton_clicked()
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
496 {
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
497 QSqlQuery query;
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
498
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
499 /*
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
500 * Search record number of the current water.
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
501 */
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
502 query.prepare("SELECT record FROM inventory_waters WHERE name=:name");
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
503 query.bindValue(":name", this->waterEdit->currentText());
16
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
504 query.exec();
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
505 query.first();
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
506 int record = query.value(0).toInt();
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
507
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
508 /*
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
509 * Update all other data
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
510 */
41
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
511 query.prepare("UPDATE profile_setup SET brewery_name=:brewery, brewery_logo=:logo, factor_mashhop=:mashhop, factor_fwh=:fwh, "
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: 344
diff changeset
512 "ut_pellet=:pellet, ut_plug=:plug, ut_leaf=:leaf, ut_wethop=:wet, ut_t45=:cryo, ut_co2extract=:extract, "
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: 344
diff changeset
513 "color_method=:color, ibu_method=:ibu, "
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: 336
diff changeset
514 "brix_correction=:brix, grain_absorbtion=:grain, default_water=:water, my_yeastlab=:yeast, "
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: 336
diff changeset
515 "brewery_height=:height WHERE record='1'");
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
516 query.bindValue(":brewery", this->breweryEdit->text());
41
dc4b659a320b Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents: 31
diff changeset
517 query.bindValue(":logo", logoByteArray);
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
518 query.bindValue(":mashhop", this->mashhopEdit->value());
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
519 query.bindValue(":fwh", this->fwhEdit->value());
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
520 query.bindValue(":pellet", this->pelletEdit->value());
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
521 query.bindValue(":plug", this->hopplugEdit->value());
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: 344
diff changeset
522 query.bindValue(":leaf", this->leafEdit->value());
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
523 query.bindValue(":wet", this->wethopEdit->value());
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
524 query.bindValue(":cryo", this->cryohopEdit->value());
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: 344
diff changeset
525 query.bindValue(":extract", this->extractEdit->value());
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
526 query.bindValue(":color", this->colorEdit->currentIndex());
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
527 query.bindValue(":ibu", this->ibuEdit->currentIndex());
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
528 query.bindValue(":brix", this->brixEdit->value());
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
529 query.bindValue(":grain", this->grainEdit->value());
16
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
530 query.bindValue(":water", record);
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
531 query.bindValue(":yeast", this->yeastEdit->currentText());
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: 336
diff changeset
532 query.bindValue(":height", this->heightEdit->value());
16
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
533 query.exec();
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
534 if (query.lastError().isValid()) {
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
535 qDebug() << "Setup Save error:" << query.lastError();
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
536 QMessageBox::warning(this, tr("Database error"),
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
537 tr("MySQL error: %1\n%2\n%3")
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
538 .arg(query.lastError().nativeErrorCode())
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
539 .arg(query.lastError().driverText())
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
540 .arg(query.lastError().databaseText()));
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
541 } else {
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
542 qDebug() << "Setup Saved";
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
543 }
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
544
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
545 this->fieldIsChanged = false;
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
546 saveButton->setEnabled(false);
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
547 emit setTitle(QString(tr("Setup")));
16
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
548 }
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
549
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
550
15
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
551 void Setup::on_quitButton_clicked()
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
552 {
16
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
553 if (this->fieldIsChanged) {
60
0d65238ebedc Updated translations and some messages.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
554 int rc = QMessageBox::warning(this, tr("Setup changed"), tr("The global setup has been modified. Save changes?"),
16
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
555 QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Save);
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
556 switch (rc) {
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
557 case QMessageBox::Save:
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
558 on_saveButton_clicked();
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
559 break; /* Saved and then Quit */
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
560 case QMessageBox::Discard:
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
561 break; /* Quit without Save */
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
562 case QMessageBox::Cancel:
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
563 return; /* Return to the setup page */
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
564 }
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
565 }
15
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
566 emit firstWindow();
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
567 }
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
568
16
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
569
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
570 void Setup::is_changed()
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
571 {
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
572 saveButton->setEnabled(true);
16
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
573 this->fieldIsChanged = true;
78
3a6cba2dd05d Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
574 emit setTitle(QString(tr("Setup") + " **"));
16
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
575 }

mercurial