mirror of
https://github.com/deskflow/deskflow.git
synced 2026-07-04 21:04:59 +08:00
#6587 Added signal when auto config is changed to update UI
This commit is contained in:
parent
edbeb325bb
commit
fdd09d0f5d
@ -244,6 +244,7 @@ void AppConfig::setElevateMode(ElevateMode em) { m_ElevateMode = em; }
|
||||
void AppConfig::setAutoConfig(bool autoConfig)
|
||||
{
|
||||
m_AutoConfig = autoConfig;
|
||||
emit zeroConfToggled();
|
||||
}
|
||||
|
||||
void AppConfig::setAutoConfigServer(QString autoConfigServer)
|
||||
|
||||
@ -161,6 +161,7 @@ protected:
|
||||
|
||||
signals:
|
||||
void sslToggled(bool enabled);
|
||||
void zeroConfToggled();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@ -181,6 +181,9 @@ MainWindow::MainWindow (QSettings& settings, AppConfig& appConfig,
|
||||
connect (m_AppConfig, SIGNAL(sslToggled(bool)),
|
||||
this, SLOT(sslToggled(bool)), Qt::QueuedConnection);
|
||||
|
||||
connect (m_AppConfig, SIGNAL(zeroConfToggled()),
|
||||
this, SLOT(zeroConfToggled()), Qt::QueuedConnection);
|
||||
|
||||
#ifdef SYNERGY_ENTERPRISE
|
||||
setWindowTitle ("Synergy 1 Enterprise");
|
||||
#else
|
||||
@ -355,6 +358,15 @@ void MainWindow::saveSettings()
|
||||
settings().sync();
|
||||
}
|
||||
|
||||
void MainWindow::zeroConfToggled() {
|
||||
#ifndef SYNERGY_ENTERPRISE
|
||||
updateZeroconfService();
|
||||
|
||||
addZeroconfServer(m_AppConfig->autoConfigServer());
|
||||
|
||||
updateAutoConfigWidgets();
|
||||
#endif
|
||||
}
|
||||
void MainWindow::setIcon(qSynergyState state)
|
||||
{
|
||||
QIcon icon;
|
||||
|
||||
@ -160,6 +160,9 @@ public slots:
|
||||
void updateFound(const QString& version);
|
||||
void saveSettings();
|
||||
|
||||
/// @brief Receives the signal that the auto config option has changed
|
||||
void zeroConfToggled();
|
||||
|
||||
protected:
|
||||
QSettings& settings() { return m_Settings; }
|
||||
AppConfig& appConfig() { return *m_AppConfig; }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user