From d5ef54221e728a40587a54eb22288ef457a71519 Mon Sep 17 00:00:00 2001 From: Vitalii Koshura Date: Sun, 22 Jan 2017 05:21:08 +0200 Subject: [PATCH] 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. --- clientgui/MainDocument.cpp | 16 ++++++++++++++++ clientgui/MainDocument.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/clientgui/MainDocument.cpp b/clientgui/MainDocument.cpp index 3483b9169d..fca4b92d59 100644 --- a/clientgui/MainDocument.cpp +++ b/clientgui/MainDocument.cpp @@ -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; diff --git a/clientgui/MainDocument.h b/clientgui/MainDocument.h index 90c10b5d9d..de5fb71592 100644 --- a/clientgui/MainDocument.h +++ b/clientgui/MainDocument.h @@ -167,6 +167,8 @@ public: bool IsUserAuthorized(); + void CheckForVersionUpdate(); + CNetworkConnection* m_pNetworkConnection; CBOINCClientManager* m_pClientManager; AsyncRPC rpc;