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

Method coreProcessStateChanged

src/lib/gui/MainWindow.cpp:965–1007  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

963}
964
965void MainWindow::coreProcessStateChanged(CoreProcessState state)
966{
967 updateStatus();
968
969 if (state == CoreProcessState::Started) {
970 qDebug() << "recording that core has started";
971 Settings::setValue(Settings::Gui::AutoStartCore, true);
972 if (m_coreProcess.mode() == CoreMode::Server &&
973 !Settings::value(Settings::Gui::ShownServerFirstStartMessage).toBool()) {
974 qDebug() << "starting core server for first time";
975 messages::showFirstServerStartMessage(this);
976 Settings::setValue(Settings::Gui::ShownServerFirstStartMessage, true);
977 }
978 }
979
980 if (state == CoreProcessState::Started || state == CoreProcessState::Starting ||
981 state == CoreProcessState::RetryPending) {
982 disconnect(ui->btnToggleCore, &QPushButton::clicked, m_actionStartCore, &QAction::trigger);
983 connect(ui->btnToggleCore, &QPushButton::clicked, m_actionStopCore, &QAction::trigger, Qt::UniqueConnection);
984
985 ui->btnRestartCore->setEnabled(true);
986 m_actionStartCore->setVisible(false);
987 m_actionRestartCore->setVisible(true);
988 m_actionStopCore->setEnabled(true);
989
990 if (state == CoreProcessState::Starting) {
991 if (deskflow::platform::isWayland()) {
992 m_waylandWarnings.showOnce(this);
993 }
994 saveSettings();
995 }
996
997 } else {
998 disconnect(ui->btnToggleCore, &QPushButton::clicked, m_actionStopCore, &QAction::trigger);
999 connect(ui->btnToggleCore, &QPushButton::clicked, m_actionStartCore, &QAction::trigger, Qt::UniqueConnection);
1000
1001 ui->btnRestartCore->setEnabled(false);
1002 m_actionStartCore->setVisible(true);
1003 m_actionRestartCore->setVisible(false);
1004 m_actionStopCore->setEnabled(false);
1005 }
1006 updateModeControlLabels();
1007}
1008
1009void MainWindow::coreConnectionStateChanged(CoreConnectionState state)
1010{

Callers

nothing calls this directly

Calls 4

isWaylandFunction · 0.85
modeMethod · 0.80
showOnceMethod · 0.80

Tested by

no test coverage detected