From e12e1d0138bba1df5a10ab60a94fdf3c0ea2f175 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 20 May 2013 10:28:19 -0700 Subject: [PATCH] client: add config option Lets you customize the notice that's generated when a new client version is available --- client/current_version.cpp | 4 +++- lib/cc_config.cpp | 8 +++++++- lib/cc_config.h | 3 ++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/client/current_version.cpp b/client/current_version.cpp index cf86405009..6bb1bc1846 100644 --- a/client/current_version.cpp +++ b/client/current_version.cpp @@ -86,7 +86,9 @@ static void show_newer_version_msg(const char* new_vers) { msg_printf_notice(0, true, "http://boinc.berkeley.edu/manager_links.php?target=notice&controlid=download", "%s (%s) %s", - _("A new version of BOINC is available."), + config.client_new_version_text.empty() + ? _("A new version of BOINC is available.") + : client_new_version_text.c_str(), new_vers, config.client_download_url.c_str(), _("Download") diff --git a/lib/cc_config.cpp b/lib/cc_config.cpp index cad181c67a..128c15bfdc 100644 --- a/lib/cc_config.cpp +++ b/lib/cc_config.cpp @@ -200,8 +200,9 @@ void CONFIG::defaults() { allow_multiple_clients = false; allow_remote_gui_rpc = false; alt_platforms.clear(); - client_version_check_url = "http://boinc.berkeley.edu/download.php?xml=1"; client_download_url = "http://boinc.berkeley.edu/download.php"; + client_new_version_text = ""; + client_version_check_url = "http://boinc.berkeley.edu/download.php?xml=1"; config_coprocs.clear(); data_dir[0] = 0; disallow_attach = false; @@ -313,6 +314,9 @@ int CONFIG::parse_options(XML_PARSER& xp) { downcase_string(client_download_url); continue; } + if (xp.parse_string("client_new_version_text", client_new_version_text)) { + continue; + } if (xp.parse_string("client_version_check_url", client_version_check_url)) { downcase_string(client_version_check_url); continue; @@ -474,8 +478,10 @@ int CONFIG::write(MIOFILE& out, LOG_FLAGS& log_flags) { out.printf( " %s\n" + " %s\n" " %s\n", client_version_check_url.c_str(), + client_new_version_text.c_str(), client_download_url.c_str() ); diff --git a/lib/cc_config.h b/lib/cc_config.h index a59c423844..4be1984cd5 100644 --- a/lib/cc_config.h +++ b/lib/cc_config.h @@ -137,8 +137,9 @@ struct CONFIG { bool allow_multiple_clients; bool allow_remote_gui_rpc; std::vector alt_platforms; - std::string client_version_check_url; std::string client_download_url; + std::string client_new_version_text; + std::string client_version_check_url; COPROCS config_coprocs; char data_dir[256]; bool disallow_attach;