From 00223e386bc9d6e8c20ed006946ef8fd0c923f9e Mon Sep 17 00:00:00 2001 From: James Crook Date: Tue, 23 Aug 2016 02:34:25 +0100 Subject: [PATCH] More Dark HTML --- src/AboutDialog.cpp | 85 ++++++++++++++++++++++----------------------- src/HelpText.cpp | 19 +++++++++- src/Project.cpp | 2 +- 3 files changed, 60 insertions(+), 46 deletions(-) diff --git a/src/AboutDialog.cpp b/src/AboutDialog.cpp index 5f8317064..719f0d818 100644 --- a/src/AboutDialog.cpp +++ b/src/AboutDialog.cpp @@ -46,6 +46,9 @@ hold information about one contributor to Audacity. #include "../images/AudacityLogoWithName.xpm" +extern wxString FormatHtmlText( const wxString & Text ); + + void AboutDialog::CreateCreditsList() { // The Audacity Team: developers and support @@ -172,23 +175,23 @@ void AboutDialog::CreateCreditsList() // Libraries - AddCredit(wxT("expat"), roleLibrary); - AddCredit(wxT("FLAC"), roleLibrary); - AddCredit(wxT("iAVC"), roleLibrary); - AddCredit(wxT("LAME"), roleLibrary); - AddCredit(wxT("libmad"), roleLibrary); - AddCredit(wxT("libsndfile"), roleLibrary); - AddCredit(wxT("libsoxr"), roleLibrary); - AddCredit(wxT("lv2 (") + _("incorporating") + wxT(" lilv, msinttypes, serd, sord and sratom)"), roleLibrary); - AddCredit(wxT("Nyquist"), roleLibrary); - AddCredit(wxT("Ogg Vorbis"), roleLibrary); - AddCredit(wxT("PortAudio"), roleLibrary); - AddCredit(wxT("portsmf"), roleLibrary); - AddCredit(wxT("sbsms"), roleLibrary); - AddCredit(wxT("SoundTouch"), roleLibrary); - AddCredit(wxT("TwoLAME"), roleLibrary); - AddCredit(wxT("Vamp"), roleLibrary); - AddCredit(wxT("wxWidgets"), roleLibrary); + AddCredit(wxT("[[http://www.jclark.com/xml/expat.html|expat]]"), roleLibrary); + AddCredit(wxT("[[http://xiph.org/flac/|FLAC]]"), roleLibrary); + AddCredit(wxT("iAVC"), roleLibrary); + AddCredit(wxT("[[http://lame.sourceforge.net/|LAME]]"), roleLibrary); + AddCredit(wxT("[[http://www.underbit.com/products/mad/|libmad]]"), roleLibrary); + AddCredit(wxT("[[http://www.mega-nerd.com/libsndfile/|libsndfile]]"), roleLibrary); + AddCredit(wxT("[[http://sourceforge.net/p/soxr/wiki/Home/|libsoxr]]"), roleLibrary); + AddCredit(wxT("[[http://lv2plug.in/|lv2]] (") + _("incorporating") + wxT(" lilv, msinttypes, serd, sord and sratom)"), roleLibrary); + AddCredit(wxT("[[https://www.cs.cmu.edu/~music/nyquist/|Nyquist]]"), roleLibrary); + AddCredit(wxT("[[http://vorbis.com/|Ogg Vorbis]]"), roleLibrary); + AddCredit(wxT("[[http://www.portaudio.com/|PortAudio]]"), roleLibrary); + AddCredit(wxT("[[http://sourceforge.net/apps/trac/portmedia/wiki/portsmf/|portsmf]]"), roleLibrary); + AddCredit(wxT("[[http://sbsms.sourceforge.net/|sbsms]]"), roleLibrary); + AddCredit(wxT("[[http://www.surina.net/soundtouch/|SoundTouch]]"), roleLibrary); + AddCredit(wxT("[[http://www.twolame.org/|TwoLAME]]"), roleLibrary); + AddCredit(wxT("[[http://www.vamp-plugins.org/|Vamp]]"), roleLibrary); + AddCredit(wxT("[[http://wxwidgets.org/|wxWidgets]]"), roleLibrary); // Thanks @@ -241,7 +244,8 @@ AboutDialog::AboutDialog(wxWindow * parent) sActiveInstance = this; SetName(GetTitle()); - this->SetBackgroundColour(theTheme.Colour( clrAboutBoxBackground )); + //this->SetBackgroundColour(theTheme.Colour( clrAboutBoxBackground )); + this->SetBackgroundColour(theTheme.Colour( clrMedium )); icon = NULL; ShuttleGui S( this, eIsCreating ); S.StartNotebook(); @@ -266,19 +270,19 @@ void AboutDialog::PopulateAudacityPage( ShuttleGui & S ) CreateCreditsList(); wxString par1Str = _( -"Audacity, which this is a customised version of, is a free program written by a worldwide team of volunteers. \ -Audacity is available for Windows, Mac, and GNU/Linux (and other Unix-like systems)."); +"Audacity, which this is a customised version of, is a free program written by a worldwide team of [[http://audacityteam.org/about/credits|volunteers]]. \ +Audacity is [[http://audacityteam.org/download|available]] for Windows, Mac, and GNU/Linux (and other Unix-like systems)."); // This trick here means that the English language version won't mention using // English, whereas all translated versions will. wxString par2StrUntranslated = wxT( -"If you find a bug or have a suggestion for us, please write, in English, to our feedback address. \ -For help, view the tips and tricks on our wiki or \ -visit our forum."); +"If you find a bug or have a suggestion for us, please write, in English, to our [[mailto:feedback@audacityteam.org|feedback address]]. \ +For help, view the tips and tricks on our [[http://wiki.audacityteam.org/|wiki]] or \ +visit our [[http://forum.audacityteam.org/|forum]]."); wxString par2Str = _( -"If you find a bug or have a suggestion for us, please write, in English, to our feedback address. \ -For help, view the tips and tricks on our wiki or \ -visit our forum."); +"If you find a bug or have a suggestion for us, please write, in English, to our [[mailto:feedback@audacityteam.org|feedback address]]. \ +For help, view the tips and tricks on our [[http://wiki.audacityteam.org/|wiki]] or \ +visit our [[http://forum.audacityteam.org/|forum]]."); if( par2Str == par2StrUntranslated ) par2Str.Replace( wxT(", in English,"), wxT("") ); @@ -293,13 +297,9 @@ visit our forum."); { translatorCredits = _("translator_credits") + wxT("
"); } - wxString localeStr = wxLocale::GetSystemEncodingName(); - wxString creditStr = - wxT("") + - wxT("
") + + wxString creditStr = FormatHtmlText( + wxString( wxT("
") ) + wxT("

