Tue, 01 Mar 2022 13:19:25 +0100
Finisch miscs dutch translation.
/** * MainWindow.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 <http://www.gnu.org/licenses/>. */ #include "MainWindow.h" #include "AboutDialog.h" #include "InventorySuppliers.h" #include "InventoryFermentables.h" #include "InventoryHops.h" #include "InventoryYeasts.h" #include "InventoryMiscs.h" #include "InventoryWaters.h" #include "InventoryEquipments.h" #include "Setup.h" #include "../ui/ui_MainWindow.h" #include "config.h" #include <QApplication> #include <QCloseEvent> #include <QDebug> #include <QStandardItem> #include <QWidget> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { qDebug() << Q_FUNC_INFO; ui->setupUi(this); setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) ); } MainWindow::~MainWindow() { qDebug() << Q_FUNC_INFO; delete ui; } void MainWindow::on_actionExit_triggered() { qDebug() << Q_FUNC_INFO; this->close(); } void MainWindow::fromInventorySuppliers() { qDebug() << Q_FUNC_INFO; delete InventorySuppliersWindow; this->show(); } void MainWindow::on_actionSuppliers_triggered() { qDebug() << Q_FUNC_INFO; InventorySuppliersWindow = new InventorySuppliers(this); QObject::connect(InventorySuppliersWindow, SIGNAL(firstWindow()), this, SLOT(fromInventorySuppliers())); this->hide(); // Close the main window InventorySuppliersWindow->show(); // Show a second window } void MainWindow::fromInventoryFermentables() { qDebug() << Q_FUNC_INFO; delete InventoryFermentablesWindow; this->show(); } void MainWindow::on_actionFermentables_triggered() { qDebug() << Q_FUNC_INFO; InventoryFermentablesWindow = new InventoryFermentables(this); QObject::connect(InventoryFermentablesWindow, SIGNAL(firstWindow()), this, SLOT(fromInventoryFermentables())); this->hide(); // Close the main window InventoryFermentablesWindow->show(); // Show a second window } void MainWindow::fromInventoryHops() { qDebug() << Q_FUNC_INFO; delete InventoryHopsWindow; this->show(); } void MainWindow::on_actionHops_triggered() { qDebug() << Q_FUNC_INFO; InventoryHopsWindow = new InventoryHops(this); QObject::connect(InventoryHopsWindow, SIGNAL(firstWindow()), this, SLOT(fromInventoryHops())); this->hide(); // Close the main window InventoryHopsWindow->show(); // Show a second window } void MainWindow::fromInventoryYeasts() { qDebug() << Q_FUNC_INFO; delete InventoryYeastsWindow; this->show(); } void MainWindow::on_actionYeasts_triggered() { qDebug() << Q_FUNC_INFO; InventoryYeastsWindow = new InventoryYeasts(this); QObject::connect(InventoryYeastsWindow, SIGNAL(firstWindow()), this, SLOT(fromInventoryYeasts())); this->hide(); // Close the main window InventoryYeastsWindow->show(); // Show a second window } void MainWindow::fromInventoryMiscs() { qDebug() << Q_FUNC_INFO; delete InventoryMiscsWindow; this->show(); } void MainWindow::on_actionMiscs_triggered() { qDebug() << Q_FUNC_INFO; InventoryMiscsWindow = new InventoryMiscs(this); QObject::connect(InventoryMiscsWindow, SIGNAL(firstWindow()), this, SLOT(fromInventoryMiscs())); this->hide(); // Close the main window InventoryMiscsWindow->show(); // Show a second window } void MainWindow::fromInventoryWaters() { qDebug() << Q_FUNC_INFO; delete InventoryWatersWindow; this->show(); } void MainWindow::on_actionWaters_triggered() { qDebug() << Q_FUNC_INFO; InventoryWatersWindow = new InventoryWaters(this); QObject::connect(InventoryWatersWindow, SIGNAL(firstWindow()), this, SLOT(fromInventoryWaters())); this->hide(); // Close the main window InventoryWatersWindow->show(); // Show a second window } void MainWindow::fromInventoryEquipments() { qDebug() << Q_FUNC_INFO; delete InventoryEquipmentsWindow; this->show(); } void MainWindow::on_actionEquipments_triggered() { qDebug() << Q_FUNC_INFO; InventoryEquipmentsWindow = new InventoryEquipments(this); QObject::connect(InventoryEquipmentsWindow, SIGNAL(firstWindow()), this, SLOT(fromInventoryEquipments())); this->hide(); // Close the main window InventoryEquipmentsWindow->show(); // Show a second window } 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 setup window } void MainWindow::on_actionAbout_triggered() { AboutDialog dialog(this); dialog.setModal(true); dialog.exec(); }