1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-27 16:31:31 +00:00

Consolidates and disables failed attempt at final-window close behaviour.

This commit is contained in:
Thomas Harte 2020-06-21 23:52:41 -04:00
parent b17cceaeaf
commit 13336b8ad5

View File

@ -62,20 +62,17 @@ MainWindow::~MainWindow() {
// Store the current user selections.
storeSelections();
// SDI behaviour, which may or may not be normal (?): if the user is closing a
// final window, and it contains a machine, send them back to the machine picker.
// i.e. assume they were closing that document, not the application.
--mainWindowCount;
if(machine && !mainWindowCount) {
MainWindow *const other = new MainWindow;
other->show();
}
}
void MainWindow::closeEvent(QCloseEvent *event) {
if(mainWindowCount == 1 && machine) {
qDebug() << "close, yah";
}
// SDI behaviour, which may or may not be normal (?): if the user is closing a
// final window, and it contains a machine, send them back to the machine picker.
// i.e. assume they were closing that document, not the application.
// if(mainWindowCount == 1 && machine) {
// MainWindow *const other = new MainWindow;
// other->show();
// }
QMainWindow::closeEvent(event);
}