mirror of
https://github.com/deskflow/deskflow.git
synced 2026-07-07 21:07:23 +08:00
SYNERGY-799 Don't select type by default
This commit is contained in:
parent
db2cb8954d
commit
3fabb2c294
@ -237,7 +237,7 @@ void AppConfig::loadSettings()
|
||||
m_UseExternalConfig = loadSetting(kUseExternalConfig, false).toBool();
|
||||
m_ConfigFile = loadSetting(kConfigFile, QDir::homePath() + "/" + synergyConfigName).toString();
|
||||
m_UseInternalConfig = loadSetting(kUseInternalConfig, false).toBool();
|
||||
m_ClientGroupChecked = loadSetting(kGroupClientCheck, true).toBool();
|
||||
m_ClientGroupChecked = loadSetting(kGroupClientCheck, false).toBool();
|
||||
m_ServerHostname = loadSetting(kServerHostname).toString();
|
||||
|
||||
//only change the serial key if the settings being loaded contains a key
|
||||
|
||||
@ -298,10 +298,8 @@ void MainWindow::createMenuBar()
|
||||
|
||||
void MainWindow::loadSettings()
|
||||
{
|
||||
on_m_pRadioGroupServer_clicked(appConfig().getServerGroupChecked());
|
||||
on_m_pRadioGroupClient_clicked(appConfig().getClientGroupChecked());
|
||||
m_pRadioGroupServer->setChecked(appConfig().getServerGroupChecked());
|
||||
m_pRadioGroupClient->setChecked(appConfig().getClientGroupChecked());
|
||||
enableServer(appConfig().getServerGroupChecked());
|
||||
enableClient(appConfig().getClientGroupChecked());
|
||||
|
||||
m_pLineEditHostname->setText(appConfig().getServerHostname());
|
||||
}
|
||||
@ -1365,18 +1363,38 @@ void MainWindow::updateScreenName()
|
||||
serverConfig().updateServerName();
|
||||
}
|
||||
|
||||
void MainWindow::on_m_pRadioGroupServer_clicked(bool on)
|
||||
void MainWindow::enableServer(bool enable)
|
||||
{
|
||||
m_pRadioGroupServer->setChecked(true);
|
||||
if (on)
|
||||
m_pRadioGroupServer->setChecked(enable);
|
||||
|
||||
if (enable)
|
||||
{
|
||||
//show server controls
|
||||
m_pButtonConfigureServer->show();
|
||||
m_pLabelServerState->show();
|
||||
updateLocalFingerprint();
|
||||
m_pButtonToggleStart->setEnabled(enable);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pLabelFingerprint->hide();
|
||||
m_pButtonConfigureServer->hide();
|
||||
m_pLabelServerState->hide();
|
||||
}
|
||||
}
|
||||
|
||||
//hide client controls
|
||||
m_pRadioGroupClient->setChecked(false);
|
||||
void MainWindow::enableClient(bool enable)
|
||||
{
|
||||
m_pRadioGroupClient->setChecked(enable);
|
||||
|
||||
if (enable)
|
||||
{
|
||||
m_pLabelServerName->show();
|
||||
m_pLineEditHostname->show();
|
||||
m_pButtonConnect->show();
|
||||
m_pButtonToggleStart->setEnabled(enable);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pLabelClientState->hide();
|
||||
m_pLabelServerName->hide();
|
||||
m_pLineEditHostname->hide();
|
||||
@ -1384,25 +1402,21 @@ void MainWindow::on_m_pRadioGroupServer_clicked(bool on)
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_m_pRadioGroupClient_clicked(bool on)
|
||||
{
|
||||
m_pRadioGroupClient->setChecked(true);
|
||||
if (on)
|
||||
{
|
||||
//show client controls
|
||||
m_pLabelServerName->show();
|
||||
m_pLineEditHostname->show();
|
||||
m_pButtonConnect->show();
|
||||
|
||||
//hide server controls
|
||||
m_pRadioGroupServer->setChecked(false);
|
||||
m_pLabelFingerprint->hide();
|
||||
m_pButtonConfigureServer->hide();
|
||||
m_pLabelServerState->hide();
|
||||
}
|
||||
void MainWindow::on_m_pRadioGroupServer_clicked(bool)
|
||||
{
|
||||
enableServer(true);
|
||||
enableClient(false);
|
||||
}
|
||||
|
||||
void MainWindow::on_m_pRadioGroupClient_clicked(bool)
|
||||
{
|
||||
enableClient(true);
|
||||
enableServer(false);
|
||||
}
|
||||
|
||||
void MainWindow::on_m_pButtonConnect_clicked()
|
||||
{
|
||||
restartSynergy();
|
||||
}
|
||||
|
||||
|
||||
@ -143,8 +143,8 @@ public slots:
|
||||
protected slots:
|
||||
void updateLocalFingerprint();
|
||||
void updateScreenName();
|
||||
void on_m_pRadioGroupServer_clicked(bool on);
|
||||
void on_m_pRadioGroupClient_clicked(bool on);
|
||||
void on_m_pRadioGroupServer_clicked(bool);
|
||||
void on_m_pRadioGroupClient_clicked(bool);
|
||||
void on_m_pButtonConfigureServer_clicked();
|
||||
bool on_m_pActionSave_triggered();
|
||||
void on_m_pActionAbout_triggered();
|
||||
@ -187,6 +187,8 @@ public slots:
|
||||
void stopDesktop();
|
||||
void changeEvent(QEvent* event);
|
||||
void retranslateMenuBar();
|
||||
void enableServer(bool enable);
|
||||
void enableClient(bool enable);
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
bool isServiceRunning(QString name);
|
||||
|
||||
@ -866,6 +866,9 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="m_pButtonToggleStart">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Start</string>
|
||||
</property>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user