Synergy 1161 when clicking on save preferences on configure server window, automatically apply all the new settings (#7074)

* SYNERGY-1161 When clicking on "Save" preferences on "Configure server" window, automatically apply all the new settings
*Added comparison for all classes which used in server config

* SYNERGY-1161 When clicking on Save preferences on Configure server window, automatically apply all the new settings
*Added server config changes checking logic

* SYNERGY-1161 When clicking on Save preferences on Configure server window, automatically apply all the new settings
* Update ChangeLog

* SYNERGY-1161 When clicking on Save preferences on Configure server window, automatically apply all the new settings
*Fix code style

* SYNERGY-1161 When clicking on Save preferences on Configure server window, automatically apply all the new settings
* Fix Linux build

* SYNERGY-1161 When clicking on Save preferences on Configure server window, automatically apply all the new settings
*Fix Sonar code smells

Co-authored-by: Andrii Batyiev <andrii-external@symless.com>
This commit is contained in:
Andrey Batyiev 2021-08-20 15:22:07 +03:00 committed by GitHub
parent a703280d38
commit 861f6ec279
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 185 additions and 31 deletions

View file

@ -6,6 +6,7 @@ Bug fixes:
Enhancements: Enhancements:
- #7068 Add Synergy restart when settings changed - #7068 Add Synergy restart when settings changed
- #7072 Ability to run synergy as a pre-login agent - #7072 Ability to run synergy as a pre-login agent
- #7074 Add Synergy restart when server settings changed
=========== ===========
v1.14.1-rc v1.14.1-rc

View file

@ -143,6 +143,19 @@ void Action::saveSettings(QSettings& settings) const
settings.setValue("restartServer", restartServer()); settings.setValue("restartServer", restartServer());
} }
bool Action::operator==(const Action& a) const
{
return m_KeySequence == a.m_KeySequence &&
m_Type == a.m_Type &&
m_TypeScreenNames == a.m_TypeScreenNames &&
m_SwitchScreenName == a.m_SwitchScreenName &&
m_SwitchDirection == a.m_SwitchDirection &&
m_LockCursorMode == a.m_LockCursorMode &&
m_ActiveOnRelease == a.m_ActiveOnRelease &&
m_HasScreens == a.m_HasScreens &&
m_restartServer == a.m_restartServer;
}
QTextStream& operator<<(QTextStream& outStream, const Action& action) QTextStream& operator<<(QTextStream& outStream, const Action& action)
{ {
if (action.activeOnRelease()) if (action.activeOnRelease())

View file

@ -77,6 +77,8 @@ class Action
bool haveScreens() const { return m_HasScreens; } bool haveScreens() const { return m_HasScreens; }
bool restartServer() const { return m_restartServer; } bool restartServer() const { return m_restartServer; }
bool operator==(const Action& a) const;
protected: protected:
KeySequence& keySequence() { return m_KeySequence; } KeySequence& keySequence() { return m_KeySequence; }
void setKeySequence(const KeySequence& seq) { m_KeySequence = seq; } void setKeySequence(const KeySequence& seq) { m_KeySequence = seq; }

View file

@ -66,6 +66,11 @@ void Hotkey::saveSettings(QSettings& settings) const
settings.endArray(); settings.endArray();
} }
bool Hotkey::operator==(const Hotkey& hk) const
{
return m_KeySequence == hk.m_KeySequence && m_Actions == hk.m_Actions;
}
QTextStream& operator<<(QTextStream& outStream, const Hotkey& hotkey) QTextStream& operator<<(QTextStream& outStream, const Hotkey& hotkey)
{ {
for (int i = 0; i < hotkey.actions().size(); i++) for (int i = 0; i < hotkey.actions().size(); i++)

View file

@ -48,6 +48,8 @@ class Hotkey
void loadSettings(QSettings& settings); void loadSettings(QSettings& settings);
void saveSettings(QSettings& settings) const; void saveSettings(QSettings& settings) const;
bool operator==(const Hotkey& hk) const;
protected: protected:
KeySequence& keySequence() { return m_KeySequence; } KeySequence& keySequence() { return m_KeySequence; }
void setKeySequence(const KeySequence& seq) { m_KeySequence = seq; } void setKeySequence(const KeySequence& seq) { m_KeySequence = seq; }

View file

@ -235,3 +235,10 @@ QString KeySequence::keyToString(int key)
// give up, synergy probably won't handle this // give up, synergy probably won't handle this
return ""; return "";
} }
bool KeySequence::operator==(const KeySequence& ks) const
{
return m_Sequence == ks.m_Sequence &&
m_Modifiers == ks.m_Modifiers &&
m_IsValid == ks.m_IsValid;
}

