2012-06-10 16:50:54 +00:00
|
|
|
/*
|
2024-09-17 19:00:25 +00:00
|
|
|
* Deskflow -- mouse and keyboard sharing utility
|
2025-02-01 13:49:38 +00:00
|
|
|
* SPDX-FileCopyrightText: (C) 2025 Chris Rizzitello <sithlord48@gmail.com>
|
2026-06-08 20:37:23 +00:00
|
|
|
* SPDX-FileCopyrightText: (C) 2012 - 2016 Synergy App Ltd
|
2025-01-24 00:11:17 +00:00
|
|
|
* SPDX-FileCopyrightText: (C) 2008 Volker Lanz <vl@fidra.de>
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
2012-06-10 16:50:54 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "ServerConfigDialog.h"
|
2024-10-18 23:52:32 +00:00
|
|
|
#include "ui_ServerConfigDialog.h"
|
2024-08-01 00:13:01 +00:00
|
|
|
|
2025-03-19 22:14:27 +00:00
|
|
|
#include "common/Constants.h"
|
2026-03-02 04:06:06 +00:00
|
|
|
#include "common/NetworkProtocol.h"
|
2026-03-04 02:47:44 +00:00
|
|
|
#include "common/PlatformInfo.h"
|
|
|
|
|
#include "common/Settings.h"
|
2024-11-07 05:04:53 +00:00
|
|
|
#include "dialogs/ActionDialog.h"
|
|
|
|
|
#include "dialogs/HotkeyDialog.h"
|
2024-11-07 05:09:12 +00:00
|
|
|
#include "dialogs/ScreenSettingsDialog.h"
|
2024-11-07 05:04:53 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
#include <QFileDialog>
|
|
|
|
|
#include <QMessageBox>
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-08-08 17:41:59 +00:00
|
|
|
using enum ScreenConfig::SwitchCorner;
|
|
|
|
|
|
2025-03-10 03:15:32 +00:00
|
|
|
ServerConfigDialog::ServerConfigDialog(QWidget *parent, ServerConfig &config)
|
2024-07-02 19:07:06 +00:00
|
|
|
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
|
2024-10-18 23:52:32 +00:00
|
|
|
ui{std::make_unique<Ui::ServerConfigDialog>()},
|
2026-06-08 23:48:04 +00:00
|
|
|
m_columns{Settings::value(Settings::Server::GridWidth).toInt()},
|
|
|
|
|
m_rows{Settings::value(Settings::Server::GridHeight).toInt()},
|
2025-09-01 13:30:34 +00:00
|
|
|
m_originalServerConfig(config),
|
|
|
|
|
m_originalServerConfigIsExternal(config.useExternalConfig()),
|
|
|
|
|
m_originalServerConfigUsesExternalFile(config.configFile()),
|
2025-09-09 15:37:37 +00:00
|
|
|
m_serverConfig(config),
|
2026-06-08 23:48:04 +00:00
|
|
|
m_screenSetupModel(m_serverConfig.screens(), m_columns, m_rows)
|
2024-10-17 18:04:35 +00:00
|
|
|
{
|
2024-10-18 23:52:32 +00:00
|
|
|
ui->setupUi(this);
|
2025-02-01 14:13:39 +00:00
|
|
|
|
2026-06-09 02:14:54 +00:00
|
|
|
m_protocol = Settings::networkProtocol();
|
2025-02-01 13:54:42 +00:00
|
|
|
connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &ServerConfigDialog::accept);
|
|
|
|
|
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &ServerConfigDialog::reject);
|
2024-07-02 19:07:06 +00:00
|
|
|
|
2025-02-01 14:13:39 +00:00
|
|
|
ui->lblRemoveScreen->setPixmap(QIcon::fromTheme("user-trash").pixmap(QSize(64, 64)));
|
|
|
|
|
connect(ui->lblRemoveScreen, &TrashScreenWidget::screenRemoved, this, &ServerConfigDialog::onScreenRemoved);
|
|
|
|
|
|
|
|
|
|
ui->lblNewScreen->setEnabled(!model().isFull());
|
2025-01-30 04:45:28 +00:00
|
|
|
ui->lblNewScreen->setPixmap(QIcon::fromTheme("video-display").pixmap(QSize(64, 64)));
|
2024-11-09 17:07:38 +00:00
|
|
|
|
2025-02-01 14:54:01 +00:00
|
|
|
connect(ui->btnNewHotkey, &QPushButton::clicked, this, &ServerConfigDialog::addHotkey);
|
|
|
|
|
connect(ui->btnEditHotkey, &QPushButton::clicked, this, &ServerConfigDialog::editHotkey);
|
|
|
|
|
connect(ui->btnRemoveHotkey, &QPushButton::clicked, this, &ServerConfigDialog::removeHotkey);
|
|
|
|
|
connect(ui->listHotkeys, &QListView::doubleClicked, this, &ServerConfigDialog::editHotkey);
|
|
|
|
|
connect(
|
|
|
|
|
ui->listHotkeys->selectionModel(), &QItemSelectionModel::selectionChanged, this,
|
|
|
|
|
&ServerConfigDialog::listHotkeysSelectionChanged
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
connect(ui->btnNewAction, &QPushButton::clicked, this, &ServerConfigDialog::addAction);
|
|
|
|
|
connect(ui->btnEditAction, &QPushButton::clicked, this, &ServerConfigDialog::editAction);
|
|
|
|
|
connect(ui->btnRemoveAction, &QPushButton::clicked, this, &ServerConfigDialog::removeAction);
|
|
|
|
|
connect(ui->listActions, &QListView::doubleClicked, this, &ServerConfigDialog::editAction);
|
|
|
|
|
connect(
|
|
|
|
|
ui->listActions->selectionModel(), &QItemSelectionModel::selectionChanged, this,
|
|
|
|
|
&ServerConfigDialog::listActionsSelectionChanged
|
|
|
|
|
);
|
|
|
|
|
|
2024-08-01 00:13:01 +00:00
|
|
|
// force the first tab, since qt creator sets the active tab as the last one
|
|
|
|
|
// the developer was looking at, and it's easy to accidentally save that.
|
2025-02-01 14:13:39 +00:00
|
|
|
ui->tabWidget->setCurrentIndex(0);
|
2024-08-01 00:13:01 +00:00
|
|
|
|
2025-02-01 17:41:08 +00:00
|
|
|
ui->btnBrowseConfigFile->setIcon(QIcon::fromTheme(QIcon::ThemeIcon::DocumentOpen));
|
|
|
|
|
ui->lineConfigFile->setText(serverConfig().configFile());
|
|
|
|
|
|
2026-06-09 02:14:54 +00:00
|
|
|
const auto networkProtocol = Settings::networkProtocol();
|
2026-06-09 02:03:09 +00:00
|
|
|
ui->rbProtocolSynergy->setChecked(networkProtocol == NetworkProtocol::Synergy);
|
|
|
|
|
ui->rbProtocolBarrier->setChecked(networkProtocol == NetworkProtocol::Barrier);
|
2025-02-01 17:41:08 +00:00
|
|
|
connect(ui->rbProtocolBarrier, &QRadioButton::toggled, this, &ServerConfigDialog::toggleProtocol);
|
|
|
|
|
|
2025-02-01 15:56:07 +00:00
|
|
|
ui->cbHeartbeat->setChecked(serverConfig().hasHeartbeat());
|
2025-02-01 17:41:08 +00:00
|
|
|
connect(ui->cbHeartbeat, &QCheckBox::toggled, this, &ServerConfigDialog::toggleHeartbeat);
|
|
|
|
|
|
2025-06-01 16:43:23 +00:00
|
|
|
ui->sbHeartbeat->setEnabled(ui->cbHeartbeat->isChecked());
|
2025-02-01 15:56:07 +00:00
|
|
|
ui->sbHeartbeat->setValue(serverConfig().heartbeat());
|
2025-02-01 17:41:08 +00:00
|
|
|
connect(ui->sbHeartbeat, QOverload<int>::of(&QSpinBox::valueChanged), this, &ServerConfigDialog::setHeartbeat);
|
2024-07-02 19:07:06 +00:00
|
|
|
|
2025-02-01 15:56:07 +00:00
|
|
|
ui->cbRelativeMouseMoves->setChecked(serverConfig().relativeMouseMoves());
|
2025-02-01 17:41:08 +00:00
|
|
|
|
2025-11-05 20:55:51 +00:00
|
|
|
if (!deskflow::platform::isWindows())
|
|
|
|
|
ui->cbWin32KeepForeground->setVisible(false);
|
|
|
|
|
|
2025-02-01 15:56:07 +00:00
|
|
|
ui->cbWin32KeepForeground->setChecked(serverConfig().win32KeepForeground());
|
2025-02-01 17:41:08 +00:00
|
|
|
connect(ui->cbWin32KeepForeground, &QCheckBox::toggled, this, &ServerConfigDialog::toggleWin32Foreground);
|
|
|
|
|
|
|
|
|
|
ui->cbSwitchDelay->setChecked(serverConfig().hasSwitchDelay());
|
|
|
|
|
connect(ui->cbSwitchDelay, &QCheckBox::toggled, this, &ServerConfigDialog::toggleSwitchDelay);
|
|
|
|
|
|
2025-06-01 16:43:23 +00:00
|
|
|
ui->sbSwitchDelay->setEnabled(ui->cbSwitchDelay->isChecked());
|
2025-02-01 17:41:08 +00:00
|
|
|
ui->sbSwitchDelay->setValue(serverConfig().switchDelay());
|
|
|
|
|
connect(ui->sbSwitchDelay, QOverload<int>::of(&QSpinBox::valueChanged), this, &ServerConfigDialog::setSwitchDelay);
|
|
|
|
|
|
|
|
|
|
ui->cbSwitchDoubleTap->setChecked(serverConfig().hasSwitchDoubleTap());
|
|
|
|
|
connect(ui->cbSwitchDoubleTap, &QCheckBox::toggled, this, &ServerConfigDialog::toggleSwitchDoubleTap);
|
2024-07-02 19:07:06 +00:00
|
|
|
|
2025-06-01 16:43:23 +00:00
|
|
|
ui->sbSwitchDoubleTap->setEnabled(ui->cbSwitchDoubleTap->isChecked());
|
2025-02-01 17:41:08 +00:00
|
|
|
ui->sbSwitchDoubleTap->setValue(serverConfig().switchDoubleTap());
|
|
|
|
|
connect(
|
|
|
|
|
ui->sbSwitchDoubleTap, QOverload<int>::of(&QSpinBox::valueChanged), this, &ServerConfigDialog::setSwitchDoubleTap
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
connect(ui->cbRelativeMouseMoves, &QCheckBox::toggled, this, &ServerConfigDialog::toggleRelativeMouseMoves);
|
|
|
|
|
connect(ui->cbEnableClipboard, &QCheckBox::toggled, this, &ServerConfigDialog::toggleClipboard);
|
|
|
|
|
|
|
|
|
|
connect(ui->btnBrowseConfigFile, &QPushButton::clicked, this, &ServerConfigDialog::browseConfigFile);
|
|
|
|
|
|
2025-06-01 16:43:23 +00:00
|
|
|
ui->groupExternalConfig->setChecked(serverConfig().useExternalConfig());
|
|
|
|
|
ui->widgetExternalConfigControls->setEnabled(ui->groupExternalConfig->isChecked());
|
|
|
|
|
ui->tabWidget->setTabEnabled(0, !ui->groupExternalConfig->isChecked());
|
|
|
|
|
ui->tabWidget->setTabEnabled(1, !ui->groupExternalConfig->isChecked());
|
|
|
|
|
ui->tabWidget->setTabEnabled(2, !ui->groupExternalConfig->isChecked());
|
|
|
|
|
connect(ui->groupExternalConfig, &QGroupBox::toggled, this, &ServerConfigDialog::toggleExternalConfig);
|
|
|
|
|
|
2025-02-01 17:41:08 +00:00
|
|
|
connect(
|
|
|
|
|
ui->sbSwitchCornerSize, QOverload<int>::of(&QSpinBox::valueChanged), this,
|
|
|
|
|
&ServerConfigDialog::setSwitchCornerSize
|
|
|
|
|
);
|
|
|
|
|
connect(
|
|
|
|
|
ui->sbClipboardSizeLimit, QOverload<int>::of(&QSpinBox::valueChanged), this,
|
|
|
|
|
&ServerConfigDialog::setClipboardLimit
|
|
|
|
|
);
|
2024-07-02 19:07:06 +00:00
|
|
|
|
2025-02-01 17:41:08 +00:00
|
|
|
ui->cbCornerTopLeft->setChecked(serverConfig().switchCorner(static_cast<int>(TopLeft)));
|
|
|
|
|
connect(ui->cbCornerTopLeft, &QCheckBox::toggled, this, &ServerConfigDialog::toggleCornerTopLeft);
|
|
|
|
|
|
|
|
|
|
ui->cbCornerTopRight->setChecked(serverConfig().switchCorner(static_cast<int>(TopRight)));
|
|
|
|
|
connect(ui->cbCornerTopRight, &QCheckBox::toggled, this, &ServerConfigDialog::toggleCornerTopRight);
|
|
|
|
|
|
|
|
|
|
ui->cbCornerBottomLeft->setChecked(serverConfig().switchCorner(static_cast<int>(BottomLeft)));
|
|
|
|
|
connect(ui->cbCornerBottomLeft, &QCheckBox::toggled, this, &ServerConfigDialog::toggleCornerBottomLeft);
|
|
|
|
|
|
|
|
|
|
ui->cbCornerBottomRight->setChecked(serverConfig().switchCorner(static_cast<int>(BottomRight)));
|
|
|
|
|
connect(ui->cbCornerBottomRight, &QCheckBox::toggled, this, &ServerConfigDialog::toggleCornerBottomRight);
|
|
|
|
|
|
|
|
|
|
ui->sbSwitchCornerSize->setValue(serverConfig().switchCornerSize());
|
2024-07-02 19:07:06 +00:00
|
|
|
|
2025-11-24 23:35:32 +00:00
|
|
|
ui->cbDefaultLockToScreenState->setChecked(serverConfig().defaultLockToScreenState());
|
|
|
|
|
connect(
|
|
|
|
|
ui->cbDefaultLockToScreenState, &QCheckBox::toggled, this, &ServerConfigDialog::toggleDefaultLockToScreenState
|
|
|
|
|
);
|
|
|
|
|
|
2025-02-01 15:56:07 +00:00
|
|
|
ui->cbDisableLockToScreen->setChecked(serverConfig().disableLockToScreen());
|
2025-02-01 17:41:08 +00:00
|
|
|
connect(ui->cbDisableLockToScreen, &QCheckBox::toggled, this, &ServerConfigDialog::toggleLockToScreen);
|
2024-07-02 19:07:06 +00:00
|
|
|
|
2025-02-01 15:56:07 +00:00
|
|
|
ui->cbEnableClipboard->setChecked(serverConfig().clipboardSharing());
|
2025-04-27 16:51:37 +00:00
|
|
|
auto clipboardSharingSizeM = static_cast<int>(serverConfig().clipboardSharingSize() / 1024);
|
2025-02-01 15:56:07 +00:00
|
|
|
ui->sbClipboardSizeLimit->setValue(clipboardSharingSizeM);
|
|
|
|
|
ui->sbClipboardSizeLimit->setEnabled(serverConfig().clipboardSharing());
|
2024-07-02 19:07:06 +00:00
|
|
|
|
2024-10-21 03:07:31 +00:00
|
|
|
for (const Hotkey &hotkey : std::as_const(serverConfig().hotkeys()))
|
2025-02-01 14:54:01 +00:00
|
|
|
ui->listHotkeys->addItem(hotkey.text());
|
2024-07-02 19:07:06 +00:00
|
|
|
|
2025-09-01 13:30:34 +00:00
|
|
|
ui->screenSetupView->setModel(&m_screenSetupModel);
|
2024-07-02 19:07:06 +00:00
|
|
|
|
|
|
|
|
auto &screens = serverConfig().screens();
|
2025-08-01 00:46:08 +00:00
|
|
|
auto server = std::ranges::find_if(screens, [this](const Screen &screen) {
|
2024-10-17 18:04:35 +00:00
|
|
|
return (screen.name() == serverConfig().getServerName());
|
|
|
|
|
});
|
2024-07-02 19:07:06 +00:00
|
|
|
|
|
|
|
|
if (server == screens.end()) {
|
|
|
|
|
Screen serverScreen(serverConfig().getServerName());
|
|
|
|
|
serverScreen.markAsServer();
|
2026-06-08 23:48:04 +00:00
|
|
|
model().screen(m_columns / 2, m_rows / 2) = serverScreen;
|
2024-07-02 19:07:06 +00:00
|
|
|
} else {
|
|
|
|
|
server->markAsServer();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onChange();
|
|
|
|
|
|
|
|
|
|
// computers
|
2025-09-01 13:30:34 +00:00
|
|
|
connect(&m_screenSetupModel, &ScreenSetupModel::screensChanged, this, &ServerConfigDialog::onChange);
|
2012-06-10 16:50:54 +00:00
|
|
|
}
|
|
|
|
|
|
2024-10-18 23:52:32 +00:00
|
|
|
ServerConfigDialog::~ServerConfigDialog() = default;
|
|
|
|
|
|
2024-10-17 18:04:35 +00:00
|
|
|
bool ServerConfigDialog::addClient(const QString &clientName)
|
|
|
|
|
{
|
2024-07-02 19:07:06 +00:00
|
|
|
return addComputer(clientName, true);
|
Synergy 1161 when clicking on save preferences on configure server window, automatically apply all the new settings (#7081)
* 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
* SYNERGY-1161 When clicking on Save preferences on Configure server window, automatically apply all the new settings
*Fix server config OK button behaviour on autoconfig
* 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 sonar codesmell
* SYNERGY-1161 When clicking on Save preferences on Configure server window, automatically apply all the new settings
*Fix build
* SYNERGY-1161 When clicking on Save preferences on Configure server window, automatically apply all the new settings
*Adding client on autoconfig silently
Co-authored-by: Andrii Batyiev <andrii-external@symless.com>
2021-09-06 08:25:55 +00:00
|
|
|
}
|
|
|
|
|
|
2024-10-17 18:04:35 +00:00
|
|
|
void ServerConfigDialog::accept()
|
|
|
|
|
{
|
2025-02-01 17:41:08 +00:00
|
|
|
if (ui->groupExternalConfig->isChecked() && !QFile::exists(ui->lineConfigFile->text())) {
|
2024-07-02 19:07:06 +00:00
|
|
|
|
|
|
|
|
auto selectedButton = QMessageBox::warning(
|
2024-10-17 18:04:35 +00:00
|
|
|
this, "Filename invalid", "Please select a valid configuration file.", QMessageBox::Ok | QMessageBox::Ignore
|
|
|
|
|
);
|
2024-07-02 19:07:06 +00:00
|
|
|
|
2025-02-01 17:41:08 +00:00
|
|
|
if (selectedButton != QMessageBox::Ok || !browseConfigFile()) {
|
2024-07-02 19:07:06 +00:00
|
|
|
return;
|
2021-04-12 09:03:37 +00:00
|
|
|
}
|
2024-07-02 19:07:06 +00:00
|
|
|
}
|
2021-04-12 09:03:37 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
// 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.
|
2024-07-22 16:48:02 +00:00
|
|
|
setOriginalServerConfig(serverConfig());
|
2026-06-09 02:14:54 +00:00
|
|
|
Settings::setValue(Settings::Server::Protocol, networkProtocolToOption(m_protocol));
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
QDialog::accept();
|
2012-06-10 16:50:54 +00:00
|
|
|
}
|
|
|
|
|
|
2024-10-17 18:04:35 +00:00
|
|
|
void ServerConfigDialog::reject()
|
|
|
|
|
{
|
2025-09-01 13:30:34 +00:00
|
|
|
serverConfig().setUseExternalConfig(m_originalServerConfigIsExternal);
|
|
|
|
|
serverConfig().setConfigFile(m_originalServerConfigUsesExternalFile);
|
2021-08-20 12:22:07 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
QDialog::reject();
|
2021-08-20 12:22:07 +00:00
|
|
|
}
|
|
|
|
|
|
2025-02-01 14:54:01 +00:00
|
|
|
void ServerConfigDialog::addHotkey()
|
2024-10-17 18:04:35 +00:00
|
|
|
{
|
2024-07-26 22:53:52 +00:00
|
|
|
Hotkey hotkey;
|
|
|
|
|
HotkeyDialog dlg(this, hotkey);
|
|
|
|
|
if (dlg.exec() == QDialog::Accepted) {
|
|
|
|
|
serverConfig().hotkeys().append(hotkey);
|
2025-02-01 14:54:01 +00:00
|
|
|
ui->listHotkeys->addItem(hotkey.text());
|
2024-07-26 22:53:52 +00:00
|
|
|
onChange();
|
2024-07-02 19:07:06 +00:00
|
|
|
}
|
2012-06-10 16:50:54 +00:00
|
|
|
}
|
|
|
|
|
|
2025-02-01 14:54:01 +00:00
|
|
|
void ServerConfigDialog::editHotkey()
|
2024-10-17 18:04:35 +00:00
|
|
|
{
|
2025-02-01 14:54:01 +00:00
|
|
|
int row = ui->listHotkeys->currentRow();
|
|
|
|
|
if (row < 0 || row >= serverConfig().hotkeys().size()) {
|
2025-02-01 15:56:07 +00:00
|
|
|
qDebug() << "Attempt to editing out of bounds hotkey row: " << row;
|
2025-02-01 14:54:01 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Hotkey &hotkey = serverConfig().hotkeys()[row];
|
2024-07-02 19:07:06 +00:00
|
|
|
HotkeyDialog dlg(this, hotkey);
|
|
|
|
|
if (dlg.exec() == QDialog::Accepted) {
|
2025-02-01 14:54:01 +00:00
|
|
|
ui->listHotkeys->currentItem()->setText(hotkey.text());
|
2021-08-20 12:22:07 +00:00
|
|
|
onChange();
|
2024-07-02 19:07:06 +00:00
|
|
|
}
|
2012-06-10 16:50:54 +00:00
|
|
|
}
|
|
|
|
|
|
2025-02-01 14:54:01 +00:00
|
|
|
void ServerConfigDialog::removeHotkey()
|
2024-10-17 18:04:35 +00:00
|
|
|
{
|
2025-02-01 14:54:01 +00:00
|
|
|
int row = ui->listHotkeys->currentRow();
|
|
|
|
|
if (row < 0 || row >= serverConfig().hotkeys().size()) {
|
2025-02-01 15:56:07 +00:00
|
|
|
qDebug() << "Attempt to remove out of bounds hotkey row: " << row;
|
2025-02-01 14:54:01 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
serverConfig().hotkeys().removeAt(row);
|
|
|
|
|
ui->listActions->clear();
|
|
|
|
|
delete ui->listHotkeys->item(row);
|
2024-07-02 19:07:06 +00:00
|
|
|
onChange();
|
|
|
|
|
}
|
2016-12-28 11:50:32 +00:00
|
|
|
|
2025-10-15 16:11:39 +00:00
|
|
|
void ServerConfigDialog::listHotkeysSelectionChanged(const QItemSelection &selected, const QItemSelection &)
|
2024-10-17 18:04:35 +00:00
|
|
|
{
|
2025-02-01 14:54:01 +00:00
|
|
|
bool itemsSelected = !selected.isEmpty();
|
|
|
|
|
ui->btnEditHotkey->setEnabled(itemsSelected);
|
|
|
|
|
ui->btnRemoveHotkey->setEnabled(itemsSelected);
|
|
|
|
|
ui->btnNewAction->setEnabled(itemsSelected);
|
|
|
|
|
|
|
|
|
|
if (itemsSelected && !serverConfig().hotkeys().isEmpty()) {
|
|
|
|
|
ui->listActions->clear();
|
|
|
|
|
const Hotkey &hotkey = serverConfig().hotkeys().at(selected.indexes().first().row());
|
2024-10-21 02:58:12 +00:00
|
|
|
for (const Action &action : hotkey.actions())
|
2025-02-01 14:54:01 +00:00
|
|
|
ui->listActions->addItem(action.text());
|
2024-07-02 19:07:06 +00:00
|
|
|
}
|
2012-06-10 16:50:54 +00:00
|
|
|
}
|
|
|
|
|
|
2025-02-01 14:54:01 +00:00
|
|
|
void ServerConfigDialog::addAction()
|
2024-10-17 18:04:35 +00:00
|
|
|
{
|
2025-02-01 14:54:01 +00:00
|
|
|
int row = ui->listHotkeys->currentRow();
|
|
|
|
|
if (row < 0 || row >= serverConfig().hotkeys().size()) {
|
2025-02-01 15:56:07 +00:00
|
|
|
qDebug() << "Attempt to add action to out of bounds hotkey row: " << row;
|
2025-02-01 14:54:01 +00:00
|
|
|
return;
|
|
|
|
|
}
|
2024-07-02 19:07:06 +00:00
|
|
|
|
2025-02-01 14:54:01 +00:00
|
|
|
Hotkey &hotkey = serverConfig().hotkeys()[row];
|
2024-07-02 19:07:06 +00:00
|
|
|
Action action;
|
|
|
|
|
ActionDialog dlg(this, serverConfig(), hotkey, action);
|
|
|
|
|
if (dlg.exec() == QDialog::Accepted) {
|
|
|
|
|
hotkey.actions().append(action);
|
2025-02-01 14:54:01 +00:00
|
|
|
ui->listActions->addItem(action.text());
|
2024-07-02 19:07:06 +00:00
|
|
|
onChange();
|
|
|
|
|
}
|
2012-06-10 16:50:54 +00:00
|
|
|
}
|
|
|
|
|
|
2025-02-01 14:54:01 +00:00
|
|
|
void ServerConfigDialog::editAction()
|
2024-10-17 18:04:35 +00:00
|
|
|
{
|
2025-02-01 14:54:01 +00:00
|
|
|
int hotkeyRow = ui->listHotkeys->currentRow();
|
|
|
|
|
if (hotkeyRow < 0 || hotkeyRow >= serverConfig().hotkeys().size()) {
|
2025-02-01 15:56:07 +00:00
|
|
|
qDebug() << "Attempt to edit action from out of bounds hotkey row: " << hotkeyRow;
|
2025-02-01 14:54:01 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
Hotkey &hotkey = serverConfig().hotkeys()[hotkeyRow];
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2025-02-01 14:54:01 +00:00
|
|
|
int actionRow = ui->listActions->currentRow();
|
|
|
|
|
if (actionRow < 0 || actionRow >= hotkey.actions().size()) {
|
2025-02-01 15:56:07 +00:00
|
|
|
qDebug() << "Attempt to remove out of bounds action row: " << actionRow;
|
2025-02-01 14:54:01 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
Action &action = hotkey.actions()[actionRow];
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
ActionDialog dlg(this, serverConfig(), hotkey, action);
|
|
|
|
|
if (dlg.exec() == QDialog::Accepted) {
|
2025-02-01 14:54:01 +00:00
|
|
|
ui->listActions->currentItem()->setText(action.text());
|
2024-07-02 19:07:06 +00:00
|
|
|
onChange();
|
|
|
|
|
}
|
2012-06-10 16:50:54 +00:00
|
|
|
}
|
|
|
|
|
|
2025-02-01 14:54:01 +00:00
|
|
|
void ServerConfigDialog::removeAction()
|
2024-10-17 18:04:35 +00:00
|
|
|
{
|
2025-02-01 14:54:01 +00:00
|
|
|
int hotkeyRow = ui->listHotkeys->currentRow();
|
|
|
|
|
if (hotkeyRow < 0 || hotkeyRow >= serverConfig().hotkeys().size()) {
|
2025-02-01 15:56:07 +00:00
|
|
|
qDebug() << "Attempt to remove action from out of bounds hotkey row: " << hotkeyRow;
|
2025-02-01 14:54:01 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
Hotkey &hotkey = serverConfig().hotkeys()[hotkeyRow];
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2025-02-01 14:54:01 +00:00
|
|
|
int actionRow = ui->listActions->currentRow();
|
|
|
|
|
if (actionRow < 0 || actionRow >= hotkey.actions().size()) {
|
2025-02-01 15:56:07 +00:00
|
|
|
qDebug() << "Attempt to remove out of bounds action row: " << actionRow;
|
2025-02-01 14:54:01 +00:00
|
|
|
return;
|
|
|
|
|
}
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2025-02-01 14:54:01 +00:00
|
|
|
hotkey.actions().removeAt(actionRow);
|
|
|
|
|
delete ui->listActions->currentItem();
|
2024-07-02 19:07:06 +00:00
|
|
|
onChange();
|
2012-06-10 16:50:54 +00:00
|
|
|
}
|
|
|
|
|
|
2025-02-01 15:56:07 +00:00
|
|
|
void ServerConfigDialog::toggleClipboard(bool enabled)
|
2024-10-17 18:04:35 +00:00
|
|
|
{
|
2025-02-01 15:56:07 +00:00
|
|
|
ui->sbClipboardSizeLimit->setEnabled(enabled);
|
|
|
|
|
if (enabled && !ui->sbClipboardSizeLimit->value()) {
|
2025-09-05 02:14:25 +00:00
|
|
|
auto size = static_cast<int>((ServerConfig::defaultClipboardSharingSize() + 512) / 1024);
|
2025-02-01 15:56:07 +00:00
|
|
|
ui->sbClipboardSizeLimit->setValue(size ? size : 1);
|
2024-07-02 19:07:06 +00:00
|
|
|
}
|
2025-02-01 15:56:07 +00:00
|
|
|
serverConfig().setClipboardSharing(enabled);
|
|
|
|
|
onChange();
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-01 17:41:08 +00:00
|
|
|
void ServerConfigDialog::setClipboardLimit(int limit)
|
|
|
|
|
{
|
|
|
|
|
serverConfig().setClipboardSharingSize(limit * 1024);
|
|
|
|
|
onChange();
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-01 15:56:07 +00:00
|
|
|
void ServerConfigDialog::toggleHeartbeat(bool enabled)
|
|
|
|
|
{
|
|
|
|
|
ui->sbHeartbeat->setEnabled(enabled);
|
|
|
|
|
serverConfig().haveHeartbeat(enabled);
|
|
|
|
|
onChange();
|
2017-01-30 14:45:30 +00:00
|
|
|
}
|
|
|
|
|
|
2025-02-01 17:41:08 +00:00
|
|
|
void ServerConfigDialog::setHeartbeat(int rate)
|
|
|
|
|
{
|
|
|
|
|
serverConfig().setHeartbeat(rate);
|
|
|
|
|
onChange();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerConfigDialog::toggleRelativeMouseMoves(bool enabled)
|
|
|
|
|
{
|
|
|
|
|
serverConfig().setRelativeMouseMoves(enabled);
|
|
|
|
|
onChange();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerConfigDialog::toggleProtocol()
|
|
|
|
|
{
|
2026-06-09 02:14:54 +00:00
|
|
|
m_protocol = ui->rbProtocolBarrier->isChecked() ? NetworkProtocol::Barrier : NetworkProtocol::Synergy;
|
2025-02-01 17:41:08 +00:00
|
|
|
onChange();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerConfigDialog::setSwitchCornerSize(int size)
|
|
|
|
|
{
|
|
|
|
|
serverConfig().setSwitchCornerSize(size);
|
|
|
|
|
onChange();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerConfigDialog::toggleCornerBottomLeft(bool enable)
|
|
|
|
|
{
|
|
|
|
|
serverConfig().setSwitchCorner(static_cast<int>(BottomLeft), enable);
|
|
|
|
|
onChange();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerConfigDialog::toggleCornerTopLeft(bool enable)
|
|
|
|
|
{
|
|
|
|
|
serverConfig().setSwitchCorner(static_cast<int>(TopLeft), enable);
|
|
|
|
|
onChange();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerConfigDialog::toggleCornerBottomRight(bool enable)
|
|
|
|
|
{
|
|
|
|
|
serverConfig().setSwitchCorner(static_cast<int>(BottomRight), enable);
|
|
|
|
|
onChange();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerConfigDialog::toggleCornerTopRight(bool enable)
|
|
|
|
|
{
|
|
|
|
|
serverConfig().setSwitchCorner(static_cast<int>(TopRight), enable);
|
|
|
|
|
onChange();
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-15 16:11:39 +00:00
|
|
|
void ServerConfigDialog::listActionsSelectionChanged(const QItemSelection &selected, const QItemSelection &)
|
2024-10-17 18:04:35 +00:00
|
|
|
{
|
2025-02-01 14:54:01 +00:00
|
|
|
bool enabled = !selected.isEmpty();
|
|
|
|
|
ui->btnEditAction->setEnabled(enabled);
|
|
|
|
|
ui->btnRemoveAction->setEnabled(enabled);
|
2012-06-10 16:50:54 +00:00
|
|
|
}
|
2021-04-09 14:53:27 +00:00
|
|
|
|
2025-02-01 17:41:08 +00:00
|
|
|
void ServerConfigDialog::toggleSwitchDoubleTap(bool enable)
|
|
|
|
|
{
|
|
|
|
|
ui->sbSwitchDoubleTap->setEnabled(enable);
|
|
|
|
|
serverConfig().haveSwitchDoubleTap(enable);
|
|
|
|
|
onChange();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerConfigDialog::setSwitchDoubleTap(int within)
|
|
|
|
|
{
|
|
|
|
|
serverConfig().setSwitchDoubleTap(within);
|
|
|
|
|
onChange();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerConfigDialog::toggleSwitchDelay(bool enable)
|
|
|
|
|
{
|
|
|
|
|
ui->sbSwitchDelay->setEnabled(enable);
|
|
|
|
|
serverConfig().haveSwitchDelay(enable);
|
|
|
|
|
onChange();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerConfigDialog::setSwitchDelay(int delay)
|
|
|
|
|
{
|
|
|
|
|
serverConfig().setSwitchDelay(delay);
|
|
|
|
|
onChange();
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-24 23:35:32 +00:00
|
|
|
void ServerConfigDialog::toggleDefaultLockToScreenState(bool state)
|
|
|
|
|
{
|
|
|
|
|
serverConfig().setDefaultLockToScreenState(state);
|
|
|
|
|
onChange();
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-01 17:41:08 +00:00
|
|
|
void ServerConfigDialog::toggleLockToScreen(bool disabled)
|
|
|
|
|
{
|
|
|
|
|
serverConfig().setDisableLockToScreen(disabled);
|
|
|
|
|
onChange();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ServerConfigDialog::toggleWin32Foreground(bool enabled)
|
|
|
|
|
{
|
|
|
|
|
serverConfig().setWin32KeepForeground(enabled);
|
|
|
|
|
onChange();
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-01 13:49:38 +00:00
|
|
|
void ServerConfigDialog::addClient()
|
2024-10-17 18:04:35 +00:00
|
|
|
{
|
2024-07-02 19:07:06 +00:00
|
|
|
addComputer("", false);
|
2021-04-09 14:53:27 +00:00
|
|
|
}
|
|
|
|
|
|
2024-10-17 18:04:35 +00:00
|
|
|
void ServerConfigDialog::onScreenRemoved()
|
|
|
|
|
{
|
2025-01-30 04:45:28 +00:00
|
|
|
ui->lblNewScreen->setEnabled(true);
|
2024-07-02 19:07:06 +00:00
|
|
|
onChange();
|
2021-04-09 14:53:27 +00:00
|
|
|
}
|
2021-04-13 16:04:58 +00:00
|
|
|
|
2025-02-01 17:41:08 +00:00
|
|
|
void ServerConfigDialog::toggleExternalConfig(bool checked)
|
2024-10-17 18:04:35 +00:00
|
|
|
{
|
2025-06-01 16:43:23 +00:00
|
|
|
ui->widgetExternalConfigControls->setEnabled(checked);
|
2025-02-01 14:13:39 +00:00
|
|
|
ui->tabWidget->setTabEnabled(0, !checked);
|
|
|
|
|
ui->tabWidget->setTabEnabled(1, !checked);
|
2026-06-09 02:57:53 +00:00
|
|
|
ui->groupMisc->setEnabled(!checked);
|
|
|
|
|
ui->groupCorners->setEnabled(!checked);
|
|
|
|
|
ui->groupSwitch->setEnabled(!checked);
|
|
|
|
|
ui->widgetHeartbeat->setEnabled(!checked);
|
2025-02-01 17:41:08 +00:00
|
|
|
serverConfig().setUseExternalConfig(checked);
|
|
|
|
|
onChange();
|
2021-04-12 09:03:37 +00:00
|
|
|
}
|
|
|
|
|
|
2025-02-01 17:41:08 +00:00
|
|
|
bool ServerConfigDialog::browseConfigFile()
|
2024-10-17 18:04:35 +00:00
|
|
|
{
|
2025-11-10 20:30:32 +00:00
|
|
|
//: %1 is replaced with the application names
|
|
|
|
|
//: (*.conf) and (*.*) should not be translated
|
|
|
|
|
const auto deskflowConfigFilter = tr("%1 Configurations (*.conf);;All files (*.*)");
|
2021-04-12 09:03:37 +00:00
|
|
|
|
2024-11-01 12:59:17 +00:00
|
|
|
QString fileName =
|
2025-11-10 20:30:32 +00:00
|
|
|
QFileDialog::getOpenFileName(this, tr("Browse for a config file"), "", deskflowConfigFilter.arg(kAppName));
|
2021-04-12 09:03:37 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
if (!fileName.isEmpty()) {
|
2025-02-01 17:41:08 +00:00
|
|
|
ui->lineConfigFile->setText(fileName);
|
|
|
|
|
serverConfig().setConfigFile(ui->lineConfigFile->text());
|
|
|
|
|
onChange();
|
2024-07-02 19:07:06 +00:00
|
|
|
return true;
|
|
|
|
|
}
|
2021-04-12 09:03:37 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
return false;
|
2021-04-12 09:03:37 +00:00
|
|
|
}
|
2021-08-20 12:22:07 +00:00
|
|
|
|
2024-10-17 18:04:35 +00:00
|
|
|
bool ServerConfigDialog::addComputer(const QString &clientName, bool doSilent)
|
|
|
|
|
{
|
2024-07-02 19:07:06 +00:00
|
|
|
bool isAccepted = false;
|
|
|
|
|
Screen newScreen(clientName);
|
Synergy 1161 when clicking on save preferences on configure server window, automatically apply all the new settings (#7081)
* 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
* SYNERGY-1161 When clicking on Save preferences on Configure server window, automatically apply all the new settings
*Fix server config OK button behaviour on autoconfig
* 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 sonar codesmell
* SYNERGY-1161 When clicking on Save preferences on Configure server window, automatically apply all the new settings
*Fix build
* SYNERGY-1161 When clicking on Save preferences on Configure server window, automatically apply all the new settings
*Adding client on autoconfig silently
Co-authored-by: Andrii Batyiev <andrii-external@symless.com>
2021-09-06 08:25:55 +00:00
|
|
|
|
2025-05-02 12:03:44 +00:00
|
|
|
if (ScreenSettingsDialog dlg(this, &newScreen, &model().m_Screens); doSilent || dlg.exec() == QDialog::Accepted) {
|
2024-07-02 19:07:06 +00:00
|
|
|
model().addScreen(newScreen);
|
|
|
|
|
isAccepted = true;
|
|
|
|
|
}
|
Synergy 1161 when clicking on save preferences on configure server window, automatically apply all the new settings (#7081)
* 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
* SYNERGY-1161 When clicking on Save preferences on Configure server window, automatically apply all the new settings
*Fix server config OK button behaviour on autoconfig
* 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 sonar codesmell
* SYNERGY-1161 When clicking on Save preferences on Configure server window, automatically apply all the new settings
*Fix build
* SYNERGY-1161 When clicking on Save preferences on Configure server window, automatically apply all the new settings
*Adding client on autoconfig silently
Co-authored-by: Andrii Batyiev <andrii-external@symless.com>
2021-09-06 08:25:55 +00:00
|
|
|
|
2025-01-30 04:45:28 +00:00
|
|
|
ui->lblNewScreen->setEnabled(!model().isFull());
|
2024-07-02 19:07:06 +00:00
|
|
|
return isAccepted;
|
Synergy 1161 when clicking on save preferences on configure server window, automatically apply all the new settings (#7081)
* 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
* SYNERGY-1161 When clicking on Save preferences on Configure server window, automatically apply all the new settings
*Fix server config OK button behaviour on autoconfig
* 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 sonar codesmell
* SYNERGY-1161 When clicking on Save preferences on Configure server window, automatically apply all the new settings
*Fix build
* SYNERGY-1161 When clicking on Save preferences on Configure server window, automatically apply all the new settings
*Adding client on autoconfig silently
Co-authored-by: Andrii Batyiev <andrii-external@symless.com>
2021-09-06 08:25:55 +00:00
|
|
|
}
|
|
|
|
|
|
2024-10-17 18:04:35 +00:00
|
|
|
void ServerConfigDialog::onChange()
|
|
|
|
|
{
|
2026-06-09 02:14:54 +00:00
|
|
|
bool isAppConfigDataEqual = m_originalServerConfigIsExternal == serverConfig().useExternalConfig() &&
|
|
|
|
|
m_originalServerConfigUsesExternalFile == serverConfig().configFile() &&
|
|
|
|
|
m_protocol == Settings::networkProtocol();
|
2025-02-01 13:54:42 +00:00
|
|
|
ui->buttonBox->button(QDialogButtonBox::Ok)
|
2025-09-01 13:30:34 +00:00
|
|
|
->setEnabled(!isAppConfigDataEqual || !(m_originalServerConfig == m_serverConfig));
|
2021-08-20 12:22:07 +00:00
|
|
|
}
|