mirror of
https://github.com/deskflow/deskflow.git
synced 2026-07-04 21:04:59 +08:00
refactor: CoreProcess Remove the starting signal and use it like the others via CoreProcess::coreProcessStateChanged
This commit is contained in:
parent
d45196304f
commit
f9c007cc3a
@ -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);
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user