# HG changeset patch # User Michiel Broek # Date 1645045889 -3600 # Node ID c58b82549713e29124e0be860b98720dc94fe5dd # Parent 8a304c898a75e5b2694706b1002a089f838b0609 Started adding the global setup screen. diff -r 8a304c898a75 -r c58b82549713 CMakeLists.txt --- a/CMakeLists.txt Wed Feb 16 16:29:42 2022 +0100 +++ b/CMakeLists.txt Wed Feb 16 22:11:29 2022 +0100 @@ -100,6 +100,7 @@ ${SRCDIR}/AboutDialog.cpp ${SRCDIR}/InventorySuppliers.cpp ${SRCDIR}/EditSupplier.cpp + ${SRCDIR}/Setup.cpp ${SRCDIR}/MainWindow.cpp ${SRCDIR}/database/database.cpp ) @@ -109,6 +110,7 @@ ${SRCDIR}/AboutDialog.h ${SRCDIR}/InventorySuppliers.h ${SRCDIR}/EditSupplier.h + ${SRCDIR}/Setup.h ${SRCDIR}/MainWindow.h ${SRCDIR}/database/database.h ) @@ -117,6 +119,7 @@ ${UIDIR}/AboutDialog.ui ${UIDIR}/InventorySuppliers.ui ${UIDIR}/EditSupplier.ui + ${UIDIR}/Setup.ui ${UIDIR}/MainWindow.ui ) diff -r 8a304c898a75 -r c58b82549713 src/MainWindow.cpp --- a/src/MainWindow.cpp Wed Feb 16 16:29:42 2022 +0100 +++ b/src/MainWindow.cpp Wed Feb 16 22:11:29 2022 +0100 @@ -17,6 +17,7 @@ #include "MainWindow.h" #include "AboutDialog.h" #include "InventorySuppliers.h" +#include "Setup.h" #include "../ui/ui_MainWindow.h" #include "config.h" @@ -68,6 +69,24 @@ } +void MainWindow::fromSetup() +{ + qDebug() << Q_FUNC_INFO; + delete SetupWindow; + this->show(); +} + + +void MainWindow::on_actionSetup_triggered() +{ + qDebug() << Q_FUNC_INFO; + SetupWindow = new Setup(this); + QObject::connect(SetupWindow, SIGNAL(firstWindow()), this, SLOT(fromSetup())); + this->hide(); // Close the main window + SetupWindow->show(); // Show a second window +} + + void MainWindow::on_actionAbout_triggered() { qDebug() << Q_FUNC_INFO; diff -r 8a304c898a75 -r c58b82549713 src/MainWindow.h --- a/src/MainWindow.h Wed Feb 16 16:29:42 2022 +0100 +++ b/src/MainWindow.h Wed Feb 16 22:11:29 2022 +0100 @@ -2,6 +2,7 @@ #define _MAINWINDOW_H #include "InventorySuppliers.h" +#include "Setup.h" #include #include @@ -23,16 +24,19 @@ private slots: void on_actionExit_triggered(); void on_actionSuppliers_triggered(); + void on_actionSetup_triggered(); void on_actionAbout_triggered(); public slots: void fromInventorySuppliers(); + void fromSetup(); private: Ui::MainWindow *ui; // Keep pointers to new windows. InventorySuppliers *InventorySuppliersWindow; + Setup *SetupWindow; }; #endif diff -r 8a304c898a75 -r c58b82549713 src/Setup.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Setup.cpp Wed Feb 16 22:11:29 2022 +0100 @@ -0,0 +1,45 @@ +/** + * Setup.cpp is part of bmsapp. + * + * bmsapp is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * bmsapp is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "Setup.h" +#include "../ui/ui_Setup.h" +#include "config.h" +#include "bmsapp.h" + + + +Setup::Setup(QWidget *parent) : QDialog(parent), ui(new Ui::Setup) +{ + qDebug() << "Setup start"; + + ui->setupUi(this); + + setWindowTitle( QString("BMSapp - %1 - Setup").arg(VERSIONSTRING) ); +} + + +Setup::~Setup() +{ + qDebug() << "Setup done"; + delete ui; +} + + +void Setup::on_quitButton_clicked() +{ + emit firstWindow(); +} + diff -r 8a304c898a75 -r c58b82549713 src/Setup.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Setup.h Wed Feb 16 22:11:29 2022 +0100 @@ -0,0 +1,31 @@ +#ifndef _SETUP_H +#define _SETUP_H + +#include + +namespace Ui { +class Setup; +} + +class Setup : public QDialog +{ + Q_OBJECT + +public: + explicit Setup(QWidget *parent = nullptr); + ~Setup(); + +signals: + void firstWindow(); + +private slots: + void on_quitButton_clicked(); +// void on_insertButton_clicked(); +// void on_editButton_clicked(); +// void refreshTable(void); + +private: + Ui::Setup *ui; +}; + +#endif diff -r 8a304c898a75 -r c58b82549713 src/main.cpp --- a/src/main.cpp Wed Feb 16 16:29:42 2022 +0100 +++ b/src/main.cpp Wed Feb 16 22:11:29 2022 +0100 @@ -35,11 +35,10 @@ #endif ); app.setApplicationVersion(VERSIONSTRING); -// app.setStyle("oxygen"); app.setOrganizationName("mbse"); + /* Stylesheet setup */ QFile f(":/qdarkstyle/theme/style.qss"); - if (!f.exists()) { printf("Unable to set stylesheet, file not found\n"); } else { diff -r 8a304c898a75 -r c58b82549713 ui/MainWindow.ui --- a/ui/MainWindow.ui Wed Feb 16 16:29:42 2022 +0100 +++ b/ui/MainWindow.ui Wed Feb 16 22:11:29 2022 +0100 @@ -85,7 +85,7 @@ - + @@ -339,7 +339,7 @@ Fermentation schedules - + :/icons/silk/icons/silk/wrench.png:/icons/silk/icons/silk/wrench.png diff -r 8a304c898a75 -r c58b82549713 ui/Setup.ui --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/Setup.ui Wed Feb 16 22:11:29 2022 +0100 @@ -0,0 +1,647 @@ + + + Setup + + + + 0 + 0 + 1280 + 640 + + + + Dialog + + + + + + + + 60 + 20 + 131 + 20 + + + + Brewery name: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 212 + 20 + 941 + 23 + + + + De naam voor deze brouwerij. + + + + + + 0 + 60 + 1251 + 20 + + + + Qt::Horizontal + + + + + + 60 + 120 + 131 + 20 + + + + First Wort Hop factor: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 60 + 150 + 131 + 20 + + + + Mash Hop factor: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 60 + 180 + 131 + 20 + + + + Pellet Hop factor: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 60 + 210 + 131 + 20 + + + + Hop Plugs factor: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 60 + 240 + 131 + 20 + + + + Wet Hop factor: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 60 + 270 + 131 + 20 + + + + Cryo HopĀ® factor: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 210 + 120 + 81 + 24 + + + + Het efficientie percentage voor First Wort Hop. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + % + + + -50 + + + 50 + + + + + + 210 + 150 + 81 + 24 + + + + Het efficientie percentage voor hop tijdens de maisch. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + % + + + -50 + + + 50 + + + + + + 210 + 180 + 81 + 24 + + + + Het efficientie percentage bij gebruik van hop pellets. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + % + + + 0 + + + 20 + + + + + + 210 + 210 + 81 + 24 + + + + Het efficientie percentage bij gebruik van hop plugs. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + % + + + 20 + + + + + + 210 + 240 + 81 + 24 + + + + Het efficientie percentage bij gebruik van nat geplukte hop. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + % + + + -98 + + + -20 + + + + + + 210 + 270 + 81 + 24 + + + + Het efficientie percentage bij gebruik van Cryo HopĀ®. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + % + + + -20 + + + 150 + + + + + + 440 + 120 + 161 + 20 + + + + Grain Absorbtion: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 440 + 150 + 161 + 20 + + + + Brix Correction factor: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 5 + 80 + 1251 + 20 + + + + + DejaVu Sans + 12 + 75 + true + + + + Brew settings. + + + Qt::AlignCenter + + + + + + 850 + 120 + 121 + 16 + + + + Color Method: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 850 + 150 + 121 + 16 + + + + IBU Calculation: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 850 + 180 + 121 + 16 + + + + Default Water: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 850 + 210 + 121 + 16 + + + + Private Yeast bank: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 620 + 120 + 101 + 24 + + + + Absorbtion with water by the grain (L/Kg) + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + L/Kg + + + 0.500000000000000 + + + 1.100000000000000 + + + 0.010000000000000 + + + QAbstractSpinBox::DefaultStepType + + + 1.010000000000000 + + + + + + 620 + 150 + 101 + 24 + + + + Plato to Brix conversion factor. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + 1.000000000000000 + + + 1.090000000000000 + + + 0.010000000000000 + + + QAbstractSpinBox::DefaultStepType + + + 1.040000000000000 + + + + + + 990 + 120 + 161 + 23 + + + + + + + 4 + + + Choose color + + + + + + 990 + 150 + 161 + 23 + + + + + + + 4 + + + Choose color + + + + + + 990 + 180 + 161 + 23 + + + + + + + 4 + + + Choose color + + + + + + 990 + 210 + 161 + 23 + + + + + + + 4 + + + Choose color + + + + + + + + + 0 + 24 + + + + + 16777215 + 24 + + + + + + 10 + 0 + 80 + 23 + + + + Quit + + + + :/icons/silk/icons/silk/door_out.png:/icons/silk/icons/silk/door_out.png + + + + + + 1170 + 0 + 80 + 23 + + + + Save + + + + :/icons/silk/icons/silk/disk.png:/icons/silk/icons/silk/disk.png + + + + + + + + + + +