#123 Added enable clipboard option in GUI

This commit is contained in:
Xinyu Hou 2016-09-15 12:42:58 -04:00 committed by Andrew Nelless
parent d78758ab7d
commit 130458f77a
4 changed files with 71 additions and 51 deletions

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>740</width>
<height>514</height>
<width>795</width>
<height>534</height>
</rect>
</property>
<property name="windowTitle">
@ -17,7 +17,7 @@
<item>
<widget class="QTabWidget" name="m_pTabWidget">
<property name="currentIndex">
<number>0</number>
<number>2</number>
</property>
<widget class="QWidget" name="m_pTabScreens">
<attribute name="title">
@ -44,7 +44,7 @@
<string/>
</property>
<property name="pixmap">
<pixmap>:/res/icons/64x64/user-trash.png</pixmap>
<pixmap resource="Synergy.qrc">:/res/icons/64x64/user-trash.png</pixmap>
</property>
</widget>
</item>
@ -82,7 +82,7 @@
<string/>
</property>
<property name="pixmap">
<pixmap>:/res/icons/64x64/video-display.png</pixmap>
<pixmap resource="Synergy.qrc">:/res/icons/64x64/video-display.png</pixmap>
</property>
</widget>
</item>
@ -408,6 +408,36 @@ Double click on a screen to edit its settings.</string>
<string>&amp;Options</string>
</property>
<layout class="QGridLayout">
<item row="3" column="0">
<widget class="QCheckBox" name="m_pCheckBoxWin32KeepForeground">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Don't take &amp;foreground window on Windows servers</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="m_pCheckBoxRelativeMouseMoves">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Use &amp;relative mouse moves</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="m_pCheckBoxScreenSaverSync">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>S&amp;ynchronize screen savers</string>
</property>
</widget>
</item>
<item row="0" column="0">
<layout class="QHBoxLayout">
<item>
@ -461,51 +491,7 @@ Double click on a screen to edit its settings.</string>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="m_pCheckBoxRelativeMouseMoves">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Use &amp;relative mouse moves</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="m_pCheckBoxScreenSaverSync">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>S&amp;ynchronize screen savers</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="m_pCheckBoxWin32KeepForeground">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Don't take &amp;foreground window on Windows servers</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="m_pCheckBoxIgnoreAutoConfigClient">
<property name="text">
<string>Ignore auto config clients</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="m_pCheckBoxEnableDragAndDrop">
<property name="text">
<string>Enable drag and drop file transfers</string>
</property>
</widget>
</item>
<item row="6" column="0">
<item row="7" column="0">
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -518,6 +504,30 @@ Double click on a screen to edit its settings.</string>
</property>
</spacer>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="m_pCheckBoxEnableDragAndDrop">
<property name="text">
<string>Enable drag and drop file transfers</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="m_pCheckBoxIgnoreAutoConfigClient">
<property name="text">
<string>Ignore auto config clients</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QCheckBox" name="m_pCheckBoxEnableClipboard">
<property name="text">
<string>Enable clipboard sharing</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@ -651,7 +661,9 @@ Double click on a screen to edit its settings.</string>
<header>TrashScreenWidget.h</header>
</customwidget>
</customwidgets>
<resources/>
<resources>
<include location="Synergy.qrc"/>
</resources>
<connections>
<connection>
<sender>m_pButtonBox</sender>

View File

@ -51,6 +51,7 @@ ServerConfig::ServerConfig(QSettings* settings, int numColumns, int numRows ,
m_ServerName(serverName),
m_IgnoreAutoConfigClient(false),
m_EnableDragAndDrop(false),
m_EnableClipboard(true),
m_pMainWindow(mainWindow)
{
Q_ASSERT(m_pSettings);
@ -246,6 +247,7 @@ QTextStream& operator<<(QTextStream& outStream, const ServerConfig& config)
outStream << "\t" << "relativeMouseMoves = " << (config.relativeMouseMoves() ? "true" : "false") << endl;
outStream << "\t" << "screenSaverSync = " << (config.screenSaverSync() ? "true" : "false") << endl;
outStream << "\t" << "win32KeepForeground = " << (config.win32KeepForeground() ? "true" : "false") << endl;
outStream << "\t" << "enableClipboard = " << (config.enableClipboard() ? "true" : "false") << endl;
if (config.hasSwitchDelay())
outStream << "\t" << "switchDelay = " << config.switchDelay() << endl;

View File

@ -62,6 +62,7 @@ class ServerConfig : public BaseConfig
const HotkeyList& hotkeys() const { return m_Hotkeys; }
bool ignoreAutoConfigClient() const { return m_IgnoreAutoConfigClient; }
bool enableDragAndDrop() const { return m_EnableDragAndDrop; }
bool enableClipboard() const { return m_EnableClipboard; }
void saveSettings();
void loadSettings();
@ -90,6 +91,7 @@ class ServerConfig : public BaseConfig
void setSwitchCornerSize(int val) { m_SwitchCornerSize = val; }
void setIgnoreAutoConfigClient(bool on) { m_IgnoreAutoConfigClient = on; }
void setEnableDragAndDrop(bool on) { m_EnableDragAndDrop = on; }
void setEnableClipboard(bool on) { m_EnableClipboard = on; }
QList<bool>& switchCorners() { return m_SwitchCorners; }
HotkeyList& hotkeys() { return m_Hotkeys; }
@ -122,6 +124,7 @@ class ServerConfig : public BaseConfig
QString m_ServerName;
bool m_IgnoreAutoConfigClient;
bool m_EnableDragAndDrop;
bool m_EnableClipboard;
MainWindow* m_pMainWindow;
};

View File

@ -58,6 +58,8 @@ ServerConfigDialog::ServerConfigDialog(QWidget* parent, ServerConfig& config, co
m_pCheckBoxEnableDragAndDrop->setChecked(serverConfig().enableDragAndDrop());
m_pCheckBoxEnableClipboard->setChecked(serverConfig().enableClipboard());
foreach(const Hotkey& hotkey, serverConfig().hotkeys())
m_pListHotkeys->addItem(hotkey.text());
@ -100,6 +102,7 @@ void ServerConfigDialog::accept()
serverConfig().setSwitchCornerSize(m_pSpinBoxSwitchCornerSize->value());
serverConfig().setIgnoreAutoConfigClient(m_pCheckBoxIgnoreAutoConfigClient->isChecked());
serverConfig().setEnableDragAndDrop(m_pCheckBoxEnableDragAndDrop->isChecked());
serverConfig().setEnableClipboard(m_pCheckBoxEnableClipboard->isChecked());
// 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.