225 /* |
225 /* |
226 * These are not in the MySL database, but are global variables |
226 * These are not in the MySL database, but are global variables |
227 * that belong with the loaded recipe data and are present to |
227 * that belong with the loaded recipe data and are present to |
228 * make things easier. |
228 * make things easier. |
229 */ |
229 */ |
230 int fermentables_records; ///< Total records |
|
231 int fermentables_current; ///< Current record, -1 is invalid. |
230 int fermentables_current; ///< Current record, -1 is invalid. |
232 bool fermentables_use100; ///< Use percentages instead of amount |
231 bool fermentables_use100; ///< Use percentages instead of amount |
233 int hops_records; |
|
234 int hops_current; |
232 int hops_current; |
235 int misc_records; |
|
236 int misc_current; |
233 int misc_current; |
237 int yeasts_records; |
|
238 int yeasts_current; |
234 int yeasts_current; |
239 int mashs_records; |
|
240 int mashs_current; |
235 int mashs_current; |
241 }; |
236 }; |
242 |
237 |
243 |
238 |
244 namespace Ui { |
239 namespace Ui { |
267 void refreshHops(); |
262 void refreshHops(); |
268 void refreshMiscs(); |
263 void refreshMiscs(); |
269 void refreshYeasts(); |
264 void refreshYeasts(); |
270 void refreshMashs(); |
265 void refreshMashs(); |
271 void refreshAll(); |
266 void refreshAll(); |
272 void cell_Fermentable_changed(int nRow, int nCol); |
|
273 void ferment_amount_changed(double val); |
267 void ferment_amount_changed(double val); |
274 void ferment_pct_changed(double val); |
268 void ferment_pct_changed(double val); |
275 void on_deleteFermentRow_clicked(); |
269 void on_deleteFermentRow_clicked(); |
276 void on_editFermentRow_clicked(); |
270 void on_editFermentRow_clicked(); |
277 |
271 |
290 QString bar_orange = "QProgressBar::chunk {background: #EB7331;}"; |
284 QString bar_orange = "QProgressBar::chunk {background: #EB7331;}"; |
291 QString bar_green = "QProgressBar::chunk {background: #008C00;}"; |
285 QString bar_green = "QProgressBar::chunk {background: #008C00;}"; |
292 int recno, editrow; |
286 int recno, editrow; |
293 bool textIsChanged = false; |
287 bool textIsChanged = false; |
294 bool ignoreChanges = false; |
288 bool ignoreChanges = false; |
295 bool use_to100 = false; |
|
296 Recipe *recipe; |
289 Recipe *recipe; |
297 /* |
290 /* |
298 * Variables for popup ingredients editing. |
291 * Variables for popup ingredients editing. |
299 */ |
292 */ |
300 QJsonDocument fermentables, hops, miscs, yeasts; |
293 QJsonDocument hops, miscs, yeasts; |
301 QJsonObject work, backup; |
|
302 QComboBox *selectEdit, *addedEdit; |
294 QComboBox *selectEdit, *addedEdit; |
303 QLineEdit *nameEdit, *supplierEdit; |
295 QLineEdit *nameEdit, *supplierEdit; |
304 QDoubleSpinBox *amountEdit, *pctEdit, *maxEdit; |
296 QDoubleSpinBox *amountEdit, *pctEdit, *maxEdit; |
305 QCheckBox *to100Edit, *instockEdit; |
297 QCheckBox *to100Edit, *instockEdit; |
306 |
298 |
|
299 static bool ferment_sort_test(const Fermentables &D1, const Fermentables &D2); |
307 void WindowTitle(); |
300 void WindowTitle(); |
308 void fermentable_Json(); |
301 void fermentable_Json(); |
309 void calcFermentables(); |
302 void calcFermentables(); |
310 }; |
303 }; |
311 |
304 |