#6346 Add disable lock to screen in server config and output it to config file

This commit is contained in:
XinyuHou 2016-11-24 12:15:22 +00:00 committed by Nick Bolton
parent 46a5b7f9ae
commit 535627c871
4 changed files with 50 additions and 34 deletions

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_DisableLockToScreen(false),
m_ClipboardSharing(true), m_ClipboardSharing(true),
m_pMainWindow(mainWindow) m_pMainWindow(mainWindow)
{ {
@ -116,6 +117,7 @@ void ServerConfig::saveSettings()
settings().setValue("switchDoubleTap", switchDoubleTap()); settings().setValue("switchDoubleTap", switchDoubleTap());
settings().setValue("switchCornerSize", switchCornerSize()); settings().setValue("switchCornerSize", switchCornerSize());
settings().setValue("ignoreAutoConfigClient", ignoreAutoConfigClient()); settings().setValue("ignoreAutoConfigClient", ignoreAutoConfigClient());
settings().setValue("disableLockToScreen", disableLockToScreen());
settings().setValue("enableDragAndDrop", enableDragAndDrop()); settings().setValue("enableDragAndDrop", enableDragAndDrop());
writeSettings(settings(), switchCorners(), "switchCorner"); writeSettings(settings(), switchCorners(), "switchCorner");
@ -160,6 +162,7 @@ void ServerConfig::loadSettings()
setSwitchDoubleTap(settings().value("switchDoubleTap", 250).toInt()); setSwitchDoubleTap(settings().value("switchDoubleTap", 250).toInt());
setSwitchCornerSize(settings().value("switchCornerSize").toInt()); setSwitchCornerSize(settings().value("switchCornerSize").toInt());
setIgnoreAutoConfigClient(settings().value("ignoreAutoConfigClient").toBool()); setIgnoreAutoConfigClient(settings().value("ignoreAutoConfigClient").toBool());
setDisableLockToScreen(settings().value("disableLockToScreen", false).toBool());
setEnableDragAndDrop(settings().value("enableDragAndDrop", true).toBool()); setEnableDragAndDrop(settings().value("enableDragAndDrop", true).toBool());
readSettings(settings(), switchCorners(), "switchCorner", false, NumSwitchCorners); readSettings(settings(), switchCorners(), "switchCorner", false, NumSwitchCorners);
@ -247,6 +250,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" << "disableLockToScreen = " << (config.disableLockToScreen() ? "true" : "false") << endl;
outStream << "\t" << "clipboardSharing = " << (config.clipboardSharing() ? "true" : "false") << endl; outStream << "\t" << "clipboardSharing = " << (config.clipboardSharing() ? "true" : "false") << endl;
if (config.hasSwitchDelay()) if (config.hasSwitchDelay())

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 disableLockToScreen() const { return m_DisableLockToScreen; }
bool clipboardSharing() const { return m_ClipboardSharing; } bool clipboardSharing() const { return m_ClipboardSharing; }
void saveSettings(); void saveSettings();
@ -91,6 +92,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 setDisableLockToScreen(bool on) { m_DisableLockToScreen = on; }
void setClipboardSharing(bool on) { m_ClipboardSharing = on; } void setClipboardSharing(bool on) { m_ClipboardSharing = on; }
QList<bool>& switchCorners() { return m_SwitchCorners; } QList<bool>& switchCorners() { return m_SwitchCorners; }
HotkeyList& hotkeys() { return m_Hotkeys; } HotkeyList& hotkeys() { return m_Hotkeys; }
@ -124,6 +126,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_DisableLockToScreen;
bool m_ClipboardSharing; bool m_ClipboardSharing;
MainWindow* m_pMainWindow; MainWindow* m_pMainWindow;
}; };

View File

