Merge activation dialog branch into v1.8.4

This commit is contained in:
Andrew Nelless 2016-10-06 13:01:18 +01:00
commit ef3b79e585
6 changed files with 26 additions and 8 deletions

View File

@ -128,7 +128,7 @@
</sizepolicy>
</property>
<property name="text">
<string>Fingerprint:</string>
<string>SSL Fingerprint:</string>
</property>
</widget>
</item>

View File

@ -281,7 +281,10 @@ ElevateMode AppConfig::elevateMode()
return m_ElevateMode;
}
void AppConfig::setCryptoEnabled(bool e) { m_CryptoEnabled = e; }
void AppConfig::setCryptoEnabled(bool e) {
m_CryptoEnabled = e;
emit sslToggled(e);
}
bool AppConfig::getCryptoEnabled() const {
return (edition() == Pro) && m_CryptoEnabled;

View File

@ -98,14 +98,15 @@ class AppConfig: public QObject
void setCryptoEnabled(bool e);
bool getCryptoEnabled() const;
void setAutoHide(bool b);
bool getAutoHide();
void saveSettings();
bool activationHasRun() const;
AppConfig& activationHasRun(bool value);
void saveSettings();
protected:
QSettings& settings();
void setScreenName(const QString& s);
@ -118,7 +119,6 @@ class AppConfig: public QObject
void setLanguage(const QString language);
void setStartedBefore(bool b);
void setElevateMode(ElevateMode em);
void loadSettings();
private:
@ -150,6 +150,7 @@ class AppConfig: public QObject
signals:
void editionSet(int);
void sslToggled(bool enabled);
};
#endif

View File

@ -140,6 +140,7 @@ MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig) :
m_pLabelPadlock->hide();
connect (this, SIGNAL(windowShown()), this, SLOT(on_windowShown()), Qt::QueuedConnection);
connect (&m_AppConfig, SIGNAL(editionSet(int)), this, SLOT(setEdition(int)), Qt::QueuedConnection);
connect (&m_AppConfig, SIGNAL(sslToggled(bool)), this, SLOT(sslToggled(bool)), Qt::QueuedConnection);
}
MainWindow::~MainWindow()
@ -497,7 +498,7 @@ void MainWindow::restartSynergy()
void MainWindow::proofreadInfo()
{
setEdition(m_AppConfig.edition());
setEdition(m_AppConfig.edition()); // Why is this here?
int oldState = m_SynergyState;
m_SynergyState = synergyDisconnected;
@ -628,6 +629,16 @@ void MainWindow::startSynergy()
}
}
void
MainWindow::sslToggled (bool enabled)
{
if (enabled) {
m_pSslCertificate = new SslCertificate(this);
m_pSslCertificate->generateCertificate();
}
updateLocalFingerprint();
}
bool MainWindow::clientArgs(QStringList& args, QString& app)
{
app = appPath(appConfig().synergycName());

View File

@ -126,6 +126,7 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
void startSynergy();
protected slots:
void sslToggled(bool enabled);
void on_m_pGroupClient_toggled(bool on);
void on_m_pGroupServer_toggled(bool on);
bool on_m_pButtonBrowseConfigFile_clicked();

View File

@ -51,8 +51,10 @@ void VersionChecker::replyFinished(QNetworkReply* reply)
if (!newestVersion.isEmpty())
{
QString currentVersion = getVersion();
if (compareVersions(currentVersion, newestVersion) > 0)
emit updateFound(newestVersion);
if (currentVersion != "Unknown") {
if (compareVersions(currentVersion, newestVersion) > 0)
emit updateFound(newestVersion);
}
}
}