parent
b6bc9202db
commit
d35716f574
15 changed files with 86 additions and 18 deletions
|
|
@ -141,6 +141,7 @@ block of a server config file as seen below. This section is used by the GUI to
|
|||
[internalConfig]
|
||||
clipboardSharing=true
|
||||
clipboardSharingSize=@Variant(\0\0\0\x84\0\0\0\0\0\0<\0)
|
||||
defaultLockToScreenState=false
|
||||
disableLockToScreen=false
|
||||
hasHeartbeat=false
|
||||
hasSwitchDelay=false
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ static const OptionID kOptionXTestXineramaUnaware = OPTION_CODE("XTXU");
|
|||
static const OptionID kOptionScreenPreserveFocus = OPTION_CODE("SFOC");
|
||||
static const OptionID kOptionRelativeMouseMoves = OPTION_CODE("MDLT");
|
||||
static const OptionID kOptionWin32KeepForeground = OPTION_CODE("_KFW");
|
||||
static const OptionID kOptionDefaultLockToScreenState = OPTION_CODE("LTSS");
|
||||
static const OptionID kOptionDisableLockToScreen = OPTION_CODE("DLTS");
|
||||
static const OptionID kOptionClipboardSharing = OPTION_CODE("CLPS");
|
||||
static const OptionID kOptionClipboardSharingSize = OPTION_CODE("CLSZ");
|
||||
|
|
|
|||
|
|
@ -53,23 +53,24 @@ bool ServerConfig::save(const QString &fileName) const
|
|||
|
||||
bool ServerConfig::operator==(const ServerConfig &sc) const
|
||||
{
|
||||
return m_Screens == sc.m_Screens && //
|
||||
m_Columns == sc.m_Columns && //
|
||||
m_Rows == sc.m_Rows && //
|
||||
m_HasHeartbeat == sc.m_HasHeartbeat && //
|
||||
m_Heartbeat == sc.m_Heartbeat && //
|
||||
m_Protocol == sc.m_Protocol && //
|
||||
m_RelativeMouseMoves == sc.m_RelativeMouseMoves && //
|
||||
m_Win32KeepForeground == sc.m_Win32KeepForeground && //
|
||||
m_HasSwitchDelay == sc.m_HasSwitchDelay && //
|
||||
m_SwitchDelay == sc.m_SwitchDelay && //
|
||||
m_HasSwitchDoubleTap == sc.m_HasSwitchDoubleTap && //
|
||||
m_SwitchDoubleTap == sc.m_SwitchDoubleTap && //
|
||||
m_SwitchCornerSize == sc.m_SwitchCornerSize && //
|
||||
m_SwitchCorners == sc.m_SwitchCorners && //
|
||||
m_Hotkeys == sc.m_Hotkeys && //
|
||||
m_DisableLockToScreen == sc.m_DisableLockToScreen && //
|
||||
m_ClipboardSharing == sc.m_ClipboardSharing && //
|
||||
return m_Screens == sc.m_Screens && //
|
||||
m_Columns == sc.m_Columns && //
|
||||
m_Rows == sc.m_Rows && //
|
||||
m_HasHeartbeat == sc.m_HasHeartbeat && //
|
||||
m_Heartbeat == sc.m_Heartbeat && //
|
||||
m_Protocol == sc.m_Protocol && //
|
||||
m_RelativeMouseMoves == sc.m_RelativeMouseMoves && //
|
||||
m_Win32KeepForeground == sc.m_Win32KeepForeground && //
|
||||
m_HasSwitchDelay == sc.m_HasSwitchDelay && //
|
||||
m_SwitchDelay == sc.m_SwitchDelay && //
|
||||
m_HasSwitchDoubleTap == sc.m_HasSwitchDoubleTap && //
|
||||
m_SwitchDoubleTap == sc.m_SwitchDoubleTap && //
|
||||
m_SwitchCornerSize == sc.m_SwitchCornerSize && //
|
||||
m_SwitchCorners == sc.m_SwitchCorners && //
|
||||
m_Hotkeys == sc.m_Hotkeys && //
|
||||
m_DefaultLockToScreenState == sc.m_DefaultLockToScreenState && //
|
||||
m_DisableLockToScreen == sc.m_DisableLockToScreen && //
|
||||
m_ClipboardSharing == sc.m_ClipboardSharing && //
|
||||
m_ClipboardSharingSize == sc.m_ClipboardSharingSize;
|
||||
}
|
||||
|
||||
|
|
@ -115,6 +116,7 @@ void ServerConfig::commit()
|
|||
settings().setValue("hasSwitchDoubleTap", hasSwitchDoubleTap());
|
||||
settings().setValue("switchDoubleTap", switchDoubleTap());
|
||||
settings().setValue("switchCornerSize", switchCornerSize());
|
||||
settings().setValue("defaultLockToScreenState", defaultLockToScreenState());
|
||||
settings().setValue("disableLockToScreen", disableLockToScreen());
|
||||
settings().setValue("clipboardSharing", clipboardSharing());
|
||||
settings().setValue("clipboardSharingSize", QVariant::fromValue(clipboardSharingSize()));
|
||||
|
|
@ -166,6 +168,7 @@ void ServerConfig::recall()
|
|||
haveSwitchDoubleTap(settings().value("hasSwitchDoubleTap", false).toBool());
|
||||
setSwitchDoubleTap(settings().value("switchDoubleTap", 250).toInt());
|
||||
setSwitchCornerSize(settings().value("switchCornerSize").toInt());
|
||||
setDefaultLockToScreenState(settings().value("defaultLockToScreenState", false).toBool());
|
||||
setDisableLockToScreen(settings().value("disableLockToScreen", false).toBool());
|
||||
setClipboardSharingSize(
|
||||
settings().value("clipboardSharingSize", (int)ServerConfig::defaultClipboardSharingSize()).toULongLong()
|
||||
|
|
@ -270,6 +273,8 @@ QTextStream &operator<<(QTextStream &outStream, const ServerConfig &config)
|
|||
<< "relativeMouseMoves = " << (config.relativeMouseMoves() ? "true" : "false") << Qt::endl;
|
||||
outStream << "\t"
|
||||
<< "win32KeepForeground = " << (config.win32KeepForeground() ? "true" : "false") << Qt::endl;
|
||||
outStream << "\t"
|
||||
<< "defaultLockToScreenState = " << (config.defaultLockToScreenState() ? "true" : "false") << Qt::endl;
|
||||
outStream << "\t"
|
||||
<< "disableLockToScreen = " << (config.disableLockToScreen() ? "true" : "false") << Qt::endl;
|
||||
outStream << "\t"
|
||||
|
|
|
|||
|
|
@ -113,6 +113,10 @@ public:
|
|||
{
|
||||
return m_Hotkeys;
|
||||
}
|
||||
bool defaultLockToScreenState() const
|
||||
{
|
||||
return m_DefaultLockToScreenState;
|
||||
}
|
||||
bool disableLockToScreen() const
|
||||
{
|
||||
return m_DisableLockToScreen;
|
||||
|
|
@ -214,6 +218,10 @@ private:
|
|||
{
|
||||
m_SwitchCornerSize = val;
|
||||
}
|
||||
void setDefaultLockToScreenState(bool on)
|
||||
{
|
||||
m_DefaultLockToScreenState = on;
|
||||
}
|
||||
void setDisableLockToScreen(bool on)
|
||||
{
|
||||
m_DisableLockToScreen = on;
|
||||
|
|
@ -248,6 +256,7 @@ private:
|
|||
bool m_HasSwitchDoubleTap = false;
|
||||
int m_SwitchDoubleTap = 0;
|
||||
int m_SwitchCornerSize = 0;
|
||||
bool m_DefaultLockToScreenState = false;
|
||||
bool m_DisableLockToScreen = false;
|
||||
bool m_ClipboardSharing = true;
|
||||
QString m_ClientAddress = "";
|
||||
|
|
|
|||
|
|
@ -137,6 +137,11 @@ ServerConfigDialog::ServerConfigDialog(QWidget *parent, ServerConfig &config)
|
|||
|
||||
ui->sbSwitchCornerSize->setValue(serverConfig().switchCornerSize());
|
||||
|
||||
ui->cbDefaultLockToScreenState->setChecked(serverConfig().defaultLockToScreenState());
|
||||
connect(
|
||||
ui->cbDefaultLockToScreenState, &QCheckBox::toggled, this, &ServerConfigDialog::toggleDefaultLockToScreenState
|
||||
);
|
||||
|
||||
ui->cbDisableLockToScreen->setChecked(serverConfig().disableLockToScreen());
|
||||
connect(ui->cbDisableLockToScreen, &QCheckBox::toggled, this, &ServerConfigDialog::toggleLockToScreen);
|
||||
|
||||
|
|
@ -427,6 +432,12 @@ void ServerConfigDialog::setSwitchDelay(int delay)
|
|||
onChange();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::toggleDefaultLockToScreenState(bool state)
|
||||
{
|
||||
serverConfig().setDefaultLockToScreenState(state);
|
||||
onChange();
|
||||
}
|
||||
|
||||
void ServerConfigDialog::toggleLockToScreen(bool disabled)
|
||||
{
|
||||
serverConfig().setDisableLockToScreen(disabled);
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ protected:
|
|||
void toggleSwitchDelay(bool enable);
|
||||
void setSwitchDelay(int delay);
|
||||
|
||||
void toggleDefaultLockToScreenState(bool state);
|
||||
void toggleLockToScreen(bool disabled);
|
||||
void toggleWin32Foreground(bool enabled);
|
||||
|
||||
|
|
|
|||
|
|
@ -434,6 +434,13 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cbDefaultLockToScreenState">
|
||||
<property name="text">
|
||||
<string>Enable lock to computer at startup</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cbRelativeMouseMoves">
|
||||
<property name="enabled">
|
||||
|
|
|
|||
|
|
@ -671,6 +671,8 @@ void Config::readSectionOptions(ConfigReadContext &s)
|
|||
addOption("", kOptionRelativeMouseMoves, s.parseBoolean(value));
|
||||
} else if (name == "win32KeepForeground") {
|
||||
addOption("", kOptionWin32KeepForeground, s.parseBoolean(value));
|
||||
} else if (name == "defaultLockToScreenState") {
|
||||
addOption("", kOptionDefaultLockToScreenState, s.parseBoolean(value));
|
||||
} else if (name == "disableLockToScreen") {
|
||||
addOption("", kOptionDisableLockToScreen, s.parseBoolean(value));
|
||||
} else if (name == "clipboardSharing") {
|
||||
|
|
@ -1249,6 +1251,9 @@ const char *Config::getOptionName(OptionID id)
|
|||
if (id == kOptionScreenPreserveFocus) {
|
||||
return "preserveFocus";
|
||||
}
|
||||
if (id == kOptionDefaultLockToScreenState) {
|
||||
return "defaultLockToScreenState";
|
||||
}
|
||||
if (id == kOptionDisableLockToScreen) {
|
||||
return "disableLockToScreen";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -134,6 +134,9 @@ Server::Server(ServerConfig &config, PrimaryClient *primaryClient, deskflow::Scr
|
|||
if (!m_disableLockToScreen && (m_primaryClient->getToggleMask() & KeyModifierScrollLock)) {
|
||||
LOG_NOTE("scroll lock is on, locking cursor to screen");
|
||||
m_lockedToScreen = true;
|
||||
} else if (m_defaultLockToScreenState) {
|
||||
LOG_NOTE("default screen lock is on, locking cursor to screen");
|
||||
m_lockedToScreen = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -337,7 +340,9 @@ bool Server::isLockedToScreen() const
|
|||
|
||||
// locked if we say we're locked
|
||||
if (isLockedToScreenServer()) {
|
||||
LOG_NOTE("cursor is locked to screen, check scroll lock key");
|
||||
if (!m_defaultLockToScreenState) {
|
||||
LOG_NOTE("cursor is locked to screen, check scroll lock key");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1098,6 +1103,8 @@ void Server::processOptions()
|
|||
m_switchNeedsAlt = (value != 0);
|
||||
} else if (id == kOptionRelativeMouseMoves) {
|
||||
newRelativeMoves = (value != 0);
|
||||
} else if (id == kOptionDefaultLockToScreenState) {
|
||||
m_defaultLockToScreenState = (value != 0);
|
||||
} else if (id == kOptionDisableLockToScreen) {
|
||||
m_disableLockToScreen = (value != 0);
|
||||
} else if (id == kOptionClipboardSharing) {
|
||||
|
|
|
|||
|
|
@ -450,6 +450,7 @@ private:
|
|||
// screen locking (former scroll lock)
|
||||
bool m_lockedToScreen = false;
|
||||
|
||||
bool m_defaultLockToScreenState = false;
|
||||
bool m_disableLockToScreen = false;
|
||||
bool m_enableClipboard = true;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1060,6 +1060,10 @@ Al habilitar esta opción, se deshabilitará la interfaz gráfica de usuario (GU
|
|||
<source>Browse for a config file</source>
|
||||
<translation type="unfinished">Busque un archivo de configuración</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable lock to computer at startup</source>
|
||||
<translation type="unfinished">Activar el bloqueo del ordenador al iniciar</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsDialog</name>
|
||||
|
|
|
|||
|
|
@ -1060,6 +1060,10 @@ L'abilitazione di questa impostazione disabiliterà l'interfaccia graf
|
|||
<source>Browse for a config file</source>
|
||||
<translation>Cerca un file di configurazione</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable lock to computer at startup</source>
|
||||
<translation type="unfinished">Abilita il blocco al computer all'avvio</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsDialog</name>
|
||||
|
|
|
|||
|
|
@ -1061,6 +1061,10 @@ Enabling this setting will disable the server config GUI.</source>
|
|||
<source>Browse for a config file</source>
|
||||
<translation>設定ファイルを選択</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable lock to computer at startup</source>
|
||||
<translation>起動時にコンピューター間移動のロックを有効にする</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsDialog</name>
|
||||
|
|
|
|||
|
|
@ -1064,6 +1064,10 @@ Enabling this setting will disable the server config GUI.</source>
|
|||
<source>Browse for a config file</source>
|
||||
<translation>Выбрать файл для конфигурации</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable lock to computer at startup</source>
|
||||
<translation type="unfinished">Включить блокировку компьютера при запуске</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsDialog</name>
|
||||
|
|
|
|||
|
|
@ -1061,6 +1061,10 @@ Enabling this setting will disable the server config GUI.</source>
|
|||
<source>Browse for a config file</source>
|
||||
<translation>浏览配置文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable lock to computer at startup</source>
|
||||
<translation type="unfinished">启动时启用锁定到计算机</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsDialog</name>
|
||||
|
|
|
|||
Loading…
Reference in a new issue