@ -53,6 +53,7 @@ ServerConfigDialog::ServerConfigDialog(QWidget* parent, ServerConfig& config, co
m_pCheckBoxCornerBottomLeft->setChecked(serverConfig().switchCorner(BaseConfig::BottomLeft)); m_pCheckBoxCornerBottomLeft->setChecked(serverConfig().switchCorner(BaseConfig::BottomLeft));
m_pCheckBoxCornerBottomRight->setChecked(serverConfig().switchCorner(BaseConfig::BottomRight)); m_pCheckBoxCornerBottomRight->setChecked(serverConfig().switchCorner(BaseConfig::BottomRight));
m_pSpinBoxSwitchCornerSize->setValue(serverConfig().switchCornerSize()); m_pSpinBoxSwitchCornerSize->setValue(serverConfig().switchCornerSize());
m_pCheckBoxDisableLockToScreen->setChecked(serverConfig().disableLockToScreen());
m_pCheckBoxIgnoreAutoConfigClient->setChecked(serverConfig().ignoreAutoConfigClient()); m_pCheckBoxIgnoreAutoConfigClient->setChecked(serverConfig().ignoreAutoConfigClient());
@ -102,6 +103,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().setDisableLockToScreen(m_pCheckBoxDisableLockToScreen->isChecked());
serverConfig().setClipboardSharing(m_pCheckBoxEnableClipboard->isChecked()); serverConfig().setClipboardSharing(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,

View File

@ -44,7 +44,7 @@
<string/> <string/>
</property> </property>
<property name="pixmap"> <property name="pixmap">
<pixmap resource="Synergy.qrc">:/res/icons/64x64/user-trash.png</pixmap> <pixmap resource="../res/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 resource="Synergy.qrc">:/res/icons/64x64/video-display.png</pixmap> <pixmap resource="../res/Synergy.qrc">:/res/icons/64x64/video-display.png</pixmap>
</property> </property>
</widget> </widget>
</item> </item>
@ -408,6 +408,13 @@ 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="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="3" column="0"> <item row="3" column="0">
<widget class="QCheckBox" name="m_pCheckBoxWin32KeepForeground"> <widget class="QCheckBox" name="m_pCheckBoxWin32KeepForeground">
<property name="enabled"> <property name="enabled">
@ -428,13 +435,33 @@ Double click on a screen to edit its settings.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="8" column="0">
<widget class="QCheckBox" name="m_pCheckBoxScreenSaverSync"> <spacer>
<property name="enabled"> <property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
<item row="7" column="0">
<widget class="QCheckBox" name="m_pCheckBoxEnableClipboard">
<property name="text">
<string>Enable clipboard sharing</string>
</property>
<property name="checked">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="m_pCheckBoxIgnoreAutoConfigClient">
<property name="text"> <property name="text">
<string>S&amp;ynchronize screen savers</string> <string>Ignore auto config clients</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -491,40 +518,20 @@ Double click on a screen to edit its settings.</string>
</item> </item>
</layout> </layout>
</item> </item>
<item row="7" column="0"> <item row="2" column="0">
<spacer> <widget class="QCheckBox" name="m_pCheckBoxScreenSaverSync">
<property name="orientation"> <property name="enabled">
<enum>Qt::Vertical</enum> <bool>true</bool>
</property> </property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="m_pCheckBoxEnableDragAndDrop">
<property name="text"> <property name="text">
<string>Enable drag and drop file transfers</string> <string>S&amp;ynchronize screen savers</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> </property>
</widget> </widget>
</item> </item>
<item row="6" column="0"> <item row="6" column="0">
<widget class="QCheckBox" name="m_pCheckBoxEnableClipboard"> <widget class="QCheckBox" name="m_pCheckBoxDisableLockToScreen">
<property name="text"> <property name="text">
<string>Enable clipboard sharing</string> <string>Disable lock to screen</string>
</property>
<property name="checked">
<bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
@ -662,7 +669,7 @@ Double click on a screen to edit its settings.</string>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources> <resources>
<include location="Synergy.qrc"/> <include location="../res/Synergy.qrc"/>
</resources> </resources>
<connections> <connections>
<connection> <connection>