#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> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>740</width> <width>795</width>
<height>514</height> <height>534</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -17,7 +17,7 @@
<item> <item>
<widget class="QTabWidget" name="m_pTabWidget"> <widget class="QTabWidget" name="m_pTabWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>2</number>
</property> </property>
<widget class="QWidget" name="m_pTabScreens"> <widget class="QWidget" name="m_pTabScreens">
<attribute name="title"> <attribute name="title">
@ -44,7 +44,7 @@
<string/> <string/>
</property> </property>
<property name="pixmap"> <property name="pixmap">
<pixmap>:/res/icons/64x64/user-trash.png</pixmap> <pixmap resource="Synergy.qrc">:/res/icons/64x64/user-trash.png</pixmap>
</property> </property>
</widget> </widget>
</item> </item>
@ -82,7 +82,7 @@
<string/> <string/>
</property> </property>
<property name="pixmap"> <property name="pixmap">
<pixmap>:/res/icons/64x64/video-display.png</pixmap> <pixmap resource="Synergy.qrc">:/res/icons/64x64/video-display.png</pixmap>
</property> </property>
</widget> </widget>
</item> </item>
@ -408,6 +408,36 @@ Double click on a screen to edit its settings.</string>
<string>&amp;Options</string> <string>&amp;Options</string>
</property> </property>
<layout class="QGridLayout"> <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"> <item row="0" column="0">
<layout class="QHBoxLayout"> <layout class="QHBoxLayout">
<item> <item>
@ -461,51 +491,7 @@ Double click on a screen to edit its settings.</string>
</item> </item>
</layout> </layout>
</item> </item>
<item row="1" column="0"> <item row="7" 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">
<spacer> <spacer>
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
@ -518,6 +504,30 @@ Double click on a screen to edit its settings.</string>
</property> </property>
</spacer> </spacer>
</item> </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> </layout>
</widget> </widget>
</item> </item>
@ -651,7 +661,9 @@ Double click on a screen to edit its settings.</string>
<header>TrashScreenWidget.h</header> <header>TrashScreenWidget.h</header>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources/> <resources>
<include location="Synergy.qrc"/>
</resources>
<connections> <connections>
<connection> <connection>
<sender>m_pButtonBox</sender> <sender>m_pButtonBox</sender>

View File

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

View File

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

View File

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