Skip to content

Commit

Permalink
Make the splash screen text to be a part of SplashScreen
Browse files Browse the repository at this point in the history
This moves everything related to the splash screen to one place,
cleaning up the content a bit.

On top of that:
* Audacity no longer generates `https://www.audacityteam.org/download/?from_ver=` strings introduced in c53e2db. This URLs are no longer supported by the website anyway
* Link to downloads is removed from the AboutDialog
  • Loading branch information
crsib committed Oct 13, 2023
1 parent b958cab commit 9cb9fda
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 111 deletions.
105 changes: 0 additions & 105 deletions libraries/lib-wx-init/HelpText.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@
#include "AllThemeResources.h"
#include "Theme.h"

#ifdef HAS_WHATS_NEW

namespace
{
const char* WhatsNewURL = "https://audacityteam.org/3.2.0-video";
}

#endif

wxString HtmlColourOfIndex( int i ){
wxColour c = theTheme.Colour(i);
Expand Down Expand Up @@ -199,66 +191,6 @@ TranslatableString TitleText( const wxString & Key )

static wxString HelpTextBuiltIn( const wxString & Key )
{
// PRL: Is it necessary to define these outside of conditional compilation so that both get into the .pot file?
const auto alphamsg = XO(
"<br><br>The version of Audacity you are using is an <b>Alpha test version</b>.");
const auto betamsg = XO(
"<br><br>The version of Audacity you are using is a <b>Beta test version</b>.");

if (Key == wxT("welcome"))
{
wxStringOutputStream o;
wxTextOutputStream s(o);
s
#if defined(IS_ALPHA) || defined(IS_BETA)
<< wxT("<hr><center><h3>")
<< XO("Get the Official Released Version of Audacity")
<< wxT("</h3></center>")
<< VerCheckHtml()
#ifdef IS_ALPHA
<< alphamsg
#else
<< betamsg
#endif
<< wxT(" ")
<< XO(
"We strongly recommend that you use our latest stable released version, which has full documentation and support.<br><br>")
<< XO(
"You can help us get Audacity ready for release by joining our [[https://www.audacityteam.org/community/|community]].<hr><br><br>")
#endif

<< wxT("<center><h3>")
#ifndef HAS_WHATS_NEW
<< wxT("Audacity ") << AUDACITY_VERSION_STRING
#else
/* i18n-hint: %s is replaced with Audacity version */
<< XO("What's new in Audacity %s").Format(AUDACITY_VERSION_STRING)
<< wxT(R"(<p><a href=")") << WhatsNewURL << wxT(R"(">)")
<< wxT(R"(<img src="memory:whats_new_btn.jpeg" width="263" height="148" /></a></p>)")
#endif
<< wxT("</h3><h3>")
<< XO("How to get help")
<< wxT("</h3></center>")
<< XO("These are our support methods:")
<< wxT("<p><ul><li>")
/* i18n-hint: Preserve '[[help:Quick_Help|' as it's the name of a link.*/
<< XO("[[help:Quick_Help|Quick Help]]")
<< wxT("</li><li>")
<< XO(
/* i18n-hint: Preserve '[[help:Main_Page|' as it's the name of a link.*/
" [[help:Main_Page|Manual]]")
<< wxT("</li><li>")
<< XO("[[https://support.audacityteam.org/|Tutorials & How-tos]]")
<< wxT("</li><li>")
<< XO(
" [[https://forum.audacityteam.org/|Forum]] - ask your question directly, online.")
<< wxT("</li></ul></p>")
;

auto result = o.GetString();

return WrapText( result );
}
if(Key==wxT("wma-proprietary"))
{
wxStringOutputStream o;
Expand Down Expand Up @@ -344,40 +276,3 @@ wxString FormatHtmlText( const wxString & Text ){
wxT("</html>");
}

// Function to give the extra 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);
#endif
result += wxString("&Time=") + wxString( __DATE__ ) + wxString( __TIME__ );
result.Replace(" ","");
return result;
}

// Text of hyperlink to check versions.
const wxString VerCheckHtml()
{
wxStringOutputStream o;
wxTextOutputStream s(o);
s
<< "<center>[["
<< VerCheckUrl().GET()
<< "|"
<< XO("Check Online")
<< "]]</center>\n";
return o.GetString();
}

// Url with Version check args attached.
const URLString VerCheckUrl()
{
//The version we intend to use for live Audacity.
#define VER_CHECK_URL "https://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();
}
5 changes: 0 additions & 5 deletions src/AboutDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,11 +511,6 @@ void AboutDialog::PopulateInformationPage( ShuttleGui & S )

/* this builds up the list of information to go in the window in the string
* informationStr */
informationStr
<< wxT("<h2><center>")
<< XO("Build Information")
<< wxT("</center></h2>\n")
<< VerCheckHtml();

informationStr
<< wxT("<h3>")
Expand Down
74 changes: 73 additions & 1 deletion src/SplashDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ most commonly asked questions about Audacity.
#include <wx/frame.h>
#include <wx/html/htmlwin.h>
#include <wx/statbmp.h>
#include <wx/colour.h>
#include <wx/sstream.h>
#include <wx/txtstrm.h>

#include "AllThemeResources.h"
#include "Internat.h"
#include "Theme.h"

#include "FileNames.h"
#include "Project.h"
Expand All @@ -47,6 +54,8 @@ most commonly asked questions about Audacity.
#include "MemoryX.h"
#include <wx/fs_mem.h>

const char* WhatsNewURL = "https://audacityteam.org/3.4.0-video";

namespace
{
# include "../images/WhatsNewBtn.jpeg.h"
Expand Down Expand Up @@ -80,6 +89,69 @@ constexpr int HTMLWindowHeight = 425;
constexpr int HTMLWindowHeight = 280;
#endif

namespace
{
wxString MakeWhatsNewText()
{
// PRL: Is it necessary to define these outside of conditional compilation
// so that both get into the .pot file?
const auto alphamsg = XO(
"<br><br>The version of Audacity you are using is an <b>Alpha test version</b>.");
const auto betamsg = XO(
"<br><br>The version of Audacity you are using is a <b>Beta test version</b>.");

wxStringOutputStream o;
wxTextOutputStream s(o);
s << wxT("<body bgcolor=") << theTheme.Colour(clrTrackInfo).GetAsString(wxC2S_HTML_SYNTAX) << wxT(">")
<< wxT("<font color=") << theTheme.Colour(clrTrackPanelText).GetAsString(wxC2S_HTML_SYNTAX) << wxT(">")
<< wxT("<p>")
#if defined(IS_ALPHA) || defined(IS_BETA)
<< wxT("<center><h3>")
<< XO("Get the Official Released Version of Audacity")
<< wxT("</h3></center>")
<< wxT("<center>[[https://www.audacityteam.org/download|") << XO("Check Online") << wxT("]]</center>")
# ifdef IS_ALPHA
<< alphamsg
# else
<< betamsg
# endif
<< wxT(" ")
<< XO("We strongly recommend that you use our latest stable released version, which has full documentation and support.<br/><br/>")
<< XO("You can help us get Audacity ready for release by joining our [[https://www.audacityteam.org/community/|community]].<hr/><br/><br/>")
#endif

<< wxT("<center><h3>")
#ifndef HAS_WHATS_NEW
<< wxT("Audacity ") << AUDACITY_VERSION_STRING
#else
/* i18n-hint: %s is replaced with Audacity version */
<< XO("What's new in Audacity %s").Format(AUDACITY_VERSION_STRING)
<< wxT(R"(</h3><p><a href=")") << WhatsNewURL << wxT(R"(">)")
<< wxT(
R"(<img src="memory:whats_new_btn.jpeg" width="263" height="148" /></a></p>)")
<< XO("<p>In this release we added Beats & Measures, Time Stretching and more.<br/>")
<< XO("Watch the [[%s|release video]] or read the [[https://support.audacityteam.org/additional-resources/changelog|changelog]] to learn more!</p>").Format(WhatsNewURL)
#endif
<< wxT("<h3>") << XO("How to get help") << wxT("</h3></center>")
<< XO("These are our support methods:")
<< wxT("<p><ul><li>")
/* i18n-hint: Preserve '[[help:Quick_Help|' as it's the name of a
link.*/
<< XO("[[help:Quick_Help|Quick Help]]") << wxT("</li><li>")
<< XO(
/* i18n-hint: Preserve '[[help:Main_Page|' as it's the name of a
link.*/
" [[help:Main_Page|Manual]]")
<< wxT("</li><li>")
<< XO("[[https://support.audacityteam.org/|Tutorials & How-tos]]")
<< wxT("</li><li>")
<< XO(" [[https://forum.audacityteam.org/|Forum]] - ask your question directly, online.")
<< wxT("</li></ul></p>") << wxT("</p></font></body>");

return FormatHtmlText(o.GetString());
}
}

SplashDialog * SplashDialog::pSelf=NULL;

enum
Expand Down Expand Up @@ -206,6 +278,6 @@ void SplashDialog::Show2( wxWindow * pParent )
wxASSERT(pParent);
pSelf = safenew SplashDialog( pParent );
}
pSelf->mpHtml->SetPage(HelpText( wxT("welcome") ));
pSelf->mpHtml->SetPage(MakeWhatsNewText());
pSelf->Show( true );
}

0 comments on commit 9cb9fda

Please sign in to comment.