src/MainWindow.cpp

changeset 75
5f953abbd73c
parent 74
4ac38457a709
child 76
93395c4d6c8d
--- a/src/MainWindow.cpp	Sun Mar 20 20:45:58 2022 +0100
+++ b/src/MainWindow.cpp	Sun Mar 20 20:59:05 2022 +0100
@@ -260,16 +260,19 @@
     int index = ui->mainStack->count();
     ui->mainStack->addWidget(ProfileWatersWindow);
     ui->mainStack->setCurrentIndex(index);
-    setWindowTitle(QString("BMSapp - %1 - Profile Waters").arg(VERSIONSTRING));
-//    ui->menuBar->setVisible(false);
+    setWindowTitle(QString("BMSapp - %1 - Water Profiles").arg(VERSIONSTRING));
+    ui->menuBar->setVisible(false);
 }
 
 
 void MainWindow::fromProfileMashs()
 {
     qDebug() << Q_FUNC_INFO;
+    ui->mainStack->setCurrentIndex(-1);
+    ui->mainStack->removeWidget(ProfileMashsWindow);
     delete ProfileMashsWindow;
-    this->show();
+    setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
+    ui->menuBar->setVisible(true);
 }
 
 
@@ -277,9 +280,11 @@
 {
     qDebug() << Q_FUNC_INFO;
     ProfileMashsWindow = new ProfileMashs(this);
-    QObject::connect(ProfileMashsWindow, SIGNAL(firstWindow()), this, SLOT(fromProfileMashs()));
-    this->hide();    // Close the main window
-    ProfileMashsWindow->show();  // Show a second window
+    int index = ui->mainStack->count();
+    ui->mainStack->addWidget(ProfileMashsWindow);
+    ui->mainStack->setCurrentIndex(index);
+    setWindowTitle(QString("BMSapp - %1 - Mash Profiles").arg(VERSIONSTRING));
+    ui->menuBar->setVisible(false);
 }
 
 

mercurial