From 3c133380f8cf51a9377d5f7ef40b35aa2646976c Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Mon, 30 Jan 2017 14:45:30 +0000 Subject: [PATCH] #6344 Auto Enable/disable clipboard size spinner --- src/gui/src/ServerConfigDialog.cpp | 6 ++++++ src/gui/src/ServerConfigDialog.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/gui/src/ServerConfigDialog.cpp b/src/gui/src/ServerConfigDialog.cpp index 6532af96..342ac5dc 100644 --- a/src/gui/src/ServerConfigDialog.cpp +++ b/src/gui/src/ServerConfigDialog.cpp @@ -61,6 +61,7 @@ ServerConfigDialog::ServerConfigDialog(QWidget* parent, ServerConfig& config, co m_pCheckBoxEnableClipboard->setChecked(serverConfig().clipboardSharing()); m_pSpinBoxClipboardSizeLimit->setValue(serverConfig().clipboardSharingSize() / 1024); + m_pSpinBoxClipboardSizeLimit->setEnabled(serverConfig().clipboardSharing()); foreach(const Hotkey& hotkey, serverConfig().hotkeys()) m_pListHotkeys->addItem(hotkey.text()); @@ -216,6 +217,11 @@ void ServerConfigDialog::on_m_pButtonRemoveAction_clicked() delete m_pListActions->currentItem(); } +void ServerConfigDialog::on_m_pCheckBoxEnableClipboard_stateChanged(int const state) +{ + m_pSpinBoxClipboardSizeLimit->setEnabled (state == Qt::Checked); +} + void ServerConfigDialog::on_m_pListActions_itemSelectionChanged() { m_pButtonEditAction->setEnabled(!m_pListActions->selectedItems().isEmpty()); diff --git a/src/gui/src/ServerConfigDialog.h b/src/gui/src/ServerConfigDialog.h index 37543bda..65513a06 100644 --- a/src/gui/src/ServerConfigDialog.h +++ b/src/gui/src/ServerConfigDialog.h @@ -50,6 +50,8 @@ class ServerConfigDialog : public QDialog, public Ui::ServerConfigDialogBase void on_m_pButtonEditAction_clicked(); void on_m_pButtonRemoveAction_clicked(); + void on_m_pCheckBoxEnableClipboard_stateChanged(int state); + protected: ServerConfig& serverConfig() { return m_ServerConfig; } void setOrigServerConfig(const ServerConfig& s) { m_OrigServerConfig = s; }