#6372 Make TLS UX more user friendly

This commit is contained in:
Nick Bolton 2018-07-28 02:54:11 +01:00
parent 555090c7d2
commit 5f3dce8379
3 changed files with 24 additions and 17 deletions

View File

@ -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) {

View File

@ -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;

View File

@ -180,7 +180,7 @@
<bool>false</bool>
</property>
<property name="text">
<string>Use &amp;SSL encryption</string>
<string>Use &amp;TLS encryption</string>
</property>
</widget>
</item>