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

* 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

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

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

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

Co-authored-by: Andrii Batyiev <andrii-external@symless.com>
This commit is contained in:
Andrey Batyiev 2021-08-25 12:15:55 +03:00 committed by GitHub
parent 861f6ec279
commit 07f233ec74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 40 additions and 42 deletions

View file

@ -2,6 +2,7 @@ v1.14.2-snapshot
===========
Bug fixes:
- #7070 Fix radio button shifted focus on macOS
- #7077 Fix Ubuntu, CentOS and Debian build after SYNERGY-1161
Enhancements:
- #7068 Add Synergy restart when settings changed

View file

@ -124,8 +124,7 @@ QTextStream& Screen::writeAliasesSection(QTextStream& outStream) const
bool Screen::operator==(const Screen& screen) const
{
return m_Pixmap == screen.m_Pixmap &&
m_Name == screen.m_Name &&
return m_Name == screen.m_Name &&
m_Aliases == screen.m_Aliases &&
m_Modifiers == screen.m_Modifiers &&
m_SwitchCorners == screen.m_SwitchCorners &&

View file

@ -45,7 +45,7 @@ class Screen : public BaseConfig
Screen(const QString& name);
public:
const QPixmap* pixmap() const { return &m_Pixmap; }
const QPixmap& pixmap() const { return m_Pixmap; }
const QString& name() const { return m_Name; }
const QStringList& aliases() const { return m_Aliases; }
@ -73,9 +73,7 @@ class Screen : public BaseConfig
protected:
void init();
QPixmap* pixmap() { return &m_Pixmap; }
void setPixmap(const QPixmap& pixmap) { m_Pixmap = pixmap; }
QStringList& aliases() { return m_Aliases; }
void setModifier(int m, int n) { m_Modifiers[m] = n; }
QList<int>& modifiers() { return m_Modifiers; }

View file

@ -43,7 +43,7 @@ QVariant ScreenSetupModel::data(const QModelIndex& index, int role) const
case Qt::DecorationRole:
if (screen(index).isNull())
break;
return QIcon(*screen(index).pixmap());
return QIcon(screen(index).pixmap());
case Qt::ToolTipRole:
if (screen(index).isNull())

View file

@ -132,7 +132,7 @@ void ScreenSetupView::startDrag(Qt::DropActions)
if (pData == NULL)
return;
QPixmap pixmap = *model()->screen(indexes[0]).pixmap();
const QPixmap& pixmap = model()->screen(indexes[0]).pixmap();
QDrag* pDrag = new QDrag(this);
pDrag->setPixmap(pixmap);
pDrag->setMimeData(pData);

View file

@ -93,44 +93,44 @@ ServerConfigDialog::ServerConfigDialog(QWidget* parent, ServerConfig& config) :
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();});
connect(m_pCheckBoxSwitchDelay, &QCheckBox::stateChanged,
this, [this]( const int& v ) { serverConfig().haveSwitchDelay(v); onChange();});
connect(m_pSpinBoxSwitchDelay, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
this, [this]( const int& v ) { serverConfig().setSwitchDelay(v); onChange();});
connect(m_pCheckBoxSwitchDoubleTap, &QCheckBox::stateChanged,
this, [this]( const int& v ) { serverConfig().haveSwitchDoubleTap(v); onChange();});
connect(m_pSpinBoxSwitchDoubleTap, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
this, [this]( const int& v ) { serverConfig().setSwitchDoubleTap(v); onChange();});
connect(m_pCheckBoxEnableClipboard, &QCheckBox::stateChanged,
this, [this]( const int& v ) { serverConfig().setClipboardSharing(v); onChange();});
connect(m_pSpinBoxClipboardSizeLimit, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
this, [this]( const int& v ) { serverConfig().setClipboardSharingSize(v * 1024); onChange();});
connect(m_pCheckBoxHeartbeat, &QCheckBox::stateChanged,
this, [this]( const int& v ) { serverConfig().haveHeartbeat(v); onChange();});
connect(m_pSpinBoxHeartbeat, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
this, [this]( const int& v ) { serverConfig().setHeartbeat(v); onChange();});
connect(m_pCheckBoxRelativeMouseMoves, &QCheckBox::stateChanged,
this, [this]( const int& v ) { serverConfig().setRelativeMouseMoves(v); onChange();});
connect(m_pCheckBoxWin32KeepForeground, &QCheckBox::stateChanged,
this, [this]( const int& v ) { serverConfig().setWin32KeepForeground(v); onChange();});
connect(m_pCheckBoxIgnoreAutoConfigClient, &QCheckBox::stateChanged,
this, [this]( const int& v ) { serverConfig().setIgnoreAutoConfigClient(v); onChange();});
connect(m_pCheckBoxDisableLockToScreen, &QCheckBox::stateChanged,
this, [this]( const int& v ) { serverConfig().setDisableLockToScreen(v); onChange();});
connect(m_pCheckBoxCornerTopLeft, &QCheckBox::stateChanged,
this, [this]( const int& v ) { serverConfig().setSwitchCorner(BaseConfig::TopLeft, v); onChange();});
connect(m_pCheckBoxCornerTopRight, &QCheckBox::stateChanged,
this, [this]( const int& v ) { serverConfig().setSwitchCorner(BaseConfig::TopRight, v); onChange();});
connect(m_pCheckBoxCornerBottomLeft, &QCheckBox::stateChanged,
this, [this]( const int& v ) { serverConfig().setSwitchCorner(BaseConfig::BottomLeft, v); onChange();});
connect(m_pCheckBoxCornerBottomRight, &QCheckBox::stateChanged,
this, [this]( const int& v ) { serverConfig().setSwitchCorner(BaseConfig::BottomRight, v); onChange();});
connect(m_pSpinBoxSwitchCornerSize, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
this, [this]( const int& v ) { serverConfig().setSwitchCornerSize(v); onChange();});
//config
connect(m_pCheckBoxUseExternalConfig, &QCheckBox::stateChanged,
this, [this]( const auto& v ) { serverConfig().setUseExternalConfig(v); onChange();});
this, [this]( const int& v ) { serverConfig().setUseExternalConfig(v); onChange();});
connect(m_pEditConfigFile, &QLineEdit::textChanged,
this, [this]() { serverConfig().setConfigFile(m_pEditConfigFile->text()); onChange();});
}