From fc42fd9b0d1f051d7f6d05d2b1e5242fdcfbc55e Mon Sep 17 00:00:00 2001 From: James Crook Date: Tue, 28 Feb 2017 19:05:06 +0000 Subject: [PATCH] Bug 1597 - Tweak: make version check on welcome user-initiated. The welcome screen now has an extra prelude for Alphas, and as result no longer needs to force a version check onto our website. Users can still do that by clicking "check online". I've also rearranged the version check code a little, so that there is better reuse. E.g. we can change the URL in just one place in the code. --- src/AboutDialog.cpp | 38 +++++++++++++++++++++++--------------- src/AboutDialog.h | 2 ++ src/AudacityApp.cpp | 3 ++- src/HelpText.cpp | 8 ++++++++ src/Menus.cpp | 3 +-- 5 files changed, 36 insertions(+), 18 deletions(-) diff --git a/src/AboutDialog.cpp b/src/AboutDialog.cpp index 75bb7bbad..fe789d6d5 100644 --- a/src/AboutDialog.cpp +++ b/src/AboutDialog.cpp @@ -66,7 +66,6 @@ extern wxString FormatHtmlText( const wxString & Text ); // Function to give the xtra arguments to put on the version check string. const wxString VerCheckArgs(){ - wxString result = wxString("from_ver=") + AUDACITY_VERSION_STRING; #ifdef REV_LONG result += wxString("&CommitId=")+wxString(REV_LONG).Left(6); @@ -76,6 +75,28 @@ const wxString VerCheckArgs(){ return result; } +// Url with Version check args attached. +const wxString VerCheckUrl(){ + //The version we intend to use for live Audacity. +#define VER_CHECK_URL "http://www.audacityteam.org/download/?" +//For testing of our scriptlet. +//#define VER_CHECK_URL "http://www.audacityteam.org/slug/?" +//For testing locally +//#define VER_CHECK_URL "http://localhost:63342/WorkingDocs/demos/download.html?" + + return wxString( wxT(VER_CHECK_URL)) +VerCheckArgs(); +} + +// Text of htperlink to check versions. +const wxString VerCheckHtml(){ + + wxString result = "
[["; + result += VerCheckUrl() + "|" + _("Check Online"); + result += "]]
\n"; + return result; +} + + void AboutDialog::CreateCreditsList() { // The Audacity Team: developers and support @@ -437,20 +458,7 @@ void AboutDialog::PopulateInformationPage( ShuttleGui & S ) informationStr = wxT("

"); informationStr += _("Build Information"); informationStr += wxT("

\n"); - // Only for debug builds, for now. - -//The version we intend to use for live Audacity. -#define VER_CHECK_URL "[[http://www.audacityteam.org/download/?" -//For testing of our scriptlet. -//#define VER_CHECK_URL "[[http://www.audacityteam.org/slug/?" -//For testing locally -//#define VER_CHECK_URL "[[http://localhost:63342/WorkingDocs/demos/download.html?" - - informationStr += wxT("
"); - informationStr += wxString(VER_CHECK_URL) + VerCheckArgs() + "|" + - _("Check Online") + "]]"; - informationStr += wxT("
\n"); - + informationStr += VerCheckHtml(); // top level heading informationStr += wxT("

"); informationStr += _("File Format Support"); diff --git a/src/AboutDialog.h b/src/AboutDialog.h index 3973e8754..04fdcbe25 100644 --- a/src/AboutDialog.h +++ b/src/AboutDialog.h @@ -19,6 +19,8 @@ #include "widgets/wxPanelWrapper.h" extern const wxString VerCheckArgs(); +extern const wxString VerCheckUrl(); +extern const wxString VerCheckHtml(); class ShuttleGui; diff --git a/src/AudacityApp.cpp b/src/AudacityApp.cpp index 6b31fb651..7c8ce10a4 100644 --- a/src/AudacityApp.cpp +++ b/src/AudacityApp.cpp @@ -1522,7 +1522,8 @@ bool AudacityApp::OnInit() if( project->mShowSplashScreen ){ // This may do a check-for-updates at every start up. // Mainly this is to tell users of ALPHAS who don't know that they have an ALPHA. - project->MayCheckForUpdates(); + // Disabled for now, after discussion. + // project->MayCheckForUpdates(); project->OnHelpWelcome(); } diff --git a/src/HelpText.cpp b/src/HelpText.cpp index 1f73dc961..da97fedcd 100644 --- a/src/HelpText.cpp +++ b/src/HelpText.cpp @@ -18,6 +18,7 @@ #include "Audacity.h" #include "HelpText.h" #include "FileNames.h" +#include "AboutDialog.h" @@ -193,6 +194,13 @@ static wxString HelpTextBuiltIn( const wxString & Key ) /* i18n-hint: Preserve [[file:quick_help.html as it's the name of a file.*/ return WrapText( wxString(wxT("")) + +#if IS_ALPHA + wxT("

") + _("Get the Official Released Version of Audacity") + wxT("

") + + VerCheckHtml() + + _("

The version of Audacity you are using is an Alpha test version.") + " " + + _("We strongly recommend that you use our latest stable released version, which has full documentation and support.

")+ + _("You can help us get Audacity ready for release by joining our [[http://www.audacityteam.org/community/|community]].


")+ +#endif wxT("

Audacity ") + AUDACITY_VERSION_STRING + wxT("

") + _("How to get help") + wxT("

") + _("These are our support methods:") + wxT("