client: add <client_new_version_text> config option

Lets you customize the notice that's generated when a new client version is available
This commit is contained in:
David Anderson 2013-05-20 10:28:19 -07:00
parent 5827ff2a68
commit e12e1d0138
3 changed files with 12 additions and 3 deletions

View File

@ -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) <a href=%s>%s</a>",
_("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")

View File

@ -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(
" <client_version_check_url>%s</client_version_check_url>\n"
" <client_new_version_text>%s</client_new_version_text>\n"
" <client_download_url>%s</client_download_url>\n",
client_version_check_url.c_str(),
client_new_version_text.c_str(),
client_download_url.c_str()
);

View File

@ -137,8 +137,9 @@ struct CONFIG {
bool allow_multiple_clients;
bool allow_remote_gui_rpc;
std::vector<std::string> 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;