DarkAudacity ") + wxString(AUDACITY_VERSION_STRING) + wxT("

") + _("Customised version of the Audacity free, open source, cross-platform software " ) + _("for recording and editing sounds.") + @@ -331,22 +331,17 @@ visit our forum."); wxT("

") + _("Special thanks:") + wxT("
") + GetCreditsByRole(roleThanks) + - wxT("


Audacity website: http://www.audacityteam.org/") + - wxT("
DarkAudacity website: http://www.darkaudacity.com/") + + wxT("


Audacity website: [[http://www.audacityteam.org/|http://www.audacityteam.org/]]") + + wxT("
DarkAudacity website: [[http://www.darkaudacity.com/|http://www.darkaudacity.com/]]") + wxT("


") + _("Audacity® software is copyright")+ wxT("© 1999-2016 Audacity Team.
") + _("The name Audacity® is a registered trademark of Dominic Mazzoni.") + - wxT("

"); + wxT("") + ); - - this->SetBackgroundColour(theTheme.Colour( clrAboutBoxBackground )); - - - // New way to add to About box.... auto pPage = S.StartNotebookPage( wxT("DarkAudacity") ); pPage->SetBackgroundColour(wxColour(0xAB, 0xAB,0xAB )); S.StartVerticalLay(1); - { //v For now, change to AudacityLogoWithName via old-fashioned way, not Theme. wxBitmap logo(AudacityLogoWithName_xpm); //v @@ -588,7 +583,7 @@ void AboutDialog::PopulateInformationPage( ShuttleGui & S ) // Uncomment the next two lines to test hyperlinks work from here. // AddBuildinfoRow(&informationStr, wxT("Link Test:"), -// wxT("Click bait") ); +// wxT("[[https:web.audacityteam.org|Click bait]]") ); AddBuildinfoRow(&informationStr, _("Commit Id:"), #include "RevisionIdent.h" @@ -613,6 +608,8 @@ void AboutDialog::PopulateInformationPage( ShuttleGui & S ) // end of table informationStr += wxT("\n"); + informationStr = FormatHtmlText( informationStr ); + html->SetPage(informationStr); // push the page into the html renderer S.Prop(2).AddWindow( html, wxEXPAND ); // make it fill the page // I think the 2 here goes with the StartVerticalLay() call above? @@ -636,7 +633,7 @@ void AboutDialog::PopulateLicensePage( ShuttleGui & S ) // better proportionally spaced. // // The GPL is not to be translated.... - wxString PageText= + wxString PageText= FormatHtmlText( wxT("
GNU GENERAL PUBLIC LICENSE\n
") wxT("
Version 2, June 1991\n
") wxT("

") @@ -918,7 +915,7 @@ wxT("OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\n wxT("TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\n") wxT("YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\n") wxT("PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\n") -wxT("POSSIBILITY OF SUCH DAMAGES.\n"); +wxT("POSSIBILITY OF SUCH DAMAGES.\n")); html->SetPage( PageText ); diff --git a/src/HelpText.cpp b/src/HelpText.cpp index af062036e..3748a271d 100644 --- a/src/HelpText.cpp +++ b/src/HelpText.cpp @@ -109,6 +109,10 @@ static wxString LinkExpand( const wxString & Text ) { Replacement = TypedLink( Key, LinkText ); } + else if( Key.StartsWith( wxT("*URL*") )) + { + Replacement = TypedLink( Key, LinkText ); + } else { Replacement = Link( Key, LinkText ); @@ -226,7 +230,7 @@ audio CDs]].") + wxT("

") { // *URL* will be replaced by whatever URL we are looking for. return WrapText(_("The Manual does not appear to be installed. \ -Please view the Manual online or \ +Please [[*URL*|view the Manual online]] or \ [[http://manual.audacityteam.org/man/unzipping_the_manual.html| \ download the Manual]].

\ To always view the Manual online, change \"Location of Manual\" in \ @@ -254,3 +258,16 @@ wxString HelpText( const wxString & Key ) // Perhaps useful for debugging - we'll return key that we didn't find. return WrapText( Key ); } + + +wxString FormatHtmlText( const wxString & Text ){ + + wxString localeStr = wxLocale::GetSystemEncodingName(); + + return + wxT("") + + WrapText( LinkExpand( Text ))+ + wxT(""); +} diff --git a/src/Project.cpp b/src/Project.cpp index cddeefbe8..779f8d65e 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -1177,7 +1177,7 @@ void AudacityProject::UpdatePrefsVariables() gPrefs->Read(wxT("/AudioFiles/NormalizeOnLoad"),&mNormalizeOnLoad, false); gPrefs->Read(wxT("/GUI/AutoScroll"), &mViewInfo.bUpdateTrackIndicator, true); gPrefs->Read(wxT("/GUI/EmptyCanBeDirty"), &mEmptyCanBeDirty, true ); - gPrefs->Read(wxT("/GUI/Help"), &mHelpPref, wxT("InBrowser") ); + gPrefs->Read(wxT("/GUI/Help"), &mHelpPref, wxT("FromInternet") ); gPrefs->Read(wxT("/GUI/SelectAllOnNone"), &mSelectAllOnNone, true); mStopIfWasPaused = true; // not configurable for now, but could be later. gPrefs->Read(wxT("/GUI/ShowSplashScreen"), &mShowSplashScreen, true);