src/Setup.h

Sat, 30 Jul 2022 16:30:02 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sat, 30 Jul 2022 16:30:02 +0200
changeset 380
8f5c03ed4321
parent 337
8133cdb19aa1
child 430
ef2638cfc1b7
permissions
-rw-r--r--

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.

#ifndef _SETUP_H
#define _SETUP_H

#include <QDialog>
#include <QFileDialog>
#include <QtGui/QIcon>
#include <QtWidgets/QApplication>
#include <QtWidgets/QComboBox>
#include <QtWidgets/QDialog>
#include <QtWidgets/QDoubleSpinBox>
#include <QtWidgets/QFrame>
#include <QtWidgets/QGridLayout>
#include <QtWidgets/QLabel>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QSpinBox>
#include <QtWidgets/QWidget>

QT_BEGIN_NAMESPACE
class QLabel;
QT_END_NAMESPACE

namespace Ui {
class Setup;
}

class Setup : public QDialog
{
    Q_OBJECT

public:
    explicit Setup(QWidget *parent = nullptr);
    ~Setup();
    bool loadFile(const QString &);

signals:
    void firstWindow();
    void setTitle(QString);

private slots:
    void on_openButton_clicked();
    void on_quitButton_clicked();
    void on_saveButton_clicked();
    void is_changed();

private:
    QByteArray logoByteArray;
    QImage image;
    QLabel *logoLabel;
    QLabel *breweryLabel;
    QLabel *fwhLabel;
    QLabel *mashhopLabel;
    QLabel *leafLabel;
    QLabel *pelletLabel;
    QLabel *hopplugLabel;
    QLabel *wethopLabel;
    QLabel *cryohopLabel;
    QLabel *extractLabel;
    QLabel *grainLabel;
    QLabel *brixLabel;
    QLabel *heightLabel;
    QLabel *titleLabel;
    QLabel *colorLabel;
    QLabel *ibuLabel;
    QLabel *waterLabel;
    QLabel *yeastLabel;

    QLineEdit *breweryEdit;

    QSpinBox *fwhEdit;
    QSpinBox *mashhopEdit;
    QDoubleSpinBox *pelletEdit;
    QDoubleSpinBox *hopplugEdit;
    QDoubleSpinBox *leafEdit;
    QDoubleSpinBox *wethopEdit;
    QDoubleSpinBox *cryohopEdit;
    QDoubleSpinBox *extractEdit;
    QComboBox *waterEdit;
    QDoubleSpinBox *grainEdit;
    QDoubleSpinBox *brixEdit;
    QSpinBox *heightEdit;
    QComboBox *colorEdit;
    QComboBox *ibuEdit;
    QComboBox *yeastEdit;
    QPushButton *quitButton;
    QPushButton *saveButton;
    QPushButton *openButton;

    double scaleFactor = 1;

    void setImage(const QImage &newImage);
    bool fieldIsChanged = false;
};

#endif

mercurial