src/MainWindow.cpp

changeset 78
3a6cba2dd05d
parent 77
86a3277a7317
child 79
e726db72da3c
equal deleted inserted replaced
77:86a3277a7317 78:3a6cba2dd05d
95 ui->mainStack->setCurrentIndex(-1); 95 ui->mainStack->setCurrentIndex(-1);
96 ui->mainStack->removeWidget(InventoryFermentablesWindow); 96 ui->mainStack->removeWidget(InventoryFermentablesWindow);
97 delete InventoryFermentablesWindow; 97 delete InventoryFermentablesWindow;
98 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) ); 98 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
99 ui->menuBar->setVisible(true); 99 ui->menuBar->setVisible(true);
100 statusBar()->clearMessage();
100 } 101 }
101 102
102 103
103 void MainWindow::on_actionFermentables_triggered() 104 void MainWindow::on_actionFermentables_triggered()
104 { 105 {
335 336
336 337
337 void MainWindow::fromSetup() 338 void MainWindow::fromSetup()
338 { 339 {
339 qDebug() << Q_FUNC_INFO; 340 qDebug() << Q_FUNC_INFO;
341 ui->mainStack->setCurrentIndex(-1);
342 ui->mainStack->removeWidget(SetupWindow);
340 delete SetupWindow; 343 delete SetupWindow;
341 this->show(); 344 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
345 ui->menuBar->setVisible(true);
342 } 346 }
343 347
344 348
345 void MainWindow::on_actionSetup_triggered() 349 void MainWindow::on_actionSetup_triggered()
346 { 350 {
347 qDebug() << Q_FUNC_INFO; 351 qDebug() << Q_FUNC_INFO;
348 SetupWindow = new Setup(this); 352 SetupWindow = new Setup(this);
349 QObject::connect(SetupWindow, SIGNAL(firstWindow()), this, SLOT(fromSetup())); 353 int index = ui->mainStack->count();
350 this->hide(); // Close the main window 354 ui->mainStack->addWidget(SetupWindow);
351 SetupWindow->show(); // Show a setup window 355 ui->mainStack->setCurrentIndex(index);
356 ui->menuBar->setVisible(false);
352 } 357 }
353 358
354 359
355 void MainWindow::on_actionAbout_triggered() 360 void MainWindow::on_actionAbout_triggered()
356 { 361 {
358 dialog.setModal(true); 363 dialog.setModal(true);
359 dialog.exec(); 364 dialog.exec();
360 } 365 }
361 366
362 367
368 void MainWindow::windowTitle(QString msg)
369 {
370 qDebug() << Q_FUNC_INFO << msg;
371 setWindowTitle(QString("BMSapp - %1 - %2").arg(VERSIONSTRING).arg(msg));
372 }
373
374
375 void MainWindow::statusMsg(QString msg)
376 {
377 qDebug() << Q_FUNC_INFO << msg;
378 statusBar()->showMessage(msg);
379 }
380

mercurial