mirror of
https://github.com/debauchee/barrier.git
synced 2024-12-26 04:25:00 +03:00
Added ignore auto connect clients check box
This commit is contained in:
parent
aa9990fba9
commit
66a1ffa5f5
@ -507,7 +507,7 @@ Double click on a screen to edit its settings.</string>
|
||||
<item row="4" column="0">
|
||||
<widget class="QCheckBox" name="m_pCheckBoxIgnoreAutoConnectClient">
|
||||
<property name="text">
|
||||
<string>Ingore all clients from auto connect</string>
|
||||
<string>Ignore auto connect clients</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -884,21 +884,23 @@ void MainWindow::on_m_pActionSettings_triggered()
|
||||
|
||||
void MainWindow::autoAddScreen(const QString name)
|
||||
{
|
||||
int r = m_ServerConfig.autoAddScreen(name);
|
||||
if (r != kAutoAddScreenOk) {
|
||||
switch (r) {
|
||||
case kAutoAddScreenManualServer:
|
||||
showConfigureServer(
|
||||
tr("Please add the server (%1) to the grid.")
|
||||
.arg(appConfig().screenName()));
|
||||
break;
|
||||
if (!m_ServerConfig.ignoreAutoConnectClient()) {
|
||||
int r = m_ServerConfig.autoAddScreen(name);
|
||||
if (r != kAutoAddScreenOk) {
|
||||
switch (r) {
|
||||
case kAutoAddScreenManualServer:
|
||||
showConfigureServer(
|
||||
tr("Please add the server (%1) to the grid.")
|
||||
.arg(appConfig().screenName()));
|
||||
break;
|
||||
|
||||
case kAutoAddScreenManualClient:
|
||||
showConfigureServer(
|
||||
tr("Please drag the new client screen (%1) "
|
||||
"to the desired position on the grid.")
|
||||
.arg(name));
|
||||
break;
|
||||
case kAutoAddScreenManualClient:
|
||||
showConfigureServer(
|
||||
tr("Please drag the new client screen (%1) "
|
||||
"to the desired position on the grid.")
|
||||
.arg(name));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -49,6 +49,7 @@ ServerConfig::ServerConfig(QSettings* settings, int numColumns, int numRows ,
|
||||
m_NumColumns(numColumns),
|
||||
m_NumRows(numRows),
|
||||
m_ServerName(serverName),
|
||||
m_IgnoreAutoConnectClient(false),
|
||||
m_pMainWindow(mainWindow)
|
||||
{
|
||||
Q_ASSERT(m_pSettings);
|
||||
@ -112,6 +113,7 @@ void ServerConfig::saveSettings()
|
||||
settings().setValue("hasSwitchDoubleTap", hasSwitchDoubleTap());
|
||||
settings().setValue("switchDoubleTap", switchDoubleTap());
|
||||
settings().setValue("switchCornerSize", switchCornerSize());
|
||||
settings().setValue("ignoreAutoConnectClient", ignoreAutoConnectClient());
|
||||
|
||||
writeSettings(settings(), switchCorners(), "switchCorner");
|
||||
|
||||
@ -154,6 +156,7 @@ void ServerConfig::loadSettings()
|
||||
haveSwitchDoubleTap(settings().value("hasSwitchDoubleTap", false).toBool());
|
||||
setSwitchDoubleTap(settings().value("switchDoubleTap", 250).toInt());
|
||||
setSwitchCornerSize(settings().value("switchCornerSize").toInt());
|
||||
setIgnoreAutoConnectClient(settings().value("ignoreAutoConnectClient").toBool());
|
||||
|
||||
readSettings(settings(), switchCorners(), "switchCorner", false, NumSwitchCorners);
|
||||
|
||||
|
@ -60,6 +60,7 @@ class ServerConfig : public BaseConfig
|
||||
int switchCornerSize() const { return m_SwitchCornerSize; }
|
||||
const QList<bool>& switchCorners() const { return m_SwitchCorners; }
|
||||
const HotkeyList& hotkeys() const { return m_Hotkeys; }
|
||||
bool ignoreAutoConnectClient() const { return m_IgnoreAutoConnectClient; }
|
||||
|
||||
void saveSettings();
|
||||
void loadSettings();
|
||||
@ -86,6 +87,7 @@ class ServerConfig : public BaseConfig
|
||||
void setSwitchDoubleTap(int val) { m_SwitchDoubleTap = val; }
|
||||
void setSwitchCorner(int c, bool on) { m_SwitchCorners[c] = on; }
|
||||
void setSwitchCornerSize(int val) { m_SwitchCornerSize = val; }
|
||||
void setIgnoreAutoConnectClient(bool on) { m_IgnoreAutoConnectClient = on; }
|
||||
QList<bool>& switchCorners() { return m_SwitchCorners; }
|
||||
HotkeyList& hotkeys() { return m_Hotkeys; }
|
||||
|
||||
@ -116,6 +118,7 @@ class ServerConfig : public BaseConfig
|
||||
QList<bool> m_SwitchCorners;
|
||||
HotkeyList m_Hotkeys;
|
||||
QString m_ServerName;
|
||||
bool m_IgnoreAutoConnectClient;
|
||||
MainWindow* m_pMainWindow;
|
||||
};
|
||||
|
||||
|
@ -54,6 +54,8 @@ ServerConfigDialog::ServerConfigDialog(QWidget* parent, ServerConfig& config, co
|
||||
m_pCheckBoxCornerBottomRight->setChecked(serverConfig().switchCorner(BaseConfig::BottomRight));
|
||||
m_pSpinBoxSwitchCornerSize->setValue(serverConfig().switchCornerSize());
|
||||
|
||||
m_pCheckBoxIgnoreAutoConnectClient->setChecked(serverConfig().ignoreAutoConnectClient());
|
||||
|
||||
foreach(const Hotkey& hotkey, serverConfig().hotkeys())
|
||||
m_pListHotkeys->addItem(hotkey.text());
|
||||
|
||||
@ -94,6 +96,7 @@ void ServerConfigDialog::accept()
|
||||
serverConfig().setSwitchCorner(BaseConfig::BottomLeft, m_pCheckBoxCornerBottomLeft->isChecked());
|
||||
serverConfig().setSwitchCorner(BaseConfig::BottomRight, m_pCheckBoxCornerBottomRight->isChecked());
|
||||
serverConfig().setSwitchCornerSize(m_pSpinBoxSwitchCornerSize->value());
|
||||
serverConfig().setIgnoreAutoConnectClient(m_pCheckBoxIgnoreAutoConnectClient->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.
|
||||
|
Loading…
Reference in New Issue
Block a user