MCPcopy Create free account
hub / github.com/deskflow/deskflow / closeEvent

Method closeEvent

src/lib/gui/MainWindow.cpp:861–887  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

859}
860
861void 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
889void MainWindow::showFirstConnectedMessage()
890{

Callers

nothing calls this directly

Calls 4

showCloseReminderFunction · 0.85
ignoreMethod · 0.80
isStartedMethod · 0.80
acceptMethod · 0.45

Tested by

no test coverage detected