View file

@ -41,6 +41,8 @@ class KeySequence
void loadSettings(QSettings& settings); void loadSettings(QSettings& settings);
const QList<int>& sequence() const { return m_Sequence; } const QList<int>& sequence() const { return m_Sequence; }
bool operator==(const KeySequence& ks) const;
private: private:
void setValid(bool b) { m_IsValid = b; } void setValid(bool b) { m_IsValid = b; }
void setModifiers(int i) { m_Modifiers = i; } void setModifiers(int i) { m_Modifiers = i; }

View file

@ -1355,7 +1355,14 @@ void MainWindow::showConfigureServer(const QString& message)
{ {
ServerConfigDialog dlg(this, serverConfig()); ServerConfigDialog dlg(this, serverConfig());
dlg.message(message); dlg.message(message);
dlg.exec(); auto result = dlg.exec();
if(result == QDialog::Accepted) {
auto state = synergyState();
if ((state == synergyConnected) || (state == synergyConnecting) || (state == synergyListening)) {
restartSynergy();
}
}
} }
void MainWindow::on_m_pButtonConfigureServer_clicked() void MainWindow::on_m_pButtonConfigureServer_clicked()

View file

@ -122,6 +122,19 @@ QTextStream& Screen::writeAliasesSection(QTextStream& outStream) const
return outStream; return outStream;
} }
bool Screen::operator==(const Screen& screen) const
{
return m_Pixmap == screen.m_Pixmap &&
m_Name == screen.m_Name &&
m_Aliases == screen.m_Aliases &&
m_Modifiers == screen.m_Modifiers &&
m_SwitchCorners == screen.m_SwitchCorners &&
m_SwitchCornerSize == screen.m_SwitchCornerSize &&
m_Fixes == screen.m_Fixes &&
m_Swapped == screen.m_Swapped &&
m_isServer == screen.m_isServer;
}
QDataStream& operator<<(QDataStream& outStream, const Screen& screen) QDataStream& operator<<(QDataStream& outStream, const Screen& screen)
{ {
return outStream return outStream

View file

@ -69,6 +69,8 @@ class Screen : public BaseConfig
bool isServer() const { return m_isServer;} bool isServer() const { return m_isServer;}
void markAsServer() { m_isServer = true; } void markAsServer() { m_isServer = true; }
bool operator==(const Screen& screen) const;
protected: protected:
void init(); void init();
QPixmap* pixmap() { return &m_Pixmap; } QPixmap* pixmap() { return &m_Pixmap; }

View file

@ -125,3 +125,8 @@ void ScreenList::addScreenToFirstEmpty(const Screen& newScreen)
} }
} }
bool ScreenList::operator==(const ScreenList& sc) const
{
return m_width == sc.m_width && QList::operator==(sc);
}

View file

@ -47,6 +47,12 @@ public:
* @param newScreen * @param newScreen
*/ */
void addScreenToFirstEmpty(const Screen& newScreen); void addScreenToFirstEmpty(const Screen& newScreen);
/**
* @brief Returns true if screens are equal
* @param sc
*/
bool operator==(const ScreenList& sc) const;
}; };
#endif // SCREENLIST_H #endif // SCREENLIST_H

View file

@ -138,12 +138,15 @@ bool ScreenSetupModel::dropMimeData(const QMimeData* data, Qt::DropAction action
screen(parent.column(), parent.row()) = droppedScreen; screen(parent.column(), parent.row()) = droppedScreen;
emit screensChanged();
return true; return true;
} }
void ScreenSetupModel::addScreen(const Screen& newScreen) void ScreenSetupModel::addScreen(const Screen& newScreen)
{ {
m_Screens.addScreenByPriority(newScreen); m_Screens.addScreenByPriority(newScreen);
emit screensChanged();
} }
bool ScreenSetupModel::isFull() const bool ScreenSetupModel::isFull() const

View file

@ -53,6 +53,10 @@ class ScreenSetupModel : public QAbstractTableModel
QMimeData* mimeData(const QModelIndexList& indexes) const; QMimeData* mimeData(const QModelIndexList& indexes) const;
bool isFull() const; bool isFull() const;
signals:
void screensChanged();
protected: protected:
bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent); bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent);
const Screen& screen(const QModelIndex& index) const { return screen(index.column(), index.row()); } const Screen& screen(const QModelIndex& index) const { return screen(index.column(), index.row()); }

