Skip to content

Commit

Permalink
To allow customized new version message to be translatable, allow onl…
Browse files Browse the repository at this point in the history
…y the branded name of BOINC to be customized in the message.

Emphasize this difference by changing NVC_CONFIG struct member new_version_text to new_version_name.
Fix a bug I introduced in release_brand.sh script.
  • Loading branch information
Charlie Fenton committed Jul 15, 2018
1 parent a03075c commit fc02420
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
13 changes: 9 additions & 4 deletions client/current_version.cpp
Expand Up @@ -38,7 +38,7 @@ NVC_CONFIG::NVC_CONFIG() {
//
void NVC_CONFIG::defaults() {
client_download_url = "https://boinc.berkeley.edu/download.php";
client_new_version_text = "";
client_new_version_name = "";
client_version_check_url = "https://boinc.berkeley.edu/download.php?xml=1";
};

Expand Down Expand Up @@ -73,7 +73,7 @@ int NVC_CONFIG::parse(FILE* f) {
downcase_string(client_download_url);
continue;
}
if (xp.parse_string("client_new_version_text", client_new_version_text)) {
if (xp.parse_string("client_new_version_name", client_new_version_name)) {
continue;
}
if (xp.parse_string("client_version_check_url", client_version_check_url)) {
Expand Down Expand Up @@ -163,7 +163,9 @@ static bool parse_version(FILE* f, char* new_version, int len) {
}

static void show_newer_version_msg(const char* new_vers) {
if (nvc_config.client_new_version_text.empty()) {
char buf[1024];

if (nvc_config.client_new_version_name.empty()) {
msg_printf_notice(0, true,
"https://boinc.berkeley.edu/manager_links.php?target=notice&controlid=download",
"%s (%s). <a href=%s>%s</a>",
Expand All @@ -173,9 +175,12 @@ static void show_newer_version_msg(const char* new_vers) {
_("Download")
);
} else {
snprintf(buf, sizeof(buf), _("A new version of %s is available"),
nvc_config.client_new_version_name.c_str()
);
msg_printf_notice(0, true, NULL,
"%s (%s). <a href=%s>%s</a>",
nvc_config.client_new_version_text.c_str(),
buf,
new_vers,
nvc_config.client_download_url.c_str(),
_("Download")
Expand Down
2 changes: 1 addition & 1 deletion client/current_version.h
Expand Up @@ -36,7 +36,7 @@ extern void newer_version_startup_check();

struct NVC_CONFIG {
std::string client_download_url;
std::string client_new_version_text;
std::string client_new_version_name;
std::string client_version_check_url;

NVC_CONFIG();
Expand Down
2 changes: 1 addition & 1 deletion mac_installer/release_brand.sh
Expand Up @@ -197,7 +197,7 @@ cp -fp curl/ca-bundle.crt ../BOINC_Installer/Pkg_Root/Library/Application\ Suppo
cp -fp win_build/installerv2/redist/all_projects_list.xml ../BOINC_Installer/Pkg_Root/Library/Application\ Support/BOINC\ Data/installer_projects_list.xml

if [ -n "${NEWVERSIONCHECKDIR}" ]; then
cp -fp "win_build/installerv2/redist/${NEWVERSIONCHECKDIR}/nvc_config.xml" ../BOINC_Installer/Pkg_Root/Library/Application\ Support/BOINC\ Data/installer_projects_list.xml
cp -fp "win_build/installerv2/redist/${NEWVERSIONCHECKDIR}/nvc_config.xml" ../BOINC_Installer/Pkg_Root/Library/Application\ Support/BOINC\ Data/nvc_config.xml
fi

cp -fp clientscr/res/boinc_logo_black.jpg ../BOINC_Installer/Pkg_Root/Library/Application\ Support/BOINC\ Data/
Expand Down
2 changes: 1 addition & 1 deletion win_build/installerv2/redist/WCG/nvc_config.xml
@@ -1,5 +1,5 @@
<nvc_config>
<client_download_url>https://www.worldcommunitygrid.org/reg/ms/viewDownloadAgain.do</client_download_url>
<client_version_check_url>https://www.worldcommunitygrid.org/download_all.php?xml=1</client_version_check_url>
<client_new_version_text>A new version of World Community Grid is available</client_new_version_text>
<client_new_version_name>World Community Grid</client_new_version_name>
</nvc_config>

0 comments on commit fc02420

Please sign in to comment.