refactor: CoreProcess Remove the starting signal and use it like the others via CoreProcess::coreProcessStateChanged

This commit is contained in:
sithlord48 2025-10-10 18:54:57 -04:00 committed by Chris Rizzitello
parent d45196304f
commit f9c007cc3a
3 changed files with 4 additions and 8 deletions

View File

@ -275,7 +275,6 @@ void MainWindow::connectSlots()
connect(Settings::instance(), &Settings::serverSettingsChanged, this, &MainWindow::serverConfigSaving);
connect(Settings::instance(), &Settings::settingsChanged, this, &MainWindow::settingsChanged);
connect(&m_coreProcess, &CoreProcess::starting, this, &MainWindow::coreProcessStarting, Qt::DirectConnection);
connect(&m_coreProcess, &CoreProcess::error, this, &MainWindow::coreProcessError);
connect(&m_coreProcess, &CoreProcess::logLine, this, &MainWindow::handleLogLine);
connect(
@ -994,6 +993,10 @@ void MainWindow::coreProcessStateChanged(CoreProcessState state)
m_actionRestartCore->setVisible(true);
m_actionStopCore->setEnabled(true);
if (state == CoreProcessState::Starting) {
coreProcessStarting();
}
} else {
disconnect(ui->btnToggleCore, &QPushButton::clicked, m_actionStopCore, &QAction::trigger);
connect(ui->btnToggleCore, &QPushButton::clicked, m_actionStartCore, &QAction::trigger, Qt::UniqueConnection);

View File

@ -302,13 +302,7 @@ void CoreProcess::start(std::optional<ProcessMode> processModeOption)
qInfo().noquote() << QString("starting %1 process (%2 mode)").arg(coreMode, processModeToString(processMode));
// allow external listeners to abort the start process (e.g. licensing issue).
setProcessState(ProcessState::Starting);
Q_EMIT starting();
if (m_processState == ProcessState::Stopped) {
qDebug("core process start was cancelled by listener");
return;
}
#ifdef Q_OS_MAC
requestOSXNotificationPermission();

View File

@ -96,7 +96,6 @@ public:
}
Q_SIGNALS:
void starting();
void error(deskflow::gui::CoreProcess::Error error);
void logLine(const QString &line);
void connectionStateChanged(deskflow::gui::CoreProcess::ConnectionState state);