refactor: CoreProcess Remove the starting signal and use it like the others via CoreProcess::coreProcessStateChanged
This commit is contained in:
parent
d45196304f
commit
f9c007cc3a
3 changed files with 4 additions and 8 deletions
|
|
@ -275,7 +275,6 @@ void MainWindow::connectSlots()
|
||||||
connect(Settings::instance(), &Settings::serverSettingsChanged, this, &MainWindow::serverConfigSaving);
|
connect(Settings::instance(), &Settings::serverSettingsChanged, this, &MainWindow::serverConfigSaving);
|
||||||
connect(Settings::instance(), &Settings::settingsChanged, this, &MainWindow::settingsChanged);
|
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::error, this, &MainWindow::coreProcessError);
|
||||||
connect(&m_coreProcess, &CoreProcess::logLine, this, &MainWindow::handleLogLine);
|
connect(&m_coreProcess, &CoreProcess::logLine, this, &MainWindow::handleLogLine);
|
||||||
connect(
|
connect(
|
||||||
|
|
@ -994,6 +993,10 @@ void MainWindow::coreProcessStateChanged(CoreProcessState state)
|
||||||
m_actionRestartCore->setVisible(true);
|
m_actionRestartCore->setVisible(true);
|
||||||
m_actionStopCore->setEnabled(true);
|
m_actionStopCore->setEnabled(true);
|
||||||
|
|
||||||
|
if (state == CoreProcessState::Starting) {
|
||||||
|
coreProcessStarting();
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
disconnect(ui->btnToggleCore, &QPushButton::clicked, m_actionStopCore, &QAction::trigger);
|
disconnect(ui->btnToggleCore, &QPushButton::clicked, m_actionStopCore, &QAction::trigger);
|
||||||
connect(ui->btnToggleCore, &QPushButton::clicked, m_actionStartCore, &QAction::trigger, Qt::UniqueConnection);
|
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));
|
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);
|
setProcessState(ProcessState::Starting);
|
||||||
Q_EMIT starting();
|
|
||||||
if (m_processState == ProcessState::Stopped) {
|
|
||||||
qDebug("core process start was cancelled by listener");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
requestOSXNotificationPermission();
|
requestOSXNotificationPermission();
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,6 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void starting();
|
|
||||||
void error(deskflow::gui::CoreProcess::Error error);
|
void error(deskflow::gui::CoreProcess::Error error);
|
||||||
void logLine(const QString &line);
|
void logLine(const QString &line);
|
||||||
void connectionStateChanged(deskflow::gui::CoreProcess::ConnectionState state);
|
void connectionStateChanged(deskflow::gui::CoreProcess::ConnectionState state);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue