src/MainWindow.cpp

changeset 24
684c6e74cc1b
parent 19
c94edc758a5b
child 25
a9da2744609e
--- a/src/MainWindow.cpp	Sun Feb 20 12:13:22 2022 +0100
+++ b/src/MainWindow.cpp	Sun Feb 20 20:22:49 2022 +0100
@@ -18,6 +18,7 @@
 #include "AboutDialog.h"
 #include "InventorySuppliers.h"
 #include "InventoryFermentables.h"
+#include "InventoryHops.h"
 #include "Setup.h"
 #include "../ui/ui_MainWindow.h"
 #include "config.h"
@@ -88,6 +89,24 @@
 }
 
 
+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::fromSetup()
 {
     qDebug() << Q_FUNC_INFO;

mercurial