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:
@@ -4,6 +4,7 @@
|
||||
#include "settings/migration/SettingsMigrationMoveKey.h"
|
||||
#include "utility/ResourcePaths.h"
|
||||
#include "utility/Status.h"
|
||||
#include "utility/TimeStamp.h"
|
||||
#include "utility/utility.h"
|
||||
#include "utility/UserPaths.h"
|
||||
|
||||
@@ -405,6 +406,36 @@ void ApplicationSettings::setAcceptedEulaVersion(int version)
|
||||
setValue<int>("user/accepted_eula_version", version);
|
||||
}
|
||||
|
||||
std::string ApplicationSettings::getUserToken() const
|
||||
{
|
||||
return getValue<std::string>("user/token", "");
|
||||
}
|
||||
|
||||
void ApplicationSettings::setUserToken(std::string token)
|
||||
{
|
||||
setValue<std::string>("user/token", token);
|
||||
}
|
||||
|
||||
bool ApplicationSettings::getAutomaticUpdateCheck() const
|
||||
{
|
||||
return getValue<bool>("user/update_check/automatic", false);
|
||||
}
|
||||
|
||||
void ApplicationSettings::setAutomaticUpdateCheck(bool automaticUpdates)
|
||||
{
|
||||
setValue<bool>("user/update_check/automatic", automaticUpdates);
|
||||
}
|
||||
|
||||
TimeStamp ApplicationSettings::getLastUpdateCheck() const
|
||||
{
|
||||
return TimeStamp(getValue<std::string>("user/update_check/last", ""));
|
||||
}
|
||||
|
||||
void ApplicationSettings::setLastUpdateCheck(const TimeStamp& time)
|
||||
{
|
||||
setValue<std::string>("user/update_check/last", time.toString());
|
||||
}
|
||||
|
||||
int ApplicationSettings::getPluginPort() const
|
||||
{
|
||||
return getValue<int>("network/plugin_port", 6666);
|
||||
|
||||
Reference in New Issue
Block a user