src/MainWindow.cpp

Sun, 13 Mar 2022 22:56:22 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Sun, 13 Mar 2022 22:56:22 +0100
changeset 52
ff7b3a41c9b5
parent 49
29cf6e350063
child 56
eb6c564192f4
permissions
-rw-r--r--

After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.

4
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
1 /**
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
2 * MainWindow.cpp is part of bmsapp.
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
3 *
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
4 * bmsapp is free software: you can redistribute it and/or modify
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
5 * it under the terms of the GNU General Public License as published by
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
6 * the Free Software Foundation, either version 3 of the License, or
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
7 * (at your option) any later version.
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
8 *
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
9 * bmsapp is distributed in the hope that it will be useful,
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
12 * GNU General Public License for more details.
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
13 *
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
14 * You should have received a copy of the GNU General Public License
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
16 */
3
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 #include "MainWindow.h"
4
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
18 #include "AboutDialog.h"
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
19 #include "InventorySuppliers.h"
19
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
20 #include "InventoryFermentables.h"
24
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
21 #include "InventoryHops.h"
25
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
22 #include "InventoryYeasts.h"
28
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
23 #include "InventoryMiscs.h"
29
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
24 #include "InventoryWaters.h"
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
25 #include "InventoryEquipments.h"
48
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
26 #include "ProfileWaters.h"
49
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
27 #include "ProfileMashs.h"
15
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
28 #include "Setup.h"
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents: 49
diff changeset
29 #include "PrinterDialog.h"
3
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
30 #include "../ui/ui_MainWindow.h"
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
31 #include "config.h"
3
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
32
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
33 #include <QApplication>
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
34 #include <QCloseEvent>
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
35 #include <QDebug>
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
36 #include <QStandardItem>
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
37 #include <QWidget>
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
38
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
39
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
40 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
41 {
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
42 qDebug() << Q_FUNC_INFO;
4
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
43 ui->setupUi(this);
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
44
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
45 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
3
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
46 }
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
47
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
48
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
49 MainWindow::~MainWindow()
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
50 {
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
51 qDebug() << Q_FUNC_INFO;
4
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
52 delete ui;
3
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
53 }
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
54
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
55
4
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
56 void MainWindow::on_actionExit_triggered()
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
57 {
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
58 qDebug() << Q_FUNC_INFO;
4
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
59 this->close();
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
60 }
3
4b95e33ee476 We have a mainscreen!
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
61
4
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
62
6
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
63 void MainWindow::fromInventorySuppliers()
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
64 {
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
65 qDebug() << Q_FUNC_INFO;
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
66 delete InventorySuppliersWindow;
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
67 this->show();
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
68 }
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
69
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
70
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
71 void MainWindow::on_actionSuppliers_triggered()
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
72 {
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
73 qDebug() << Q_FUNC_INFO;
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
74 InventorySuppliersWindow = new InventorySuppliers(this);
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
75 QObject::connect(InventorySuppliersWindow, SIGNAL(firstWindow()), this, SLOT(fromInventorySuppliers()));
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
76 this->hide(); // Close the main window
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
77 InventorySuppliersWindow->show(); // Show a second window
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
78 }
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
79
f8474f2c5db9 We can fetch a list of suppliers and show it in the wrong window. Still a lot to learn about Qt5
Michiel Broek <mbroek@mbse.eu>
parents: 4
diff changeset
80
19
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
81 void MainWindow::fromInventoryFermentables()
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
82 {
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
83 qDebug() << Q_FUNC_INFO;
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
84 delete InventoryFermentablesWindow;
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
85 this->show();
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
86 }
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
87
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
88
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
89 void MainWindow::on_actionFermentables_triggered()
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
90 {
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
91 qDebug() << Q_FUNC_INFO;
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
92 InventoryFermentablesWindow = new InventoryFermentables(this);
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
93 QObject::connect(InventoryFermentablesWindow, SIGNAL(firstWindow()), this, SLOT(fromInventoryFermentables()));
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
94 this->hide(); // Close the main window
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
95 InventoryFermentablesWindow->show(); // Show a second window
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
96 }
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
97
c94edc758a5b Added Inventory Fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 16
diff changeset
98
24
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
99 void MainWindow::fromInventoryHops()
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
100 {
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
101 qDebug() << Q_FUNC_INFO;
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
102 delete InventoryHopsWindow;
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
103 this->show();
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
104 }
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
105
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
106
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
107 void MainWindow::on_actionHops_triggered()
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
108 {
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
109 qDebug() << Q_FUNC_INFO;
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
110 InventoryHopsWindow = new InventoryHops(this);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
111 QObject::connect(InventoryHopsWindow, SIGNAL(firstWindow()), this, SLOT(fromInventoryHops()));
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
112 this->hide(); // Close the main window
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
113 InventoryHopsWindow->show(); // Show a second window
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
114 }
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
115
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents: 19
diff changeset
116
25
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
117 void MainWindow::fromInventoryYeasts()
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
118 {
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
119 qDebug() << Q_FUNC_INFO;
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
120 delete InventoryYeastsWindow;
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
121 this->show();
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
122 }
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
123
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
124
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
125 void MainWindow::on_actionYeasts_triggered()
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
126 {
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
127 qDebug() << Q_FUNC_INFO;
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
128 InventoryYeastsWindow = new InventoryYeasts(this);
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
129 QObject::connect(InventoryYeastsWindow, SIGNAL(firstWindow()), this, SLOT(fromInventoryYeasts()));
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
130 this->hide(); // Close the main window
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
131 InventoryYeastsWindow->show(); // Show a second window
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
132 }
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
133
a9da2744609e Added inventory yeasts editor. Fixed resource icons location.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
134
28
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
135 void MainWindow::fromInventoryMiscs()
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
136 {
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
137 qDebug() << Q_FUNC_INFO;
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
138 delete InventoryMiscsWindow;
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
139 this->show();
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
140 }
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
141
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
142
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
143 void MainWindow::on_actionMiscs_triggered()
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
144 {
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
145 qDebug() << Q_FUNC_INFO;
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
146 InventoryMiscsWindow = new InventoryMiscs(this);
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
147 QObject::connect(InventoryMiscsWindow, SIGNAL(firstWindow()), this, SLOT(fromInventoryMiscs()));
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
148 this->hide(); // Close the main window
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
149 InventoryMiscsWindow->show(); // Show a second window
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
150 }
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
151
93a70b1502ca Added the inventory miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
152
29
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
153 void MainWindow::fromInventoryWaters()
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
154 {
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
155 qDebug() << Q_FUNC_INFO;
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
156 delete InventoryWatersWindow;
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
157 this->show();
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
158 }
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
159
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
160
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
161 void MainWindow::on_actionWaters_triggered()
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
162 {
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
163 qDebug() << Q_FUNC_INFO;
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
164 InventoryWatersWindow = new InventoryWaters(this);
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
165 QObject::connect(InventoryWatersWindow, SIGNAL(firstWindow()), this, SLOT(fromInventoryWaters()));
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
166 this->hide(); // Close the main window
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
167 InventoryWatersWindow->show(); // Show a second window
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
168 }
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
169
76846c99f827 Added inventory water editor and table. In Yeasts table make sure the fields without a tickmark are empty. Removed Utils::Round function, not reliable.
Michiel Broek <mbroek@mbse.eu>
parents: 28
diff changeset
170
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
171 void MainWindow::fromInventoryEquipments()
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
172 {
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
173 qDebug() << Q_FUNC_INFO;
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
174 delete InventoryEquipmentsWindow;
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
175 this->show();
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
176 }
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
177
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
178
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
179 void MainWindow::on_actionEquipments_triggered()
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
180 {
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
181 qDebug() << Q_FUNC_INFO;
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
182 InventoryEquipmentsWindow = new InventoryEquipments(this);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
183 QObject::connect(InventoryEquipmentsWindow, SIGNAL(firstWindow()), this, SLOT(fromInventoryEquipments()));
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
184 this->hide(); // Close the main window
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
185 InventoryEquipmentsWindow->show(); // Show a second window
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
186 }
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
187
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 29
diff changeset
188
52
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents: 49
diff changeset
189 void MainWindow::on_actionSupplies_list_triggered()
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents: 49
diff changeset
190 {
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents: 49
diff changeset
191 qDebug() << Q_FUNC_INFO;
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents: 49
diff changeset
192 QDialog *printer = new PrinterDialog(PR_SUPPLIES, -1, this);
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents: 49
diff changeset
193 }
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents: 49
diff changeset
194
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents: 49
diff changeset
195
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents: 49
diff changeset
196 void MainWindow::on_actionYeast_bank_triggered()
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents: 49
diff changeset
197 {
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents: 49
diff changeset
198 qDebug() << Q_FUNC_INFO;
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents: 49
diff changeset
199 QDialog *printer = new PrinterDialog(PR_YEASTBANK, -1, this);
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents: 49
diff changeset
200 }
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents: 49
diff changeset
201
ff7b3a41c9b5 After several days experimenting, trials and a lot of errors, a working and nice looking printer support has been added to the application.
Michiel Broek <mbroek@mbse.eu>
parents: 49
diff changeset
202
48
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
203 void MainWindow::fromProfileWaters()
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
204 {
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
205 qDebug() << Q_FUNC_INFO;
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
206 delete ProfileWatersWindow;
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
207 this->show();
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
208 }
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
209
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
210
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
211 void MainWindow::on_actionWater_profiles_triggered()
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
212 {
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
213 qDebug() << Q_FUNC_INFO;
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
214 ProfileWatersWindow = new ProfileWaters(this);
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
215 QObject::connect(ProfileWatersWindow, SIGNAL(firstWindow()), this, SLOT(fromProfileWaters()));
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
216 this->hide(); // Close the main window
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
217 ProfileWatersWindow->show(); // Show a second window
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
218 }
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
219
ddd1171ecda5 Added profile water table and editor.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
220
49
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
221 void MainWindow::fromProfileMashs()
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
222 {
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
223 qDebug() << Q_FUNC_INFO;
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
224 delete ProfileMashsWindow;
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
225 this->show();
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
226 }
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
227
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
228
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
229 void MainWindow::on_actionMash_profiles_triggered()
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
230 {
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
231 qDebug() << Q_FUNC_INFO;
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
232 ProfileMashsWindow = new ProfileMashs(this);
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
233 QObject::connect(ProfileMashsWindow, SIGNAL(firstWindow()), this, SLOT(fromProfileMashs()));
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
234 this->hide(); // Close the main window
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
235 ProfileMashsWindow->show(); // Show a second window
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
236 }
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
237
29cf6e350063 Added Mash profiles table and the first part of the Mash profile editor. Edit and write must be written.
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
238
15
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
239 void MainWindow::fromSetup()
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
240 {
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
241 qDebug() << Q_FUNC_INFO;
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
242 delete SetupWindow;
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
243 this->show();
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
244 }
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
245
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
246
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
247 void MainWindow::on_actionSetup_triggered()
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
248 {
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
249 qDebug() << Q_FUNC_INFO;
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
250 SetupWindow = new Setup(this);
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
251 QObject::connect(SetupWindow, SIGNAL(firstWindow()), this, SLOT(fromSetup()));
16
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
252 this->hide(); // Close the main window
a5d8e783a7b0 Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents: 15
diff changeset
253 SetupWindow->show(); // Show a setup window
15
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
254 }
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
255
c58b82549713 Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents: 6
diff changeset
256
4
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
257 void MainWindow::on_actionAbout_triggered()
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
258 {
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
259 AboutDialog dialog(this);
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
260 dialog.setModal(true);
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
261 dialog.exec();
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
262 }
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
263
fe106c497b75 Added About dialog
Michiel Broek <mbroek@mbse.eu>
parents: 3
diff changeset
264

mercurial