src/MainWindow.cpp

changeset 19
c94edc758a5b
parent 16
a5d8e783a7b0
child 24
684c6e74cc1b
--- a/src/MainWindow.cpp	Thu Feb 17 21:41:52 2022 +0100
+++ b/src/MainWindow.cpp	Fri Feb 18 15:53:02 2022 +0100
@@ -17,6 +17,7 @@
 #include "MainWindow.h"
 #include "AboutDialog.h"
 #include "InventorySuppliers.h"
+#include "InventoryFermentables.h"
 #include "Setup.h"
 #include "../ui/ui_MainWindow.h"
 #include "config.h"
@@ -69,6 +70,24 @@
 }
 
 
+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::fromSetup()
 {
     qDebug() << Q_FUNC_INFO;

mercurial