logic: Added update checker connecting to online API

* connects to https://www.sourcetrail.com/api/v1/versions/latest
* sends information about OS, platform, license type, current version and a unique user token
* Automatic update check is enabled via Startscreen and performed once every 24 hours on window focus
* Update check can be forced by clicking on "check for new version" on start screen
* renamed TimePoint to TimeStamp

fortune cookie message = In Träumen und im Leben ist nichts unmöglich.
This commit is contained in:
Eberhard Graether
2017-08-08 14:18:14 +02:00
parent db1c3b3f40
commit ff65a3f285
67 changed files with 680 additions and 251 deletions
+13 -2
View File
@@ -13,10 +13,10 @@
#include "utility/utilityUuid.h"
#include "utility/Version.h"
#include "component/controller/IDECommunicationController.h"
#include "component/NetworkFactory.h"
#include "component/view/DialogView.h"
#include "component/view/GraphViewStyle.h"
#include "component/controller/NetworkFactory.h"
#include "component/controller/IDECommunicationController.h"
#include "component/view/MainView.h"
#include "component/view/ViewFactory.h"
#include "data/storage/StorageCache.h"
@@ -24,6 +24,7 @@
#include "settings/ApplicationSettings.h"
#include "settings/ProjectSettings.h"
#include "settings/ColorScheme.h"
#include "UpdateChecker.h"
std::shared_ptr<Application> Application::s_instance;
std::string Application::s_uuid;
@@ -61,6 +62,8 @@ void Application::createInstance(
s_instance->m_ideCommunicationController =
networkFactory->createIDECommunicationController(s_instance->m_storageCache.get());
s_instance->m_ideCommunicationController->startListening();
s_instance->m_updateChecker = networkFactory->createUpdateChecker();
}
s_instance->startMessagingAndScheduling();
@@ -309,6 +312,14 @@ void Application::handleMessage(MessageSwitchColorScheme* message)
MessageRefresh().refreshUiOnly().noReloadStyle().dispatch();
}
void Application::handleMessage(MessageWindowFocus* message)
{
if (message->focusIn && ApplicationSettings::getInstance()->getAutomaticUpdateCheck())
{
m_updateChecker->checkUpdate();
}
}
void Application::startMessagingAndScheduling()
{
TaskScheduler::getInstance()->startSchedulerLoopThreaded();