MGR: Add dummy version check.

It seems that this check will work if the client will check newer file version on start.
Client will check this even the last check was more that 14 days ago and on start only.
Client newer saves this information in its internal files  and never reread 'get_current_version.xml' between checks.
In any other cases result will be empty.
This commit is contained in:
Vitalii Koshura 2017-01-22 05:21:08 +02:00
parent d6ff95d1ec
commit d5ef54221e
No known key found for this signature in database
GPG Key ID: CE0DB1726070A5A3
2 changed files with 18 additions and 0 deletions

View File

@ -164,6 +164,7 @@ void CNetworkConnection::Poll() {
if (!retval) {
wxLogTrace(wxT("Function Status"), wxT("CNetworkConnection::Poll - Connection Success"));
SetStateSuccess(m_strNewComputerName, m_strNewComputerPassword);
m_pDocument->CheckForVersionUpdate();
} else if (ERR_AUTHENTICATOR == retval) {
wxLogTrace(wxT("Function Status"), wxT("CNetworkConnection::Poll - RPC Authorization - ERR_AUTHENTICATOR"));
SetStateErrorAuthentication();
@ -1278,6 +1279,21 @@ bool CMainDocument::IsUserAuthorized() {
return true;
}
void CMainDocument::CheckForVersionUpdate() {
std::string version, url;
// It seems that this check will work if the client will check newer file version on start.
// Client will check this even the last check was more that 14 days ago and on start only.
// Client newer saves this information in its internal files
// and never reread 'get_current_version.xml' between checks.
// In any other cases result will be empty.
rpc.get_newer_version(version, url);
if (!version.empty() && !url.empty()) {
char message[MAXPATHLEN];
snprintf(message, sizeof(message), "%s: %s", wxT("You can download it here"), url);
wxGetApp().SafeMessageBox(message, wxT("A new version of BOINC is available."));
}
}
int CMainDocument::CachedProjectStatusUpdate(bool bForce) {
int i = 0;

View File

@ -167,6 +167,8 @@ public:
bool IsUserAuthorized();
void CheckForVersionUpdate();
CNetworkConnection* m_pNetworkConnection;
CBOINCClientManager* m_pClientManager;
AsyncRPC rpc;