2 #define _EDITRECIPE_H |
2 #define _EDITRECIPE_H |
3 |
3 |
4 #include <QDialog> |
4 #include <QDialog> |
5 #include <QStringList> |
5 #include <QStringList> |
6 #include <QJsonDocument> |
6 #include <QJsonDocument> |
|
7 |
|
8 |
|
9 typedef struct f_edit { |
|
10 int f_row; ///< Row to edit, -1 for insert. |
|
11 QString f_name; ///< Fermentable name |
|
12 QString f_supplier; ///< Fermentable supplier |
|
13 double f_max_in_batch; ///< Max percentage in batch |
|
14 double f_percentage; ///< Current percentage in batch |
|
15 double f_amount; ///< Amount in kg |
|
16 bool f_adjust_to_total_100; ///< Adjust amount/percentage to 100% |
|
17 int f_added; ///< When to add fermentable |
|
18 } fedit; |
|
19 |
7 |
20 |
8 namespace Ui { |
21 namespace Ui { |
9 class EditRecipe; |
22 class EditRecipe; |
10 } |
23 } |
11 |
24 |
34 void refreshYeasts(); |
47 void refreshYeasts(); |
35 void refreshMashs(); |
48 void refreshMashs(); |
36 void refreshAll(); |
49 void refreshAll(); |
37 void cell_Fermentable_changed(int nRow, int nCol); |
50 void cell_Fermentable_changed(int nRow, int nCol); |
38 void on_deleteFermentRow_clicked(); |
51 void on_deleteFermentRow_clicked(); |
|
52 void on_editFermentRow_clicked(); |
39 |
53 |
40 void on_perc_mash_valueChanged(int value); |
54 void on_perc_mash_valueChanged(int value); |
41 void on_perc_sugars_valueChanged(int value); |
55 void on_perc_sugars_valueChanged(int value); |
42 void on_perc_cara_valueChanged(int value); |
56 void on_perc_cara_valueChanged(int value); |
43 void on_lintner_valueChanged(int value); |
57 void on_lintner_valueChanged(int value); |
53 QString bar_green = "QProgressBar::chunk {background: #008C00;}"; |
67 QString bar_green = "QProgressBar::chunk {background: #008C00;}"; |
54 int recno, lasttime = 0; |
68 int recno, lasttime = 0; |
55 bool textIsChanged = false; |
69 bool textIsChanged = false; |
56 bool ignoreChanges = false; |
70 bool ignoreChanges = false; |
57 QJsonDocument fermentables, hops, miscs, yeasts, mashs; |
71 QJsonDocument fermentables, hops, miscs, yeasts, mashs; |
|
72 fedit fermentrow, fermentbackup; |
58 |
73 |
59 void WindowTitle(); |
74 void WindowTitle(); |
|
75 void fermentable_Json(); |
60 void calcFermentables(); |
76 void calcFermentables(); |
61 }; |
77 }; |
62 |
78 |
63 #endif |
79 #endif |