From 17961501f640d8af9b36903ae6d64e3f949a4269 Mon Sep 17 00:00:00 2001 From: Josh Harris Date: Tue, 18 Oct 2016 15:26:56 +0100 Subject: [PATCH 01/17] Update ISSUE_TEMPLATE.md Moved the 'Server' and 'Client' fields around --- .github/ISSUE_TEMPLATE.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index fa15485a..590f59a5 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,8 +1,7 @@ ### Operating Systems ### -Client: Applesoft Windy OS 10 - Server: microOS Tiara +Client: Applesoft Windy OS 10 **READ ME, DELETE ME**: On Windows, hold the Windows key and press 'r', type 'winver' and hit return to get your OS version. On Mac, hit the Apple menu (top left of the screen) and check 'About this Mac'. Linux users... you know what you're using ;) From b7e0473cb4e582015aca422a3b83f0a0023d9297 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Wed, 26 Oct 2016 15:34:36 +0100 Subject: [PATCH 02/17] Update buildbot to Qt 4.8.7 --- src/gui/src/MainWindow.cpp | 1 - src/gui/src/ZeroconfService.h | 1 + src/setup/win32/Include.wxi | 2 +- src/setup/win32/Product.wxs | 3 ++- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index a431d27e..8e53f2d6 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -51,7 +51,6 @@ #endif #if defined(Q_OS_WIN) -#define _WIN32_WINNT 0x0501 #define WIN32_LEAN_AND_MEAN #include #endif diff --git a/src/gui/src/ZeroconfService.h b/src/gui/src/ZeroconfService.h index 8f9aa6db..fde78201 100644 --- a/src/gui/src/ZeroconfService.h +++ b/src/gui/src/ZeroconfService.h @@ -21,6 +21,7 @@ #include "ZeroconfRecord.h" #include +#include typedef int32_t DNSServiceErrorType; diff --git a/src/setup/win32/Include.wxi b/src/setup/win32/Include.wxi index 62f92ac7..0961390b 100644 --- a/src/setup/win32/Include.wxi +++ b/src/setup/win32/Include.wxi @@ -7,7 +7,7 @@ - + diff --git a/src/setup/win32/Product.wxs b/src/setup/win32/Product.wxs index 03a309e8..51a9976b 100644 --- a/src/setup/win32/Product.wxs +++ b/src/setup/win32/Product.wxs @@ -118,7 +118,8 @@ - + + From 906fd15b4a2e7421ff2f697cf6a94bec60022f22 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Wed, 26 Oct 2016 15:57:38 +0100 Subject: [PATCH 03/17] #5707 Store and update last version uses in settings --- src/gui/src/AppConfig.cpp | 11 +++++++++++ src/gui/src/AppConfig.h | 7 ++++++- src/gui/src/MainWindow.cpp | 5 +++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/gui/src/AppConfig.cpp b/src/gui/src/AppConfig.cpp index 7fd37f50..06f9f43d 100644 --- a/src/gui/src/AppConfig.cpp +++ b/src/gui/src/AppConfig.cpp @@ -162,6 +162,7 @@ void AppConfig::loadSettings() m_CryptoEnabled = settings().value("cryptoEnabled", true).toBool(); m_AutoHide = settings().value("autoHide", false).toBool(); m_Serialkey = settings().value("serialKey", "").toString(); + m_lastVersion = settings().value("lastVersion", "Unknown").toString(); m_LastExpiringWarningTime = settings().value("lastExpiringWarningTime", 0).toInt(); m_ActivationHasRun = settings().value("activationHasRun", false).toBool(); } @@ -187,6 +188,7 @@ void AppConfig::saveSettings() settings().setValue("cryptoEnabled", m_CryptoEnabled); settings().setValue("autoHide", m_AutoHide); settings().setValue("serialKey", m_Serialkey); + settings().setValue("lastVersion", m_lastVersion); settings().setValue("lastExpiringWarningTime", m_LastExpiringWarningTime); settings().setValue("activationHasRun", m_ActivationHasRun); settings().sync(); @@ -203,6 +205,15 @@ AppConfig& AppConfig::activationHasRun(bool value) return *this; } +QString AppConfig::lastVersion() const +{ + return m_lastVersion; +} + +void AppConfig::setLastVersion(QString version) { + m_lastVersion = version; +} + QSettings &AppConfig::settings() { return *m_pSettings; } void AppConfig::setScreenName(const QString &s) { m_ScreenName = s; } diff --git a/src/gui/src/AppConfig.h b/src/gui/src/AppConfig.h index 7aaeeb41..4dcd4572 100644 --- a/src/gui/src/AppConfig.h +++ b/src/gui/src/AppConfig.h @@ -104,7 +104,11 @@ class AppConfig: public QObject bool activationHasRun() const; AppConfig& activationHasRun(bool value); - void saveSettings();; + QString lastVersion() const; + + void saveSettings(); + void setLastVersion(QString version); + protected: QSettings& settings(); void setScreenName(const QString& s); @@ -139,6 +143,7 @@ protected: bool m_CryptoEnabled; bool m_AutoHide; QString m_Serialkey; + QString m_lastVersion; int m_LastExpiringWarningTime; bool m_ActivationHasRun; diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index 8e53f2d6..59808220 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -156,6 +156,11 @@ MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig, setWindowTitle (m_LicenseManager->activeEditionName()); m_LicenseManager->refresh(); + + QString currentVersion = m_VersionChecker.getVersion(); + if (m_AppConfig->lastVersion() != currentVersion) { + m_AppConfig->setLastVersion (currentVersion); + } } MainWindow::~MainWindow() From 9f1e91cc7688e9b0edbb55188f9f633add5cf804 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Wed, 26 Oct 2016 19:50:18 +0100 Subject: [PATCH 04/17] Remove pointless call to curl_free --- src/lib/arch/unix/ArchInternetUnix.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib/arch/unix/ArchInternetUnix.cpp b/src/lib/arch/unix/ArchInternetUnix.cpp index 596000c1..fe4a39ba 100644 --- a/src/lib/arch/unix/ArchInternetUnix.cpp +++ b/src/lib/arch/unix/ArchInternetUnix.cpp @@ -116,7 +116,6 @@ CurlFacade::urlEncode(const String& url) char* resultCStr = curl_easy_escape(m_curl, url.c_str(), 0); if (resultCStr == NULL) { - curl_free(resultCStr); throw XArch("CURL escape failed."); } From 2de06b972751dae2086805530d405f02995a3638 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Wed, 26 Oct 2016 20:14:02 +0100 Subject: [PATCH 05/17] #5707 Add support for upgrade notifications --- src/gui/src/CoreInterface.cpp | 6 ++++++ src/gui/src/CoreInterface.h | 1 + src/gui/src/LicenseManager.cpp | 5 +++++ src/gui/src/LicenseManager.h | 1 + src/lib/synergy/ArgParser.cpp | 4 ++++ src/lib/synergy/ToolApp.cpp | 31 ++++++++++++++++++++++++++++--- src/lib/synergy/ToolApp.h | 1 + src/lib/synergy/ToolArgs.cpp | 3 ++- src/lib/synergy/ToolArgs.h | 1 + 9 files changed, 49 insertions(+), 4 deletions(-) diff --git a/src/gui/src/CoreInterface.cpp b/src/gui/src/CoreInterface.cpp index f7e987d7..8b3a1ae3 100644 --- a/src/gui/src/CoreInterface.cpp +++ b/src/gui/src/CoreInterface.cpp @@ -62,6 +62,12 @@ QString CoreInterface::getSerialKeyFilePath() return filename; } +QString CoreInterface::notifyUpgrade (QString const& version, + QString const& serialKey) { + QStringList args("--notify-upgrade"); + QString input(version + ":" + serialKey); + return run(args, input); +} QString CoreInterface::notifyActivation(const QString& identity) { diff --git a/src/gui/src/CoreInterface.h b/src/gui/src/CoreInterface.h index c8a291e2..3576f02a 100644 --- a/src/gui/src/CoreInterface.h +++ b/src/gui/src/CoreInterface.h @@ -29,5 +29,6 @@ public: QString getArch(); QString getSerialKeyFilePath(); QString notifyActivation(const QString& identity); + QString notifyUpgrade (QString const& version, QString const& serialKey); QString run(const QStringList& args, const QString& input = ""); }; diff --git a/src/gui/src/LicenseManager.cpp b/src/gui/src/LicenseManager.cpp index aa623c88..15f79933 100644 --- a/src/gui/src/LicenseManager.cpp +++ b/src/gui/src/LicenseManager.cpp @@ -71,6 +71,11 @@ LicenseManager::setSerialKey(QString serialKeyString, bool acceptExpired) return ret; } +void +LicenseManager::notifyUpdate(QString version) { + +} + Edition LicenseManager::activeEdition() const { diff --git a/src/gui/src/LicenseManager.h b/src/gui/src/LicenseManager.h index 3d1d03b8..4d235369 100644 --- a/src/gui/src/LicenseManager.h +++ b/src/gui/src/LicenseManager.h @@ -36,6 +36,7 @@ public: QString activeEditionName() const; SerialKey serialKey() const; void skipActivation(); + void notifyUpdate(QString version); static QString getEditionName(Edition edition, bool trial = false); private: diff --git a/src/lib/synergy/ArgParser.cpp b/src/lib/synergy/ArgParser.cpp index 1af32843..828e4c06 100644 --- a/src/lib/synergy/ArgParser.cpp +++ b/src/lib/synergy/ArgParser.cpp @@ -208,6 +208,10 @@ ArgParser::parseToolArgs(ToolArgs& args, int argc, const char* const* argv) args.m_notifyActivation = true; return true; } + else if (isArg(i, argc, argv, NULL, "--notify-upgrade", 0)) { + args.m_notifyUpgrade = true; + return true; + } else { return false; } diff --git a/src/lib/synergy/ToolApp.cpp b/src/lib/synergy/ToolApp.cpp index bf3dfdce..434ae684 100644 --- a/src/lib/synergy/ToolApp.cpp +++ b/src/lib/synergy/ToolApp.cpp @@ -1,11 +1,11 @@ /* * synergy -- mouse and keyboard sharing utility * Copyright (C) 2014-2016 Symless Ltd. - * + * * This package is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * found in the file LICENSE that should have accompanied this file. - * + * * This package is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -80,6 +80,9 @@ ToolApp::run(int argc, char** argv) else if (m_args.m_getArch) { std::cout << ARCH->getPlatformName() << std::endl; } + else if (m_args.m_notifyUpgrade) { + notifyUpgrade(); + } else if (m_args.m_notifyActivation) { notifyActivation(); } @@ -134,7 +137,29 @@ ToolApp::loginAuth() } } -void +void +ToolApp::notifyUpgrade() +{ + String data; + std::cin >> data; + + std::vector parts = synergy::string::splitString(data, ':'); + size_t count = parts.size(); + + if (count == 2) { + std::stringstream ss; + ss << JSON_URL << "notify/upgraded/"; + ss << "?version=" << parts[0]; + ss << "&serial=" << parts[1]; + + std::cout << ARCH->internet().get(ss.str()) << std::endl; + } + else { + throw XSynergy("Invalid upgrade data."); + } +} + +void ToolApp::notifyActivation() { String info; diff --git a/src/lib/synergy/ToolApp.h b/src/lib/synergy/ToolApp.h index 39c87ca7..0f918827 100644 --- a/src/lib/synergy/ToolApp.h +++ b/src/lib/synergy/ToolApp.h @@ -30,6 +30,7 @@ public: private: void loginAuth(); void notifyActivation(); + void notifyUpgrade(); private: ToolArgs m_args; diff --git a/src/lib/synergy/ToolArgs.cpp b/src/lib/synergy/ToolArgs.cpp index 5f67c666..4884696f 100644 --- a/src/lib/synergy/ToolArgs.cpp +++ b/src/lib/synergy/ToolArgs.cpp @@ -23,6 +23,7 @@ ToolArgs::ToolArgs() : m_getInstalledDir(false), m_getProfileDir(false), m_getArch(false), - m_notifyActivation(false) + m_notifyActivation(false), + m_notifyUpgrade(false) { } diff --git a/src/lib/synergy/ToolArgs.h b/src/lib/synergy/ToolArgs.h index 5febab9e..4a620a9b 100644 --- a/src/lib/synergy/ToolArgs.h +++ b/src/lib/synergy/ToolArgs.h @@ -30,4 +30,5 @@ public: bool m_getProfileDir; bool m_getArch; bool m_notifyActivation; + bool m_notifyUpgrade; }; From 4206799ae357ac603be9720bd702edfcf691d588 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 28 Oct 2016 13:17:07 +0100 Subject: [PATCH 06/17] #5707 Add from and to version numbers to version update notification --- src/gui/src/ActivationNotifier.cpp | 21 ++++++++++++++++++++- src/gui/src/ActivationNotifier.h | 8 +++++++- src/gui/src/CoreInterface.cpp | 7 ++++--- src/gui/src/CoreInterface.h | 4 +++- src/gui/src/LicenseManager.cpp | 15 ++++++++++++++- src/gui/src/LicenseManager.h | 2 +- src/gui/src/MainWindow.cpp | 5 ++++- src/lib/synergy/ToolApp.cpp | 7 ++++--- 8 files changed, 57 insertions(+), 12 deletions(-) diff --git a/src/gui/src/ActivationNotifier.cpp b/src/gui/src/ActivationNotifier.cpp index fb2fd465..e8159a34 100644 --- a/src/gui/src/ActivationNotifier.cpp +++ b/src/gui/src/ActivationNotifier.cpp @@ -20,7 +20,7 @@ #include "CoreInterface.h" ActivationNotifier::ActivationNotifier(QObject *parent) : - QObject(parent) + QObject(parent) { } @@ -29,6 +29,15 @@ void ActivationNotifier::setIdentity(QString identity) m_Identity = identity; } +void ActivationNotifier::setUpgradeInfo(QString const& fromVersion, + QString const& toVersion, + QString const& serialKey) +{ + m_fromVersion = fromVersion; + m_toVersion = toVersion; + m_serialKey = serialKey; +} + void ActivationNotifier::notify() { CoreInterface coreInterface; @@ -39,3 +48,13 @@ void ActivationNotifier::notify() // catch all exceptions and fails silently } } + +void ActivationNotifier::notifyUpgrade() +{ + try { + CoreInterface coreInterface; + coreInterface.notifyUpdate(m_fromVersion, m_toVersion, + m_serialKey); + } catch (...) { + } +} diff --git a/src/gui/src/ActivationNotifier.h b/src/gui/src/ActivationNotifier.h index d245cd27..fda336a4 100644 --- a/src/gui/src/ActivationNotifier.h +++ b/src/gui/src/ActivationNotifier.h @@ -24,18 +24,24 @@ class ActivationNotifier : public QObject { Q_OBJECT public: - explicit ActivationNotifier(QObject *parent = 0); + explicit ActivationNotifier(QObject *parent = 0); void setIdentity(QString identity); + void setUpgradeInfo(QString const& fromVersion, + QString const& toVersion, QString const& serialKey); public slots: void notify(); + void notifyUpgrade(); signals: void finished(); private: QString m_Identity; + QString m_fromVersion; + QString m_toVersion; + QString m_serialKey; }; #endif // ACTIVATIONNOTIFIER_H diff --git a/src/gui/src/CoreInterface.cpp b/src/gui/src/CoreInterface.cpp index 8b3a1ae3..aa8d14a3 100644 --- a/src/gui/src/CoreInterface.cpp +++ b/src/gui/src/CoreInterface.cpp @@ -62,10 +62,11 @@ QString CoreInterface::getSerialKeyFilePath() return filename; } -QString CoreInterface::notifyUpgrade (QString const& version, - QString const& serialKey) { +QString CoreInterface::notifyUpdate (QString const& fromVersion, + QString const& toVersion, + QString const& serialKey) { QStringList args("--notify-upgrade"); - QString input(version + ":" + serialKey); + QString input(fromVersion + ":" + toVersion + ":" + serialKey); return run(args, input); } diff --git a/src/gui/src/CoreInterface.h b/src/gui/src/CoreInterface.h index 3576f02a..98a84f57 100644 --- a/src/gui/src/CoreInterface.h +++ b/src/gui/src/CoreInterface.h @@ -29,6 +29,8 @@ public: QString getArch(); QString getSerialKeyFilePath(); QString notifyActivation(const QString& identity); - QString notifyUpgrade (QString const& version, QString const& serialKey); + QString notifyUpdate (QString const& fromVersion, + QString const& toVersion, + QString const& serialKey); QString run(const QStringList& args, const QString& input = ""); }; diff --git a/src/gui/src/LicenseManager.cpp b/src/gui/src/LicenseManager.cpp index 15f79933..97a1826a 100644 --- a/src/gui/src/LicenseManager.cpp +++ b/src/gui/src/LicenseManager.cpp @@ -72,8 +72,21 @@ LicenseManager::setSerialKey(QString serialKeyString, bool acceptExpired) } void -LicenseManager::notifyUpdate(QString version) { +LicenseManager::notifyUpdate(QString fromVersion, QString toVersion) { + ActivationNotifier* notifier = new ActivationNotifier(); + notifier->setUpgradeInfo (fromVersion, toVersion, + QString::fromStdString(m_serialKey.toString())); + QThread* thread = new QThread(); + connect(notifier, SIGNAL(finished()), thread, SLOT(quit())); + connect(notifier, SIGNAL(finished()), notifier, SLOT(deleteLater())); + connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater())); + + notifier->moveToThread(thread); + thread->start(); + + QMetaObject::invokeMethod(notifier, "notifyUpgrade", + Qt::QueuedConnection); } Edition diff --git a/src/gui/src/LicenseManager.h b/src/gui/src/LicenseManager.h index 4d235369..4592b28e 100644 --- a/src/gui/src/LicenseManager.h +++ b/src/gui/src/LicenseManager.h @@ -36,7 +36,7 @@ public: QString activeEditionName() const; SerialKey serialKey() const; void skipActivation(); - void notifyUpdate(QString version); + void notifyUpdate(QString fromVersion, QString toVersion); static QString getEditionName(Edition edition, bool trial = false); private: diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index 59808220..19a1dfa2 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -157,9 +157,12 @@ MainWindow::MainWindow(QSettings& settings, AppConfig& appConfig, setWindowTitle (m_LicenseManager->activeEditionName()); m_LicenseManager->refresh(); + QString lastVersion = m_AppConfig->lastVersion(); QString currentVersion = m_VersionChecker.getVersion(); - if (m_AppConfig->lastVersion() != currentVersion) { + if (lastVersion != currentVersion) { m_AppConfig->setLastVersion (currentVersion); + m_AppConfig->saveSettings(); + m_LicenseManager->notifyUpdate (lastVersion, currentVersion); } } diff --git a/src/lib/synergy/ToolApp.cpp b/src/lib/synergy/ToolApp.cpp index 434ae684..22a871b8 100644 --- a/src/lib/synergy/ToolApp.cpp +++ b/src/lib/synergy/ToolApp.cpp @@ -146,11 +146,12 @@ ToolApp::notifyUpgrade() std::vector parts = synergy::string::splitString(data, ':'); size_t count = parts.size(); - if (count == 2) { + if (count == 3) { std::stringstream ss; ss << JSON_URL << "notify/upgraded/"; - ss << "?version=" << parts[0]; - ss << "&serial=" << parts[1]; + ss << "?from=" << parts[0]; + ss << "&to=" << parts[1]; + ss << "&serial=" << parts[2]; std::cout << ARCH->internet().get(ss.str()) << std::endl; } From 73685c3d923368841b71a154e8ebc68c28922b9d Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 28 Oct 2016 14:48:01 +0100 Subject: [PATCH 07/17] #5707 Tweak notify url for upgrades --- src/lib/synergy/ToolApp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/synergy/ToolApp.cpp b/src/lib/synergy/ToolApp.cpp index 22a871b8..917894ef 100644 --- a/src/lib/synergy/ToolApp.cpp +++ b/src/lib/synergy/ToolApp.cpp @@ -148,7 +148,7 @@ ToolApp::notifyUpgrade() if (count == 3) { std::stringstream ss; - ss << JSON_URL << "notify/upgraded/"; + ss << JSON_URL << "notify/upgrade"; ss << "?from=" << parts[0]; ss << "&to=" << parts[1]; ss << "&serial=" << parts[2]; From fa7daa48f7f44820f727584e641d53992dd1ed15 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 28 Oct 2016 14:48:36 +0100 Subject: [PATCH 08/17] Revert "Update buildbot to Qt 4.8.7" This reverts commit b7e0473cb4e582015aca422a3b83f0a0023d9297. --- src/gui/src/MainWindow.cpp | 1 + src/gui/src/ZeroconfService.h | 1 - src/setup/win32/Include.wxi | 2 +- src/setup/win32/Product.wxs | 3 +-- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index 19a1dfa2..f32ebdc8 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -51,6 +51,7 @@ #endif #if defined(Q_OS_WIN) +#define _WIN32_WINNT 0x0501 #define WIN32_LEAN_AND_MEAN #include #endif diff --git a/src/gui/src/ZeroconfService.h b/src/gui/src/ZeroconfService.h index fde78201..8f9aa6db 100644 --- a/src/gui/src/ZeroconfService.h +++ b/src/gui/src/ZeroconfService.h @@ -21,7 +21,6 @@ #include "ZeroconfRecord.h" #include -#include typedef int32_t DNSServiceErrorType; diff --git a/src/setup/win32/Include.wxi b/src/setup/win32/Include.wxi index 0961390b..62f92ac7 100644 --- a/src/setup/win32/Include.wxi +++ b/src/setup/win32/Include.wxi @@ -7,7 +7,7 @@ - + diff --git a/src/setup/win32/Product.wxs b/src/setup/win32/Product.wxs index 51a9976b..03a309e8 100644 --- a/src/setup/win32/Product.wxs +++ b/src/setup/win32/Product.wxs @@ -118,8 +118,7 @@ - - + From af9037276c718c6b224fe6695422703f19e87132 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 28 Oct 2016 14:54:38 +0100 Subject: [PATCH 09/17] #5707 Prefer 'update' over 'upgrade' --- src/gui/src/ActivationNotifier.cpp | 4 ++-- src/gui/src/ActivationNotifier.h | 4 ++-- src/gui/src/CoreInterface.cpp | 2 +- src/gui/src/LicenseManager.cpp | 4 ++-- src/lib/synergy/ArgParser.cpp | 4 ++-- src/lib/synergy/ToolApp.cpp | 6 +++--- src/lib/synergy/ToolApp.h | 2 +- src/lib/synergy/ToolArgs.cpp | 2 +- src/lib/synergy/ToolArgs.h | 2 +- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/gui/src/ActivationNotifier.cpp b/src/gui/src/ActivationNotifier.cpp index e8159a34..0786d90c 100644 --- a/src/gui/src/ActivationNotifier.cpp +++ b/src/gui/src/ActivationNotifier.cpp @@ -29,7 +29,7 @@ void ActivationNotifier::setIdentity(QString identity) m_Identity = identity; } -void ActivationNotifier::setUpgradeInfo(QString const& fromVersion, +void ActivationNotifier::setUpdateInfo(QString const& fromVersion, QString const& toVersion, QString const& serialKey) { @@ -49,7 +49,7 @@ void ActivationNotifier::notify() } } -void ActivationNotifier::notifyUpgrade() +void ActivationNotifier::notifyUpdate() { try { CoreInterface coreInterface; diff --git a/src/gui/src/ActivationNotifier.h b/src/gui/src/ActivationNotifier.h index fda336a4..2ac216c7 100644 --- a/src/gui/src/ActivationNotifier.h +++ b/src/gui/src/ActivationNotifier.h @@ -27,12 +27,12 @@ public: explicit ActivationNotifier(QObject *parent = 0); void setIdentity(QString identity); - void setUpgradeInfo(QString const& fromVersion, + void setUpdateInfo(QString const& fromVersion, QString const& toVersion, QString const& serialKey); public slots: void notify(); - void notifyUpgrade(); + void notifyUpdate(); signals: void finished(); diff --git a/src/gui/src/CoreInterface.cpp b/src/gui/src/CoreInterface.cpp index aa8d14a3..b3c11f0a 100644 --- a/src/gui/src/CoreInterface.cpp +++ b/src/gui/src/CoreInterface.cpp @@ -65,7 +65,7 @@ QString CoreInterface::getSerialKeyFilePath() QString CoreInterface::notifyUpdate (QString const& fromVersion, QString const& toVersion, QString const& serialKey) { - QStringList args("--notify-upgrade"); + QStringList args("--notify-update"); QString input(fromVersion + ":" + toVersion + ":" + serialKey); return run(args, input); } diff --git a/src/gui/src/LicenseManager.cpp b/src/gui/src/LicenseManager.cpp index 97a1826a..f11531a0 100644 --- a/src/gui/src/LicenseManager.cpp +++ b/src/gui/src/LicenseManager.cpp @@ -74,7 +74,7 @@ LicenseManager::setSerialKey(QString serialKeyString, bool acceptExpired) void LicenseManager::notifyUpdate(QString fromVersion, QString toVersion) { ActivationNotifier* notifier = new ActivationNotifier(); - notifier->setUpgradeInfo (fromVersion, toVersion, + notifier->setUpdateInfo (fromVersion, toVersion, QString::fromStdString(m_serialKey.toString())); QThread* thread = new QThread(); @@ -85,7 +85,7 @@ LicenseManager::notifyUpdate(QString fromVersion, QString toVersion) { notifier->moveToThread(thread); thread->start(); - QMetaObject::invokeMethod(notifier, "notifyUpgrade", + QMetaObject::invokeMethod(notifier, "notifyUpdate", Qt::QueuedConnection); } diff --git a/src/lib/synergy/ArgParser.cpp b/src/lib/synergy/ArgParser.cpp index 828e4c06..6693ebf0 100644 --- a/src/lib/synergy/ArgParser.cpp +++ b/src/lib/synergy/ArgParser.cpp @@ -208,8 +208,8 @@ ArgParser::parseToolArgs(ToolArgs& args, int argc, const char* const* argv) args.m_notifyActivation = true; return true; } - else if (isArg(i, argc, argv, NULL, "--notify-upgrade", 0)) { - args.m_notifyUpgrade = true; + else if (isArg(i, argc, argv, NULL, "--notify-update", 0)) { + args.m_notifyUpdate = true; return true; } else { diff --git a/src/lib/synergy/ToolApp.cpp b/src/lib/synergy/ToolApp.cpp index 917894ef..653012ff 100644 --- a/src/lib/synergy/ToolApp.cpp +++ b/src/lib/synergy/ToolApp.cpp @@ -80,8 +80,8 @@ ToolApp::run(int argc, char** argv) else if (m_args.m_getArch) { std::cout << ARCH->getPlatformName() << std::endl; } - else if (m_args.m_notifyUpgrade) { - notifyUpgrade(); + else if (m_args.m_notifyUpdate) { + notifyUpdate(); } else if (m_args.m_notifyActivation) { notifyActivation(); @@ -138,7 +138,7 @@ ToolApp::loginAuth() } void -ToolApp::notifyUpgrade() +ToolApp::notifyUpdate() { String data; std::cin >> data; diff --git a/src/lib/synergy/ToolApp.h b/src/lib/synergy/ToolApp.h index 0f918827..771b298f 100644 --- a/src/lib/synergy/ToolApp.h +++ b/src/lib/synergy/ToolApp.h @@ -30,7 +30,7 @@ public: private: void loginAuth(); void notifyActivation(); - void notifyUpgrade(); + void notifyUpdate(); private: ToolArgs m_args; diff --git a/src/lib/synergy/ToolArgs.cpp b/src/lib/synergy/ToolArgs.cpp index 4884696f..2685c1df 100644 --- a/src/lib/synergy/ToolArgs.cpp +++ b/src/lib/synergy/ToolArgs.cpp @@ -24,6 +24,6 @@ ToolArgs::ToolArgs() : m_getProfileDir(false), m_getArch(false), m_notifyActivation(false), - m_notifyUpgrade(false) + m_notifyUpdate(false) { } diff --git a/src/lib/synergy/ToolArgs.h b/src/lib/synergy/ToolArgs.h index 4a620a9b..4619efc1 100644 --- a/src/lib/synergy/ToolArgs.h +++ b/src/lib/synergy/ToolArgs.h @@ -30,5 +30,5 @@ public: bool m_getProfileDir; bool m_getArch; bool m_notifyActivation; - bool m_notifyUpgrade; + bool m_notifyUpdate; }; From af62174b5937932d282837ceb724de6846f5ec2d Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 28 Oct 2016 15:58:59 +0100 Subject: [PATCH 10/17] #5707 Only notify activation on user action --- src/gui/src/ActivationDialog.cpp | 1 + src/gui/src/LicenseManager.cpp | 1 - src/gui/src/LicenseManager.h | 2 -- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/gui/src/ActivationDialog.cpp b/src/gui/src/ActivationDialog.cpp index 6abbc938..253ec3ee 100644 --- a/src/gui/src/ActivationDialog.cpp +++ b/src/gui/src/ActivationDialog.cpp @@ -90,6 +90,7 @@ void ActivationDialog::accept() return; } + m_LicenseManager->notifyActivation("serial:" + m_appConfig->serialKey()); Edition edition = m_LicenseManager->activeEdition(); time_t daysLeft = m_LicenseManager->serialKey().daysLeft(::time(0)); if (edition != kUnregistered) { diff --git a/src/gui/src/LicenseManager.cpp b/src/gui/src/LicenseManager.cpp index f11531a0..a6af21d8 100644 --- a/src/gui/src/LicenseManager.cpp +++ b/src/gui/src/LicenseManager.cpp @@ -45,7 +45,6 @@ LicenseManager::setSerialKey(QString serialKeyString, bool acceptExpired) using std::swap; swap (serialKey, m_serialKey); m_AppConfig->setSerialKey(serialKeyString); - notifyActivation("serial:" + serialKeyString); emit serialKeyChanged(m_serialKey); if (serialKey.isTrial()) { diff --git a/src/gui/src/LicenseManager.h b/src/gui/src/LicenseManager.h index 4592b28e..2dc89cd8 100644 --- a/src/gui/src/LicenseManager.h +++ b/src/gui/src/LicenseManager.h @@ -38,8 +38,6 @@ public: void skipActivation(); void notifyUpdate(QString fromVersion, QString toVersion); static QString getEditionName(Edition edition, bool trial = false); - -private: void notifyActivation(QString identity); private: From ef9842c81916cc5b5a2ab40f35bfc397823905c4 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 28 Oct 2016 16:01:57 +0100 Subject: [PATCH 11/17] #5707 Change update notification url --- src/lib/synergy/ToolApp.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib/synergy/ToolApp.cpp b/src/lib/synergy/ToolApp.cpp index 653012ff..3dcfd05d 100644 --- a/src/lib/synergy/ToolApp.cpp +++ b/src/lib/synergy/ToolApp.cpp @@ -146,17 +146,17 @@ ToolApp::notifyUpdate() std::vector parts = synergy::string::splitString(data, ':'); size_t count = parts.size(); - if (count == 3) { - std::stringstream ss; - ss << JSON_URL << "notify/upgrade"; - ss << "?from=" << parts[0]; - ss << "&to=" << parts[1]; - ss << "&serial=" << parts[2]; + if (count == 3) { + std::stringstream ss; + ss << JSON_URL << "notify/update"; + ss << "?from=" << parts[0]; + ss << "&to=" << parts[1]; + ss << "&serial=" << parts[2]; std::cout << ARCH->internet().get(ss.str()) << std::endl; } else { - throw XSynergy("Invalid upgrade data."); + throw XSynergy("Invalid update data."); } } From 3e9815dfddc8c83522c6caaaef6d88ec5f6dfe9f Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 28 Oct 2016 16:34:35 +0100 Subject: [PATCH 12/17] #5707 Add newline to update notification string --- src/gui/src/CoreInterface.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/src/CoreInterface.cpp b/src/gui/src/CoreInterface.cpp index b3c11f0a..e560fc45 100644 --- a/src/gui/src/CoreInterface.cpp +++ b/src/gui/src/CoreInterface.cpp @@ -67,6 +67,7 @@ QString CoreInterface::notifyUpdate (QString const& fromVersion, QString const& serialKey) { QStringList args("--notify-update"); QString input(fromVersion + ":" + toVersion + ":" + serialKey); + input.append("\n"); return run(args, input); } From 2f2dd7742f79bb60d943cb4ad6d9bfdf79873df1 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 28 Oct 2016 17:43:08 +0100 Subject: [PATCH 13/17] #5707 Don't send update notifications for new users --- src/gui/src/LicenseManager.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/src/LicenseManager.cpp b/src/gui/src/LicenseManager.cpp index a6af21d8..221fd16d 100644 --- a/src/gui/src/LicenseManager.cpp +++ b/src/gui/src/LicenseManager.cpp @@ -72,6 +72,11 @@ LicenseManager::setSerialKey(QString serialKeyString, bool acceptExpired) void LicenseManager::notifyUpdate(QString fromVersion, QString toVersion) { + if ((fromVersion == "Unknown") + && (m_serialKey == SerialKey(kUnregistered))) { + return; + } + ActivationNotifier* notifier = new ActivationNotifier(); notifier->setUpdateInfo (fromVersion, toVersion, QString::fromStdString(m_serialKey.toString())); From c9bb421fb5deb056166e728c820ae547f5fa0c2f Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 28 Oct 2016 17:48:20 +0100 Subject: [PATCH 14/17] Version to v1.8.5-rc2 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d3bf196..e888229a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ set(VERSION_MAJOR 1) set(VERSION_MINOR 8) set(VERSION_REV 5) -set(VERSION_STAGE rc1) +set(VERSION_STAGE rc2) set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}") cmake_minimum_required(VERSION 2.6) From 771d2a419b27e28b3fa3e839eaa1da34ec4c0cb1 Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Mon, 31 Oct 2016 12:38:16 +0000 Subject: [PATCH 15/17] Fix 1.8.4 changelog --- ChangeLog | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 19d10d50..a496d276 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,16 +1,15 @@ v1.8.4-stable ============= - -Bug #4041 UHD/4K DPI scaling broken on Windows servers -Bug #4420 When XRandR adds a screen, it is inaccessible -Bug #5603 Activation notification depends on existence of /etc/os-release -Bug #5624 Update notification sometimes requests a downgrade -Bug #5329 Current date is shown for build date in the about dialog -Bug #5640 Synergy branding is inconsistent across platforms -Enhancement #5617 Remove redundant plugin infrastructure -Enhancement #5627 Move SSL certificate generation to main window -Enhancement #5628 Move SSL implementation into core binary -Enhancement #5629 Move activation from wizard into new dialog window +Bug #5183 - Slowly moving the cursor has no effect on high DPI clients +Bug #4041 - UHD/4K DPI scaling broken on Windows servers +Bug #4420 - When XRandR adds a screen, it is inaccessible +Bug #5603 - Activation notification depends on existence of /etc/os-release +Bug #5624 - Update notification sometimes requests a downgrade +Bug #5329 - Current date is shown for build date in the about dialog +Enhancement #5617 - Remove redundant plugin infrastructure +Enhancement #5627 - Move SSL certificate generation to main window +Enhancement #5628 - Move SSL implementation into core binary +Enhancement #5629 - Move activation from wizard into new dialog window v1.8.3-stable ============= From 20a34e5abf6e77692de27024fdf2bca98b29fa0d Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Mon, 31 Oct 2016 12:45:20 +0000 Subject: [PATCH 16/17] Update changelog for 1.8.5-stable --- ChangeLog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index a496d276..477426ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +v1.8.5-stable +============= +Bug #5680 - Server crashes when disconnecting SSL clients +Bug #5626 - Build fails using Xcode 8 and macOS SDK 10.12 +Feature #5657 - Trial version support +Feature #5707 - User upgrade statistics + v1.8.4-stable ============= Bug #5183 - Slowly moving the cursor has no effect on high DPI clients From a18eba7520f301fac921c178aa0c75d7768ef176 Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Mon, 31 Oct 2016 12:45:42 +0000 Subject: [PATCH 17/17] Version to 1.8.5-stable --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e888229a..45c8d9d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ set(VERSION_MAJOR 1) set(VERSION_MINOR 8) set(VERSION_REV 5) -set(VERSION_STAGE rc2) +set(VERSION_STAGE stable) set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}") cmake_minimum_required(VERSION 2.6)