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

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

View File

@ -53,6 +53,7 @@ ServerConfigDialog::ServerConfigDialog(QWidget* parent, ServerConfig& config, co
m_pCheckBoxCornerBottomLeft->setChecked(serverConfig().switchCorner(BaseConfig::BottomLeft));
m_pCheckBoxCornerBottomRight->setChecked(serverConfig().switchCorner(BaseConfig::BottomRight));
m_pSpinBoxSwitchCornerSize->setValue(serverConfig().switchCornerSize());
m_pCheckBoxDisableLockToScreen->setChecked(serverConfig().disableLockToScreen());
m_pCheckBoxIgnoreAutoConfigClient->setChecked(serverConfig().ignoreAutoConfigClient());
@ -102,6 +103,7 @@ void ServerConfigDialog::accept()
serverConfig().setSwitchCornerSize(m_pSpinBoxSwitchCornerSize->value());
serverConfig().setIgnoreAutoConfigClient(m_pCheckBoxIgnoreAutoConfigClient->isChecked());
serverConfig().setEnableDragAndDrop(m_pCheckBoxEnableDragAndDrop->isChecked());
serverConfig().setDisableLockToScreen(m_pCheckBoxDisableLockToScreen->isChecked());
serverConfig().setClipboardSharing(m_pCheckBoxEnableClipboard->isChecked());
// now that the dialog has been accepted, copy the new server config to the original one,

View File

@ -44,7 +44,7 @@
<string/>
</property>
<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>
</widget>
</item>
@ -82,7 +82,7 @@
<string/>
</property>
<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>
</widget>
</item>
@ -408,6 +408,13 @@ Double click on a screen to edit its settings.</string>
<string>&amp;Options</string>
</property>
<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">
<widget class="QCheckBox" name="m_pCheckBoxWin32KeepForeground">
<property name="enabled">
@ -428,13 +435,33 @@ Double click on a screen to edit its settings.</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="m_pCheckBoxScreenSaverSync">
<property name="enabled">
<item row="8" column="0">
<spacer>
<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>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="m_pCheckBoxIgnoreAutoConfigClient">
<property name="text">
<string>S&amp;ynchronize screen savers</string>
<string>Ignore auto config clients</string>
</property>
</widget>
</item>
@ -491,40 +518,20 @@ Double click on a screen to edit its settings.</string>
</item>
</layout>
</item>
<item row="7" column="0">
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
<item row="2" column="0">
<widget class="QCheckBox" name="m_pCheckBoxScreenSaverSync">
<property name="enabled">
<bool>true</bool>
</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">
<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>
<string>S&amp;ynchronize screen savers</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QCheckBox" name="m_pCheckBoxEnableClipboard">
<widget class="QCheckBox" name="m_pCheckBoxDisableLockToScreen">
<property name="text">
<string>Enable clipboard sharing</string>
</property>
<property name="checked">
<bool>true</bool>
<string>Disable lock to screen</string>
</property>
</widget>
</item>
@ -662,7 +669,7 @@ Double click on a screen to edit its settings.</string>
</customwidget>
</customwidgets>
<resources>
<include location="Synergy.qrc"/>
<include location="../res/Synergy.qrc"/>
</resources>
<connections>
<connection>