#6372 Make TLS UX more user friendly
This commit is contained in:
parent
555090c7d2
commit
5f3dce8379
|
@ -480,9 +480,8 @@ void MainWindow::updateFromLogLine(const QString &line)
|
|||
void MainWindow::checkConnected(const QString& line)
|
||||
{
|
||||
// TODO: implement ipc connection state messages to replace this hack.
|
||||
if (line.contains("started server") ||
|
||||
line.contains("connected to server") ||
|
||||
line.contains("watchdog status: ok"))
|
||||
if (line.contains("connected to server") ||
|
||||
line.contains("accepted client connection"))
|
||||
{
|
||||
setSynergyState(synergyConnected);
|
||||
|
||||
|
@ -497,6 +496,10 @@ void MainWindow::checkConnected(const QString& line)
|
|||
appConfig().saveSettings();
|
||||
}
|
||||
}
|
||||
else if (line.contains("started server"))
|
||||
{
|
||||
setSynergyState(synergyListening);
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef SYNERGY_ENTERPRISE
|
||||
|
@ -951,7 +954,7 @@ void MainWindow::setSynergyState(qSynergyState state)
|
|||
if (synergyState() == state)
|
||||
return;
|
||||
|
||||
if (state == synergyConnected || state == synergyConnecting)
|
||||
if ((state == synergyConnected) || (state == synergyConnecting) || (state == synergyListening))
|
||||
{
|
||||
disconnect (m_pButtonToggleStart, SIGNAL(clicked()), m_pActionStartSynergy, SLOT(trigger()));
|
||||
connect (m_pButtonToggleStart, SIGNAL(clicked()), m_pActionStopSynergy, SLOT(trigger()));
|
||||
|
@ -966,24 +969,30 @@ void MainWindow::setSynergyState(qSynergyState state)
|
|||
m_pButtonApply->setEnabled(false);
|
||||
}
|
||||
|
||||
bool connected = false;
|
||||
if (state == synergyConnected || state == synergyTransfering) {
|
||||
connected = true;
|
||||
bool running = false;
|
||||
if (state == synergyConnected || state == synergyListening) {
|
||||
running = true;
|
||||
}
|
||||
|
||||
m_pActionStartSynergy->setEnabled(!connected);
|
||||
m_pActionStopSynergy->setEnabled(connected);
|
||||
m_pActionStartSynergy->setEnabled(!running);
|
||||
m_pActionStopSynergy->setEnabled(running);
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case synergyListening: {
|
||||
if (synergyType() == synergyServer) {
|
||||
setStatus(tr("Synergy is waiting for clients").arg(tlsVersion));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case synergyConnected: {
|
||||
if (m_SecureSocket) {
|
||||
setStatus(tr("Synergy is running (with %1)").arg(tlsVersion));
|
||||
setStatus(tr("Synergy is connected (with %1)").arg(tlsVersion));
|
||||
}
|
||||
else {
|
||||
setStatus(tr("Synergy is running (without %1)").arg(tlsVersion));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case synergyConnecting:
|
||||
|
@ -992,8 +1001,6 @@ void MainWindow::setSynergyState(qSynergyState state)
|
|||
case synergyDisconnected:
|
||||
setStatus(tr("Synergy is not running"));
|
||||
break;
|
||||
case synergyTransfering:
|
||||
break;
|
||||
}
|
||||
|
||||
setIcon(state);
|
||||
|
@ -1587,7 +1594,7 @@ QString MainWindow::getProfileRootForArg()
|
|||
return QString("\"%1\"").arg(dir);
|
||||
}
|
||||
|
||||
bool MainWindow::secureSocket(bool secureSocket)
|
||||
void MainWindow::secureSocket(bool secureSocket)
|
||||
{
|
||||
m_SecureSocket = secureSocket;
|
||||
if (secureSocket) {
|
||||
|
|
|
@ -75,7 +75,7 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
|
|||
synergyDisconnected,
|
||||
synergyConnecting,
|
||||
synergyConnected,
|
||||
synergyTransfering
|
||||
synergyListening
|
||||
};
|
||||
|
||||
enum qSynergyType
|
||||
|
@ -208,7 +208,7 @@ public slots:
|
|||
void proofreadInfo();
|
||||
|
||||
void showEvent (QShowEvent*);
|
||||
bool secureSocket(bool secureSocket);
|
||||
void secureSocket(bool secureSocket);
|
||||
|
||||
private:
|
||||
QSettings& m_Settings;
|
||||
|
|
|
@ -180,7 +180,7 @@
|
|||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Use &SSL encryption</string>
|
||||
<string>Use &TLS encryption</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
Loading…
Reference in New Issue