Tue, 24 Jan 2023 15:57:13 +0100
Delete images from a producti first[C when a product is deleted.
24 | 1 | /** |
2 | * EditHop.cpp is part of bmsapp. | |
3 | * | |
4 | * bmsapp is free software: you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation, either version 3 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * bmsapp is distributed in the hope that it will be useful, | |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
13 | * | |
14 | * You should have received a copy of the GNU General Public License | |
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | */ | |
17 | #include "EditHop.h" | |
18 | #include "../ui/ui_EditHop.h" | |
90
2396457a8167
Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents:
60
diff
changeset
|
19 | #include "MainWindow.h" |
373
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
20 | #include "global.h" |
24 | 21 | |
22 | ||
23 | EditHop::EditHop(int id, QWidget *parent) : QDialog(parent), ui(new Ui::EditHop) | |
24 | { | |
25 | QSqlQuery query; | |
26 | ||
27 | qDebug() << "EditHop record:" << id; | |
28 | ui->setupUi(this); | |
29 | this->recno = id; | |
30 | ||
373
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
31 | for (int i = 0; i < 3; i++) |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
32 | ui->typeEdit->addItem(QCoreApplication::translate("HopTypes", g_hop_types[i])); |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
33 | for (int i = 0; i < 7; i++) |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
34 | ui->formEdit->addItem(QCoreApplication::translate("HopForm", g_hop_forms[i])); |
24 | 35 | |
36 | if (id >= 0) { | |
37 | query.prepare("SELECT * FROM inventory_hops WHERE record = :recno"); | |
38 | query.bindValue(":recno", id); | |
39 | query.exec(); | |
40 | query.next(); | |
41 | ||
373
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
42 | ui->nameEdit->setText(query.value("name").toString()); |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
43 | ui->alphaEdit->setValue(query.value("alpha").toDouble()); |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
44 | ui->betaEdit->setValue(query.value("beta").toDouble()); |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
45 | ui->humuleneEdit->setValue(query.value("humulene").toDouble()); |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
46 | ui->caryEdit->setValue(query.value("caryophyllene").toDouble()); |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
47 | ui->cohumuloneEdit->setValue(query.value("cohumulone").toDouble()); |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
48 | ui->myrceneEdit->setValue(query.value("myrcene").toDouble()); |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
49 | ui->hsiEdit->setValue(query.value("hsi").toDouble()); |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
50 | ui->typeEdit->setCurrentIndex(query.value("type").toInt()); |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
51 | ui->formEdit->setCurrentIndex(query.value("form").toInt()); |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
52 | ui->notesEdit->setPlainText(query.value("notes").toString()); |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
53 | ui->originEdit->setText(query.value("origin").toString()); |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
54 | ui->substitutesEdit->setText(query.value("substitutes").toString()); |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
55 | ui->alwaysEdit->setChecked(query.value("always_on_stock").toInt() ? true:false); |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
56 | ui->inventoryEdit->setValue(query.value("inventory").toDouble()); |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
57 | ui->costEdit->setValue(query.value("cost").toDouble()); |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
58 | ui->valueEdit->setValue(query.value("inventory").toDouble() * query.value("cost").toDouble()); |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
59 | if (query.value("production_date").toString().length() == 10) { |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
60 | ui->prodEdit->setDate(query.value("production_date").toDate()); |
24 | 61 | } else { |
62 | ui->prodEdit->clear(); | |
63 | } | |
373
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
64 | if (query.value("tht_date").toString().length() == 10) { |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
65 | ui->thtEdit->setDate(query.value("tht_date").toDate()); |
24 | 66 | } else { |
67 | ui->thtEdit->clear(); | |
68 | } | |
373
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
69 | ui->oilEdit->setValue(query.value("total_oil").toDouble()); |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
70 | ui->utilisationEdit->setValue(query.value("utilisation").toDouble()); |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
71 | ui->bufactorEdit->setValue(query.value("bu_factor").toDouble()); |
24 | 72 | } else { |
73 | /* Set some defaults */ | |
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:
377
diff
changeset
|
74 | ui->typeEdit->setCurrentIndex(HOP_TYPE_BITTERING); |
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:
377
diff
changeset
|
75 | ui->formEdit->setCurrentIndex(HOP_FORMS_PELLET); |
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:
377
diff
changeset
|
76 | ui->utilisationEdit->setValue(my_ut_pellet); |
373
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
77 | ui->bufactorEdit->setValue(1.0); |
24 | 78 | ui->prodEdit->clear(); |
79 | ui->thtEdit->clear(); | |
80 | } | |
81 | connect(ui->nameEdit, &QLineEdit::textChanged, this, &EditHop::is_changed); | |
82 | connect(ui->alphaEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed); | |
83 | connect(ui->betaEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed); | |
84 | connect(ui->humuleneEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed); | |
85 | connect(ui->caryEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed); | |
86 | connect(ui->cohumuloneEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed); | |
87 | connect(ui->myrceneEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed); | |
88 | connect(ui->hsiEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed); | |
89 | connect(ui->typeEdit, &QComboBox::currentTextChanged, this, &EditHop::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:
377
diff
changeset
|
90 | connect(ui->formEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditHop::form_changed); |
24 | 91 | connect(ui->notesEdit, SIGNAL(textChanged()), this, SLOT(is_changed())); |
92 | connect(ui->originEdit, &QLineEdit::textChanged, this, &EditHop::is_changed); | |
93 | connect(ui->substitutesEdit, &QLineEdit::textChanged, this, &EditHop::is_changed); | |
94 | connect(ui->alwaysEdit, &QCheckBox::stateChanged, this, &EditHop::is_changed); | |
95 | connect(ui->inventoryEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed); | |
96 | connect(ui->costEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed); | |
97 | connect(ui->prodEdit, &QDateEdit::dateChanged, this, &EditHop::is_changed); | |
292
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
98 | connect(ui->prodButton1, SIGNAL(clicked()), this, SLOT(prod_date_today())); |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
99 | connect(ui->prodButton2, SIGNAL(clicked()), this, SLOT(prod_date_clear())); |
24 | 100 | connect(ui->thtEdit, &QDateEdit::dateChanged, this, &EditHop::is_changed); |
292
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
101 | connect(ui->thtButton1, SIGNAL(clicked()), this, SLOT(tht_date_today())); |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
102 | connect(ui->thtButton2, SIGNAL(clicked()), this, SLOT(tht_date_clear())); |
24 | 103 | connect(ui->oilEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed); |
373
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
104 | connect(ui->utilisationEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed); |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
105 | connect(ui->bufactorEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed); |
24 | 106 | |
107 | ui->saveButton->setEnabled(false); | |
108 | ui->deleteButton->setEnabled((ui->inventoryEdit->value() == 0 && id >= 0) ? true:false); | |
373
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
109 | |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
110 | WindowTitle(); |
24 | 111 | } |
112 | ||
113 | ||
114 | EditHop::~EditHop() | |
115 | { | |
116 | delete ui; | |
117 | emit entry_changed(); | |
118 | } | |
119 | ||
120 | ||
121 | /* | |
122 | * Window header, mark any change with '**' | |
123 | */ | |
124 | void EditHop::WindowTitle() | |
125 | { | |
126 | QString txt; | |
127 | ||
128 | if (this->recno < 0) { | |
129 | txt = QString(tr("BMSapp - Add new hop")); | |
130 | } else { | |
131 | txt = QString(tr("BMSapp - Edit hop %1").arg(this->recno)); | |
132 | } | |
133 | ||
134 | if (this->textIsChanged) { | |
135 | txt.append((QString(" **"))); | |
136 | } | |
137 | setWindowTitle(txt); | |
138 | } | |
139 | ||
140 | ||
141 | void EditHop::on_saveButton_clicked() | |
142 | { | |
143 | QSqlQuery query; | |
373
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
144 | QString sql = ""; |
24 | 145 | |
146 | /* If there are errors in the form, show a message and do "return;" */ | |
147 | if (ui->nameEdit->text().length() < 2) { | |
148 | QMessageBox::warning(this, tr("Edit Hop"), tr("Name empty or too short.")); | |
149 | return; | |
150 | } | |
151 | if (ui->originEdit->text().length() < 2) { | |
152 | QMessageBox::warning(this, tr("Edit Hop"), tr("Origin empty or too short.")); | |
153 | return; | |
154 | } | |
155 | ||
156 | if (this->textIsChanged) { | |
157 | if (this->recno == -1) { | |
373
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
158 | sql = "INSERT INTO inventory_hops SET "; |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
159 | } else { |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
160 | sql = "UPDATE inventory_hops SET "; |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
161 | } |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
162 | sql.append("name=:name, alpha=:alpha, beta=:beta, " |
24 | 163 | "humulene=:humulene, caryophyllene=:cary, cohumulone=:cohumulone, myrcene=:myrcene, " |
164 | "hsi=:hsi, type=:type, form=:form, notes=:notes, origin=:origin, substitutes=:substitutes, " | |
165 | "always_on_stock=:always, inventory=:inventory, cost=:cost, production_date=:prod, " | |
373
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
166 | "tht_date=:tht, total_oil=:oil, utilisation=:utilisation, bu_factor=:bu_factor"); |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
167 | if (this->recno == -1) { |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
168 | sql.append(", uuid=:uuid"); |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
169 | } else { |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
170 | sql.append(" WHERE record = :recno"); |
24 | 171 | } |
373
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
172 | |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
173 | query.prepare(sql); |
24 | 174 | query.bindValue(":name", ui->nameEdit->text()); |
175 | query.bindValue(":alpha", QString("%1").arg(ui->alphaEdit->value(), 2, 'f', 1, '0')); | |
176 | query.bindValue(":beta", QString("%1").arg(ui->betaEdit->value(), 2, 'f', 1, '0')); | |
177 | query.bindValue(":humulene", QString("%1").arg(ui->humuleneEdit->value(), 2, 'f', 1, '0')); | |
178 | query.bindValue(":cary", QString("%1").arg(ui->caryEdit->value(), 2, 'f', 1, '0')); | |
179 | query.bindValue(":cohumulone", QString("%1").arg(ui->cohumuloneEdit->value(), 2, 'f', 1, '0')); | |
180 | query.bindValue(":myrcene", QString("%1").arg(ui->myrceneEdit->value(), 2, 'f', 1, '0')); | |
181 | query.bindValue(":hsi", QString("%1").arg(ui->hsiEdit->value(), 2, 'f', 1, '0')); | |
182 | query.bindValue(":type", ui->typeEdit->currentIndex()); | |
183 | query.bindValue(":form", ui->formEdit->currentIndex()); | |
184 | query.bindValue(":notes", ui->notesEdit->toPlainText()); | |
185 | query.bindValue(":origin", ui->originEdit->text()); | |
186 | query.bindValue(":substitutes", ui->substitutesEdit->text()); | |
187 | query.bindValue(":always", ui->alwaysEdit->isChecked() ? 1:0); | |
188 | query.bindValue(":inventory", QString("%1").arg(ui->inventoryEdit->value(), 5, 'f', 4, '0')); | |
189 | query.bindValue(":cost", QString("%1").arg(ui->costEdit->value(), 3, 'f', 2, '0')); | |
190 | /* Uses https://www.qtcentre.org/threads/17295-How-to-put-empty-value-in-QDateEdit */ | |
191 | query.bindValue(":prod", ui->prodEdit->nullDate()); | |
192 | query.bindValue(":tht", ui->thtEdit->nullDate()); | |
193 | query.bindValue(":oil", QString("%1").arg(ui->oilEdit->value(), 2, 'f', 1, '0')); | |
373
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
194 | query.bindValue(":utilisation", QString("%1").arg(ui->utilisationEdit->value(), 2, 'f', 1, '0')); |
b02aca4e926c
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents:
300
diff
changeset
|
195 | query.bindValue(":bu_factor", QString("%1").arg(ui->bufactorEdit->value(), 2, 'f', 1, '0')); |
24 | 196 | if (this->recno == -1) { |
197 | query.bindValue(":uuid", QUuid::createUuid().toString().mid(1, 36)); | |
198 | } else { | |
199 | query.bindValue(":recno", this->recno); | |
200 | } | |
201 | query.exec(); | |
202 | if (query.lastError().isValid()) { | |
385
09af9f46518f
All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents:
380
diff
changeset
|
203 | qWarning() << "EditHop" << query.lastError(); |
24 | 204 | QMessageBox::warning(this, tr("Database error"), |
205 | tr("MySQL error: %1\n%2\n%3") | |
206 | .arg(query.lastError().nativeErrorCode()) | |
207 | .arg(query.lastError().driverText()) | |
208 | .arg(query.lastError().databaseText())); | |
209 | } else { | |
210 | qDebug() << "EditHop Saved"; | |
211 | } | |
212 | } | |
213 | ||
214 | ui->saveButton->setEnabled(false); | |
215 | this->textIsChanged = false; | |
216 | WindowTitle(); | |
217 | } | |
218 | ||
219 | ||
377 | 220 | void EditHop::on_cloneButton_clicked() |
221 | { | |
222 | QSqlQuery query; | |
223 | ||
224 | QString sql = "INSERT INTO inventory_hops SET name=:name, alpha=:alpha, beta=:beta, " | |
225 | "humulene=:humulene, caryophyllene=:cary, cohumulone=:cohumulone, myrcene=:myrcene, " | |
226 | "hsi=:hsi, type=:type, form=:form, notes=:notes, origin=:origin, substitutes=:substitutes, " | |
227 | "always_on_stock=:always, inventory=:inventory, cost=:cost, production_date=:prod, " | |
228 | "tht_date=:tht, total_oil=:oil, utilisation=:utilisation, bu_factor=:bu_factor, uuid=:uuid"; | |
229 | ||
230 | query.prepare(sql); | |
231 | query.bindValue(":name", ui->nameEdit->text() + " [copy]"); | |
232 | query.bindValue(":alpha", QString("%1").arg(ui->alphaEdit->value(), 2, 'f', 1, '0')); | |
233 | query.bindValue(":beta", QString("%1").arg(ui->betaEdit->value(), 2, 'f', 1, '0')); | |
234 | query.bindValue(":humulene", QString("%1").arg(ui->humuleneEdit->value(), 2, 'f', 1, '0')); | |
235 | query.bindValue(":cary", QString("%1").arg(ui->caryEdit->value(), 2, 'f', 1, '0')); | |
236 | query.bindValue(":cohumulone", QString("%1").arg(ui->cohumuloneEdit->value(), 2, 'f', 1, '0')); | |
237 | query.bindValue(":myrcene", QString("%1").arg(ui->myrceneEdit->value(), 2, 'f', 1, '0')); | |
238 | query.bindValue(":hsi", QString("%1").arg(ui->hsiEdit->value(), 2, 'f', 1, '0')); | |
239 | query.bindValue(":type", ui->typeEdit->currentIndex()); | |
240 | query.bindValue(":form", ui->formEdit->currentIndex()); | |
241 | query.bindValue(":notes", ui->notesEdit->toPlainText()); | |
242 | query.bindValue(":origin", ui->originEdit->text()); | |
243 | query.bindValue(":substitutes", ui->substitutesEdit->text()); | |
244 | query.bindValue(":always", ui->alwaysEdit->isChecked() ? 1:0); | |
245 | query.bindValue(":inventory", QString("%1").arg(0, 5, 'f', 4, '0')); | |
246 | query.bindValue(":cost", QString("%1").arg(ui->costEdit->value(), 3, 'f', 2, '0')); | |
247 | query.bindValue(":prod", QDate()); | |
248 | query.bindValue(":tht", QDate()); | |
249 | query.bindValue(":oil", QString("%1").arg(ui->oilEdit->value(), 2, 'f', 1, '0')); | |
250 | query.bindValue(":utilisation", QString("%1").arg(ui->utilisationEdit->value(), 2, 'f', 1, '0')); | |
251 | query.bindValue(":bu_factor", QString("%1").arg(ui->bufactorEdit->value(), 2, 'f', 1, '0')); | |
252 | query.bindValue(":uuid", QUuid::createUuid().toString().mid(1, 36)); | |
253 | query.exec(); | |
254 | if (query.lastError().isValid()) { | |
385
09af9f46518f
All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents:
380
diff
changeset
|
255 | qWarning() << "EditHop" << query.lastError(); |
377 | 256 | QMessageBox::warning(this, tr("Database error"), |
257 | tr("MySQL error: %1\n%2\n%3") | |
258 | .arg(query.lastError().nativeErrorCode()) | |
259 | .arg(query.lastError().driverText()) | |
260 | .arg(query.lastError().databaseText())); | |
261 | } else { | |
262 | qDebug() << "EditHop Saved"; | |
263 | } | |
264 | ||
265 | } | |
266 | ||
267 | ||
24 | 268 | void EditHop::on_deleteButton_clicked() |
269 | { | |
270 | QSqlQuery query; | |
271 | ||
385
09af9f46518f
All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents:
380
diff
changeset
|
272 | int rc = QMessageBox::warning(this, tr("Delete hop"), tr("Delete %1").arg(ui->nameEdit->text()), |
09af9f46518f
All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents:
380
diff
changeset
|
273 | QMessageBox::Yes | QMessageBox::No, QMessageBox::No); |
09af9f46518f
All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents:
380
diff
changeset
|
274 | if (rc == QMessageBox::No) |
09af9f46518f
All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents:
380
diff
changeset
|
275 | return; |
09af9f46518f
All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents:
380
diff
changeset
|
276 | |
24 | 277 | query.prepare("DELETE FROM inventory_hops WHERE record = :recno"); |
278 | query.bindValue(":recno", this->recno); | |
279 | query.exec(); | |
280 | if (query.lastError().isValid()) { | |
385
09af9f46518f
All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents:
380
diff
changeset
|
281 | qWarning() << "EditHop" << query.lastError(); |
24 | 282 | QMessageBox::warning(this, tr("Database error"), |
283 | tr("MySQL error: %1\n%2\n%3") | |
284 | .arg(query.lastError().nativeErrorCode()) | |
285 | .arg(query.lastError().driverText()) | |
286 | .arg(query.lastError().databaseText())); | |
287 | } else { | |
288 | qDebug() << "EditHop Deleted" << this->recno; | |
289 | } | |
290 | ||
291 | this->close(); | |
292 | this->setResult(1); | |
293 | } | |
294 | ||
295 | ||
296 | void EditHop::is_changed() | |
297 | { | |
298 | ui->valueEdit->setValue(ui->inventoryEdit->value() * ui->costEdit->value()); | |
299 | ui->saveButton->setEnabled(true); | |
300 | ui->deleteButton->setEnabled((ui->inventoryEdit->value() == 0 && this->recno >= 0) ? true:false); | |
301 | this->textIsChanged = true; | |
302 | WindowTitle(); | |
303 | } | |
304 | ||
305 | ||
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:
377
diff
changeset
|
306 | void EditHop::form_changed(int val) |
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:
377
diff
changeset
|
307 | { |
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:
377
diff
changeset
|
308 | switch (val) { |
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:
377
diff
changeset
|
309 | case HOP_FORMS_PELLET: ui->utilisationEdit->setValue(my_ut_pellet); break; |
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:
377
diff
changeset
|
310 | case HOP_FORMS_PLUG: ui->utilisationEdit->setValue(my_ut_plug); break; |
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:
377
diff
changeset
|
311 | case HOP_FORMS_LEAF: ui->utilisationEdit->setValue(my_ut_leaf); break; |
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:
377
diff
changeset
|
312 | case HOP_FORMS_LEAF_WET: ui->utilisationEdit->setValue(my_ut_wethop); break; |
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:
377
diff
changeset
|
313 | case HOP_FORMS_CRYO: ui->utilisationEdit->setValue(my_ut_t45); break; |
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:
377
diff
changeset
|
314 | case HOP_FORMS_CO2EXTRACT: ui->utilisationEdit->setValue(my_ut_co2extract); break; |
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:
377
diff
changeset
|
315 | } |
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:
377
diff
changeset
|
316 | 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:
377
diff
changeset
|
317 | } |
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:
377
diff
changeset
|
318 | |
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:
377
diff
changeset
|
319 | |
24 | 320 | void EditHop::on_quitButton_clicked() |
321 | { | |
322 | if (this->textIsChanged) { | |
60
0d65238ebedc
Updated translations and some messages.
Michiel Broek <mbroek@mbse.eu>
parents:
24
diff
changeset
|
323 | int rc = QMessageBox::warning(this, tr("Hop changed"), tr("This hop has been modified. Save changes?"), |
24 | 324 | QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Save); |
325 | switch (rc) { | |
326 | case QMessageBox::Save: | |
327 | on_saveButton_clicked(); | |
328 | break; /* Saved and then Quit */ | |
329 | case QMessageBox::Discard: | |
330 | break; /* Quit without Save */ | |
331 | case QMessageBox::Cancel: | |
332 | return; /* Return to the editor page */ | |
333 | } | |
334 | } | |
335 | ||
336 | this->close(); | |
337 | this->setResult(1); | |
338 | } | |
292
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
339 | |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
340 | |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
341 | void EditHop::prod_date_clear() |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
342 | { |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
343 | ui->prodEdit->setDate(QDate()); |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
344 | is_changed(); |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
345 | } |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
346 | |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
347 | |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
348 | void EditHop::prod_date_today() |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
349 | { |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
350 | ui->prodEdit->setDate(QDate::currentDate()); |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
351 | is_changed(); |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
352 | } |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
353 | |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
354 | |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
355 | void EditHop::tht_date_clear() |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
356 | { |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
357 | ui->thtEdit->setDate(QDate()); |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
358 | is_changed(); |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
359 | } |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
360 | |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
361 | |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
362 | void EditHop::tht_date_today() |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
363 | { |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
364 | ui->thtEdit->setDate(QDate::currentDate()); |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
365 | is_changed(); |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
366 | } |
b6ec2e275736
Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents:
90
diff
changeset
|
367 |