| 859 | } |
| 860 | |
| 861 | void MainWindow::closeEvent(QCloseEvent *event) |
| 862 | { |
| 863 | if (Settings::value(Settings::Gui::CloseToTray).toBool() && event->spontaneous()) { |
| 864 | if (Settings::value(Settings::Gui::CloseReminder).toBool()) { |
| 865 | messages::showCloseReminder(this); |
| 866 | Settings::setValue(Settings::Gui::CloseReminder, false); |
| 867 | } |
| 868 | Settings::setValue(Settings::Gui::WindowGeometry, geometry()); |
| 869 | qDebug() << "hiding to tray"; |
| 870 | hide(); |
| 871 | event->ignore(); |
| 872 | return; |
| 873 | } |
| 874 | |
| 875 | if (m_saveOnExit) { |
| 876 | Settings::setValue(Settings::Gui::WindowGeometry, geometry()); |
| 877 | Settings::setValue(Settings::Gui::AutoStartCore, m_coreProcess.isStarted()); |
| 878 | } |
| 879 | qDebug() << "quitting application"; |
| 880 | |
| 881 | // any connected dock view acitons will be triggered |
| 882 | // disconnect them before accepting the event |
| 883 | disconnect(m_logDock->toggleViewAction(), &QAction::toggled, nullptr, nullptr); |
| 884 | |
| 885 | event->accept(); |
| 886 | QApplication::quit(); |
| 887 | } |
| 888 | |
| 889 | void MainWindow::showFirstConnectedMessage() |
| 890 | { |
nothing calls this directly
no test coverage detected