Sun, 03 Apr 2022 22:02:12 +0200
Experiment with checkboxes in the fermentable table.
92
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1 | #ifndef _EDITRECIPE_H |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
2 | #define _EDITRECIPE_H |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
3 | |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
4 | #include <QDialog> |
101
1d14d3bf2465
Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents:
92
diff
changeset
|
5 | #include <QStringList> |
1d14d3bf2465
Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents:
92
diff
changeset
|
6 | #include <QJsonDocument> |
92
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
7 | |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
8 | namespace Ui { |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
9 | class EditRecipe; |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
10 | } |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
11 | |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
12 | class EditRecipe : public QDialog |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
13 | { |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
14 | Q_OBJECT |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
15 | |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
16 | signals: |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
17 | void entry_changed(); |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
18 | |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
19 | public: |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
20 | explicit EditRecipe(int id, QWidget *parent = 0); |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
21 | ~EditRecipe(); |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
22 | |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
23 | private slots: |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
24 | void on_saveButton_clicked(); |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
25 | void on_quitButton_clicked(); |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
26 | void on_deleteButton_clicked(); |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
27 | void is_changed(); |
101
1d14d3bf2465
Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents:
92
diff
changeset
|
28 | void style_changed(); |
102
b017001850df
Almost finished calcFermentables()
Michiel Broek <mbroek@mbse.eu>
parents:
101
diff
changeset
|
29 | void colormethod_changed(); |
92
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
30 | void time_changed(); |
101
1d14d3bf2465
Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents:
92
diff
changeset
|
31 | void refreshFermentables(); |
1d14d3bf2465
Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents:
92
diff
changeset
|
32 | void refreshHops(); |
1d14d3bf2465
Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents:
92
diff
changeset
|
33 | void refreshMiscs(); |
1d14d3bf2465
Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents:
92
diff
changeset
|
34 | void refreshYeasts(); |
1d14d3bf2465
Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents:
92
diff
changeset
|
35 | void refreshMashs(); |
1d14d3bf2465
Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents:
92
diff
changeset
|
36 | void refreshAll(); |
103
6da4e93b6ceb
Experiment with checkboxes in the fermentable table.
Michiel Broek <mbroek@mbse.eu>
parents:
102
diff
changeset
|
37 | void cell_Fermentable_changed(int nRow, int nCol); |
101
1d14d3bf2465
Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents:
92
diff
changeset
|
38 | void on_deleteFermentRow_clicked(); |
92
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
39 | |
102
b017001850df
Almost finished calcFermentables()
Michiel Broek <mbroek@mbse.eu>
parents:
101
diff
changeset
|
40 | void on_perc_mash_valueChanged(int value); |
b017001850df
Almost finished calcFermentables()
Michiel Broek <mbroek@mbse.eu>
parents:
101
diff
changeset
|
41 | void on_perc_sugars_valueChanged(int value); |
b017001850df
Almost finished calcFermentables()
Michiel Broek <mbroek@mbse.eu>
parents:
101
diff
changeset
|
42 | void on_perc_cara_valueChanged(int value); |
b017001850df
Almost finished calcFermentables()
Michiel Broek <mbroek@mbse.eu>
parents:
101
diff
changeset
|
43 | void on_lintner_valueChanged(int value); |
b017001850df
Almost finished calcFermentables()
Michiel Broek <mbroek@mbse.eu>
parents:
101
diff
changeset
|
44 | |
92
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
45 | private: |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
46 | Ui::EditRecipe *ui; |
101
1d14d3bf2465
Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents:
92
diff
changeset
|
47 | QStringList s_types = { tr("Lager"), tr("Ale"), tr("Mead"), tr("Wheat"), tr("Mixed"), tr("Cider") }; |
1d14d3bf2465
Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents:
92
diff
changeset
|
48 | QStringList f_types = { tr("Grain"), tr("Sugar"), tr("Extract"), tr("Dry extract"), tr("Adjunct") }; |
1d14d3bf2465
Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents:
92
diff
changeset
|
49 | QStringList f_graintypes = { tr("Base"), tr("Roast"), tr("Crystal"), tr("Kilned"), tr("Sour Malt"), tr("Special"), tr("No malt")}; |
1d14d3bf2465
Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents:
92
diff
changeset
|
50 | QStringList f_added = { tr("Mash"), tr("Boil"), tr("Fermentation"), tr("Lagering"), tr("Bottle"), tr("Kegs") }; |
1d14d3bf2465
Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents:
92
diff
changeset
|
51 | QString bar_red = "QProgressBar::chunk {background: #FF0000;}"; |
1d14d3bf2465
Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents:
92
diff
changeset
|
52 | QString bar_orange = "QProgressBar::chunk {background: #EB7331;}"; |
1d14d3bf2465
Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents:
92
diff
changeset
|
53 | QString bar_green = "QProgressBar::chunk {background: #008C00;}"; |
92
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
54 | int recno, lasttime = 0; |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
55 | bool textIsChanged = false; |
101
1d14d3bf2465
Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents:
92
diff
changeset
|
56 | bool ignoreChanges = false; |
1d14d3bf2465
Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents:
92
diff
changeset
|
57 | QJsonDocument fermentables, hops, miscs, yeasts, mashs; |
92
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
58 | |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
59 | void WindowTitle(); |
101
1d14d3bf2465
Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents:
92
diff
changeset
|
60 | void calcFermentables(); |
92
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
61 | }; |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
62 | |
fb0bb9a2a7e1
Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
63 | #endif |