View file

@ -76,6 +76,7 @@ void ScreenSetupView::mouseDoubleClickEvent(QMouseEvent* event)
{ {
ScreenSettingsDialog dlg(this, &model()->screen(col, row), &model()->m_Screens); ScreenSettingsDialog dlg(this, &model()->screen(col, row), &model()->m_Screens);
dlg.exec(); dlg.exec();
emit model()->screensChanged();
} }
} }
else else
@ -147,6 +148,8 @@ void ScreenSetupView::startDrag(Qt::DropActions)
model()->screen(indexes[0]) = Screen(); model()->screen(indexes[0]) = Screen();
else else
model()->screen(indexes[0]).setSwapped(false); model()->screen(indexes[0]).setSwapped(false);
emit model()->screensChanged();
} }
} }

View file

@ -76,6 +76,31 @@ bool ServerConfig::save(const QString& fileName) const
return true; return true;
} }
bool ServerConfig::operator==(const ServerConfig& sc) const
{
return m_Screens == sc.m_Screens &&
m_NumColumns == sc.m_NumColumns &&
m_NumRows == sc.m_NumRows &&
m_HasHeartbeat == sc.m_HasHeartbeat &&
m_Heartbeat == sc.m_Heartbeat &&
m_RelativeMouseMoves == sc.m_RelativeMouseMoves &&
m_Win32KeepForeground == sc.m_Win32KeepForeground &&
m_HasSwitchDelay == sc.m_HasSwitchDelay &&
m_SwitchDelay == sc.m_SwitchDelay &&
m_HasSwitchDoubleTap == sc.m_HasSwitchDoubleTap &&
m_SwitchDoubleTap == sc.m_SwitchDoubleTap &&
m_SwitchCornerSize == sc.m_SwitchCornerSize &&
m_SwitchCorners == sc.m_SwitchCorners &&
m_Hotkeys == sc.m_Hotkeys &&
m_pAppConfig == sc.m_pAppConfig &&
m_IgnoreAutoConfigClient == sc.m_IgnoreAutoConfigClient &&
m_EnableDragAndDrop == sc.m_EnableDragAndDrop &&
m_DisableLockToScreen == sc.m_DisableLockToScreen &&
m_ClipboardSharing == sc.m_ClipboardSharing &&
m_ClipboardSharingSize == sc.m_ClipboardSharingSize &&
m_pMainWindow == sc.m_pMainWindow;
}
void ServerConfig::save(QFile& file) const void ServerConfig::save(QFile& file) const
{ {
QTextStream outStream(&file); QTextStream outStream(&file);

View file

@ -50,6 +50,8 @@ class ServerConfig : public BaseConfig, public GUI::Config::ConfigBase
ServerConfig& operator=(const ServerConfig &src) =default; ServerConfig& operator=(const ServerConfig &src) =default;
ServerConfig& operator=(ServerConfig &&) =delete; ServerConfig& operator=(ServerConfig &&) =delete;
bool operator==(const ServerConfig& sc) const;
public: public:
const ScreenList& screens() const { return m_Screens; } const ScreenList& screens() const { return m_Screens; }
int numColumns() const { return m_NumColumns; } int numColumns() const { return m_NumColumns; }

View file

@ -31,6 +31,8 @@ ServerConfigDialog::ServerConfigDialog(QWidget* parent, ServerConfig& config) :
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint), QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
Ui::ServerConfigDialogBase(), Ui::ServerConfigDialogBase(),
m_OrigServerConfig(config), m_OrigServerConfig(config),
m_OrigServerAppConfigUseExternalConfig(config.getUseExternalConfig()),
m_OrigServerAppConfigExternalConfigFile(config.getConfigFile()),
m_ServerConfig(config), m_ServerConfig(config),
m_ScreenSetupModel(serverConfig().screens(), serverConfig().numColumns(), serverConfig().numRows()), m_ScreenSetupModel(serverConfig().screens(), serverConfig().numColumns(), serverConfig().numRows()),
m_Message("") m_Message("")
@ -84,6 +86,53 @@ ServerConfigDialog::ServerConfigDialog(QWidget* parent, ServerConfig& config) :
m_pButtonAddComputer->setEnabled(!model().isFull()); m_pButtonAddComputer->setEnabled(!model().isFull());
connect(m_pTrashScreenWidget, SIGNAL(screenRemoved()), this, SLOT(onScreenRemoved())); connect(m_pTrashScreenWidget, SIGNAL(screenRemoved()), this, SLOT(onScreenRemoved()));
onChange();
//computers
connect(&m_ScreenSetupModel, &ScreenSetupModel::screensChanged, this, &ServerConfigDialog::onChange);
//advanced
connect(m_pCheckBoxSwitchDelay, &QCheckBox::stateChanged,
this, [this]( const auto& v ) { serverConfig().haveSwitchDelay(v); onChange();});
connect(m_pSpinBoxSwitchDelay, QOverload<int>::of(&QSpinBox::valueChanged),
this, [this]( const auto& v ) { serverConfig().setSwitchDelay(v); onChange();});
connect(m_pCheckBoxSwitchDoubleTap, &QCheckBox::stateChanged,
this, [this]( const auto& v ) { serverConfig().haveSwitchDoubleTap(v); onChange();});
connect(m_pSpinBoxSwitchDoubleTap, QOverload<int>::of(&QSpinBox::valueChanged),
this, [this]( const auto& v ) { serverConfig().setSwitchDoubleTap(v); onChange();});
connect(m_pCheckBoxEnableClipboard, &QCheckBox::stateChanged,
this, [this]( const auto& v ) { serverConfig().setClipboardSharing(v); onChange();});
connect(m_pSpinBoxClipboardSizeLimit, QOverload<int>::of(&QSpinBox::valueChanged),
this, [this]( const auto& v ) { serverConfig().setClipboardSharingSize(v * 1024); onChange();});
connect(m_pCheckBoxHeartbeat, &QCheckBox::stateChanged,
this, [this]( const auto& v ) { serverConfig().haveHeartbeat(v); onChange();});
connect(m_pSpinBoxHeartbeat, QOverload<int>::of(&QSpinBox::valueChanged),
this, [this]( const auto& v ) { serverConfig().setHeartbeat(v); onChange();});
connect(m_pCheckBoxRelativeMouseMoves, &QCheckBox::stateChanged,
this, [this]( const auto& v ) { serverConfig().setRelativeMouseMoves(v); onChange();});
connect(m_pCheckBoxWin32KeepForeground, &QCheckBox::stateChanged,
this, [this]( const auto& v ) { serverConfig().setWin32KeepForeground(v); onChange();});
connect(m_pCheckBoxIgnoreAutoConfigClient, &QCheckBox::stateChanged,
this, [this]( const auto& v ) { serverConfig().setIgnoreAutoConfigClient(v); onChange();});
connect(m_pCheckBoxDisableLockToScreen, &QCheckBox::stateChanged,
this, [this]( const auto& v ) { serverConfig().setDisableLockToScreen(v); onChange();});
connect(m_pCheckBoxCornerTopLeft, &QCheckBox::stateChanged,
this, [this]( const auto& v ) { serverConfig().setSwitchCorner(BaseConfig::TopLeft, v); onChange();});
connect(m_pCheckBoxCornerTopRight, &QCheckBox::stateChanged,
this, [this]( const auto& v ) { serverConfig().setSwitchCorner(BaseConfig::TopRight, v); onChange();});
connect(m_pCheckBoxCornerBottomLeft, &QCheckBox::stateChanged,
this, [this]( const auto& v ) { serverConfig().setSwitchCorner(BaseConfig::BottomLeft, v); onChange();});
connect(m_pCheckBoxCornerBottomRight, &QCheckBox::stateChanged,
this, [this]( const auto& v ) { serverConfig().setSwitchCorner(BaseConfig::BottomRight, v); onChange();});
connect(m_pSpinBoxSwitchCornerSize, QOverload<int>::of(&QSpinBox::valueChanged),
this, [this]( const auto& v ) { serverConfig().setSwitchCornerSize(v); onChange();});
//config
connect(m_pCheckBoxUseExternalConfig, &QCheckBox::stateChanged,
this, [this]( const auto& v ) { serverConfig().setUseExternalConfig(v); onChange();});
connect(m_pEditConfigFile, &QLineEdit::textChanged,
this, [this]() { serverConfig().setConfigFile(m_pEditConfigFile->text()); onChange();});
} }
void ServerConfigDialog::showEvent(QShowEvent* event) void ServerConfigDialog::showEvent(QShowEvent* event)
@ -115,32 +164,6 @@ void ServerConfigDialog::accept()
} }
} }
serverConfig().setConfigFile(m_pEditConfigFile->text());
serverConfig().setUseExternalConfig(m_pCheckBoxUseExternalConfig->isChecked());
serverConfig().haveHeartbeat(m_pCheckBoxHeartbeat->isChecked());
serverConfig().setHeartbeat(m_pSpinBoxHeartbeat->value());
serverConfig().setRelativeMouseMoves(m_pCheckBoxRelativeMouseMoves->isChecked());
serverConfig().setWin32KeepForeground(m_pCheckBoxWin32KeepForeground->isChecked());
serverConfig().haveSwitchDelay(m_pCheckBoxSwitchDelay->isChecked());
serverConfig().setSwitchDelay(m_pSpinBoxSwitchDelay->value());
serverConfig().haveSwitchDoubleTap(m_pCheckBoxSwitchDoubleTap->isChecked());
serverConfig().setSwitchDoubleTap(m_pSpinBoxSwitchDoubleTap->value());
serverConfig().setSwitchCorner(BaseConfig::TopLeft, m_pCheckBoxCornerTopLeft->isChecked());
serverConfig().setSwitchCorner(BaseConfig::TopRight, m_pCheckBoxCornerTopRight->isChecked());
serverConfig().setSwitchCorner(BaseConfig::BottomLeft, m_pCheckBoxCornerBottomLeft->isChecked());
serverConfig().setSwitchCorner(BaseConfig::BottomRight, m_pCheckBoxCornerBottomRight->isChecked());
serverConfig().setSwitchCornerSize(m_pSpinBoxSwitchCornerSize->value());
serverConfig().setIgnoreAutoConfigClient(m_pCheckBoxIgnoreAutoConfigClient->isChecked());
serverConfig().setDisableLockToScreen(m_pCheckBoxDisableLockToScreen->isChecked());
serverConfig().setClipboardSharingSize(m_pSpinBoxClipboardSizeLimit->value() * 1024);
serverConfig().setClipboardSharing(m_pCheckBoxEnableClipboard->isChecked()
&& m_pSpinBoxClipboardSizeLimit->value());
// now that the dialog has been accepted, copy the new server config to the original one, // now that the dialog has been accepted, copy the new server config to the original one,
// which is a reference to the one in MainWindow. // which is a reference to the one in MainWindow.
setOrigServerConfig(serverConfig()); setOrigServerConfig(serverConfig());
@ -148,14 +171,22 @@ void ServerConfigDialog::accept()
QDialog::accept(); QDialog::accept();
} }
void ServerConfigDialog::reject()
{
serverConfig().setUseExternalConfig(m_OrigServerAppConfigUseExternalConfig);
serverConfig().setConfigFile(m_OrigServerAppConfigExternalConfigFile);
QDialog::reject();
}
void ServerConfigDialog::on_m_pButtonNewHotkey_clicked() void ServerConfigDialog::on_m_pButtonNewHotkey_clicked()
{ {
Hotkey hotkey; Hotkey hotkey;
HotkeyDialog dlg(this, hotkey); HotkeyDialog dlg(this, hotkey);
if (dlg.exec() == QDialog::Accepted) if (dlg.exec() == QDialog::Accepted) {
{
serverConfig().hotkeys().append(hotkey); serverConfig().hotkeys().append(hotkey);
m_pListHotkeys->addItem(hotkey.text()); m_pListHotkeys->addItem(hotkey.text());
onChange();
} }
} }
@ -165,8 +196,10 @@ void ServerConfigDialog::on_m_pButtonEditHotkey_clicked()
Q_ASSERT(idx >= 0 && idx < serverConfig().hotkeys().size()); Q_ASSERT(idx >= 0 && idx < serverConfig().hotkeys().size());
Hotkey& hotkey = serverConfig().hotkeys()[idx]; Hotkey& hotkey = serverConfig().hotkeys()[idx];
HotkeyDialog dlg(this, hotkey); HotkeyDialog dlg(this, hotkey);
if (dlg.exec() == QDialog::Accepted) if (dlg.exec() == QDialog::Accepted) {
m_pListHotkeys->currentItem()->setText(hotkey.text()); m_pListHotkeys->currentItem()->setText(hotkey.text());
onChange();
}
} }
void ServerConfigDialog::on_m_pButtonRemoveHotkey_clicked() void ServerConfigDialog::on_m_pButtonRemoveHotkey_clicked()
@ -176,6 +209,7 @@ void ServerConfigDialog::on_m_pButtonRemoveHotkey_clicked()
serverConfig().hotkeys().removeAt(idx); serverConfig().hotkeys().removeAt(idx);
m_pListActions->clear(); m_pListActions->clear();
delete m_pListHotkeys->item(idx); delete m_pListHotkeys->item(idx);
onChange();
} }
void ServerConfigDialog::on_m_pListHotkeys_itemSelectionChanged() void ServerConfigDialog::on_m_pListHotkeys_itemSelectionChanged()
@ -218,6 +252,7 @@ void ServerConfigDialog::on_m_pButtonNewAction_clicked()
{ {
hotkey.actions().append(action); hotkey.actions().append(action);
m_pListActions->addItem(action.text()); m_pListActions->addItem(action.text());
onChange();
} }
} }
@ -232,8 +267,10 @@ void ServerConfigDialog::on_m_pButtonEditAction_clicked()
Action& action = hotkey.actions()[idxAction]; Action& action = hotkey.actions()[idxAction];
ActionDialog dlg(this, serverConfig(), hotkey, action); ActionDialog dlg(this, serverConfig(), hotkey, action);
if (dlg.exec() == QDialog::Accepted) if (dlg.exec() == QDialog::Accepted) {
m_pListActions->currentItem()->setText(action.text()); m_pListActions->currentItem()->setText(action.text());
onChange();
}
} }
void ServerConfigDialog::on_m_pButtonRemoveAction_clicked() void ServerConfigDialog::on_m_pButtonRemoveAction_clicked()
@ -247,6 +284,7 @@ void ServerConfigDialog::on_m_pButtonRemoveAction_clicked()
hotkey.actions().removeAt(idxAction); hotkey.actions().removeAt(idxAction);
delete m_pListActions->currentItem(); delete m_pListActions->currentItem();
onChange();
} }
void ServerConfigDialog::on_m_pCheckBoxEnableClipboard_stateChanged(int const state) void ServerConfigDialog::on_m_pCheckBoxEnableClipboard_stateChanged(int const state)
@ -280,6 +318,7 @@ void ServerConfigDialog::on_m_pButtonAddComputer_clicked()
void ServerConfigDialog::onScreenRemoved() void ServerConfigDialog::onScreenRemoved()
{ {
m_pButtonAddComputer->setEnabled(true); m_pButtonAddComputer->setEnabled(true);
onChange();
} }
void ServerConfigDialog::on_m_pCheckBoxUseExternalConfig_toggled(bool checked) void ServerConfigDialog::on_m_pCheckBoxUseExternalConfig_toggled(bool checked)
@ -311,3 +350,10 @@ bool ServerConfigDialog::on_m_pButtonBrowseConfigFile_clicked()
return false; return false;
} }
void ServerConfigDialog::onChange()
{
bool isAppConfigDataEqual = m_OrigServerAppConfigUseExternalConfig == serverConfig().getUseExternalConfig() &&
m_OrigServerAppConfigExternalConfigFile == serverConfig().getConfigFile();
m_pButtonBox->button(QDialogButtonBox::Ok)->setEnabled(!isAppConfigDataEqual || !(m_OrigServerConfig == m_ServerConfig));
}

View file

@ -36,6 +36,7 @@ class ServerConfigDialog : public QDialog, public Ui::ServerConfigDialogBase
public slots: public slots:
void accept(); void accept();
void reject() override;
void showEvent(QShowEvent* event); void showEvent(QShowEvent* event);
void message(const QString& message) { m_Message = message; } void message(const QString& message) { m_Message = message; }
@ -62,9 +63,14 @@ class ServerConfigDialog : public QDialog, public Ui::ServerConfigDialogBase
private: private:
ServerConfig& m_OrigServerConfig; ServerConfig& m_OrigServerConfig;
bool m_OrigServerAppConfigUseExternalConfig;
QString m_OrigServerAppConfigExternalConfigFile;
ServerConfig m_ServerConfig; ServerConfig m_ServerConfig;
ScreenSetupModel m_ScreenSetupModel; ScreenSetupModel m_ScreenSetupModel;
QString m_Message; QString m_Message;
private slots:
void onChange();
}; };
#endif #endif