From 545d741eb211058a6c9e005d2c46814dcb7502a8 Mon Sep 17 00:00:00 2001 From: James Crook Date: Sun, 11 Sep 2016 13:03:37 +0100 Subject: [PATCH] Make Audacity source more like DarkAudacity source. --- src/AColor.cpp | 14 ++++++++++++++ src/AColor.h | 1 + src/AboutDialog.cpp | 33 +++++++++++++++++---------------- src/Audacity.h | 2 ++ src/AudacityApp.cpp | 8 ++++---- src/AudacityLogger.cpp | 2 +- src/HelpText.cpp | 4 ++-- src/Project.cpp | 6 +++--- src/Theme.cpp | 25 +++++++++++++++++-------- src/Theme.h | 1 + src/ThemeAsCeeCode.h | 2 +- src/export/Export.h | 2 +- src/import/ImportGStreamer.cpp | 2 +- src/prefs/TracksPrefs.cpp | 1 - src/widgets/ASlider.cpp | 5 ----- src/widgets/Meter.cpp | 6 ++++-- 16 files changed, 69 insertions(+), 45 deletions(-) diff --git a/src/AColor.cpp b/src/AColor.cpp index 9c8a6a459..fb66d69f1 100644 --- a/src/AColor.cpp +++ b/src/AColor.cpp @@ -22,6 +22,7 @@ It is also a place to document colour usage policy in Audacity #include #include +#include #include #include @@ -227,6 +228,19 @@ void AColor::Bevel(wxDC & dc, bool up, const wxRect & r) AColor::Line(dc, r.x, r.y + r.height, r.x + r.width, r.y + r.height); } +void AColor::Bevel2(wxDC & dc, bool up, const wxRect & r) +{ + wxBitmap & Bmp = theTheme.Bitmap( up ? bmpUpButtonLarge : bmpDownButtonLarge ); + wxMemoryDC memDC; + memDC.SelectObject(Bmp); + int h = wxMin( r.height, Bmp.GetHeight() ); + + + dc.Blit( r.x,r.y,r.width/2, h, &memDC, 0, 0 ); + dc.Blit( r.x+r.width/2,r.y,r.width/2, h, &memDC, + Bmp.GetWidth() - r.width/2, 0 ); +} + wxColour AColor::Blend( const wxColour & c1, const wxColour & c2 ) { wxColour c3( diff --git a/src/AColor.h b/src/AColor.h index 5975db146..f8222808a 100644 --- a/src/AColor.h +++ b/src/AColor.h @@ -66,6 +66,7 @@ class AColor { static void Line(wxDC & dc, wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2); static void DrawFocus(wxDC & dc, wxRect & r); static void Bevel(wxDC & dc, bool up, const wxRect & r); + static void Bevel2(wxDC & dc, bool up, const wxRect & r); static void BevelTrackInfo(wxDC & dc, bool up, const wxRect & r); static wxColour Blend(const wxColour & c1, const wxColour & c2); diff --git a/src/AboutDialog.cpp b/src/AboutDialog.cpp index dfb8e9fd1..800677f98 100644 --- a/src/AboutDialog.cpp +++ b/src/AboutDialog.cpp @@ -269,19 +269,19 @@ void AboutDialog::PopulateAudacityPage( ShuttleGui & S ) CreateCreditsList(); wxString par1Str = _( -"Audacity 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 is a free program written by a worldwide team of [[http://audacityteam.org/about/credits|volunteers]]. \ +Audacity is [[http://audacityteam.org/download|available]] 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("") ); @@ -302,35 +302,36 @@ visit our forum."); wxString( wxT("
")) + wxT("

Audacity ") + wxString(AUDACITY_VERSION_STRING) + wxT("

") + _("Free, open source, cross-platform software for recording and editing sounds.") + - wxT(" http://audacityteam.org/") + + wxT(" [[http://audacityteam.org/|http://audacityteam.org/]]") + wxT("


") + par1Str + wxT("

") + par2Str + wxT("

") + _("Credits") + wxT("

") + wxT("

") + - wxT("

") + wxString::Format(_("Team Members")) + wxT("

") + + wxT("

") + wxString::Format(_("Audacity Team Members")) + wxT("

") + GetCreditsByRole(roleTeamMember) + wxT("

") + _("Emeritus:") + wxT("
") + _("Distinguished Audacity Team members, not currently active") + wxT("

") + GetCreditsByRole(roleEmeritusTeam) + - wxT("

") + _("Contributors") + wxT("

") + + wxT("

") + _("Contributors") + wxT("
") + GetCreditsByRole(roleContributor) + wxT("

") + _("Translators") + wxT("
") + - translatorCredits + wxT("
") + + translatorCredits + GetCreditsByRole(roleTranslators) + wxT("

") + _("Libraries") + wxT("
") + wxT("Audacity includes code from the following projects:") + wxT("

") + GetCreditsByRole(roleLibrary) + - wxT("

") + _("Special thanks:") + wxT("

") + + wxT("

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


") + _("Audacity® software is copyright")+ + wxT("


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


")+_("Audacity website: [[http://www.audacityteam.org/|http://www.audacityteam.org/]]") + wxT("")); @@ -579,7 +580,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:www.audacityteam.org|Click bait]]") ); AddBuildinfoRow(&informationStr, _("Commit Id:"), #include "RevisionIdent.h" diff --git a/src/Audacity.h b/src/Audacity.h index b741d0c07..a9d0ff569 100644 --- a/src/Audacity.h +++ b/src/Audacity.h @@ -169,6 +169,8 @@ void QuitAudacity(); // Marks strings for extraction only...must use wxGetTranslation() to translate. #define XO(s) wxT(s) +// Marks string for substitution only. +#define _TS(s) wxT(s) // This renames a good use of this C++ keyword that we don't need to review when hunting for leaks. #define PROHIBITED = delete diff --git a/src/AudacityApp.cpp b/src/AudacityApp.cpp index c0a67b7e8..f31227ad4 100644 --- a/src/AudacityApp.cpp +++ b/src/AudacityApp.cpp @@ -1069,7 +1069,7 @@ void AudacityApp::GenerateCrashReport(wxDebugReport::Context ctx) rpt.AddAll(ctx); wxFileName fn(FileNames::DataDir(), wxT("audacity.cfg")); - rpt.AddFile(fn.GetFullPath(), wxT("Audacity Configuration")); + rpt.AddFile(fn.GetFullPath(), _TS("Audacity Configuration")); rpt.AddFile(FileNames::PluginRegistry(), wxT("Plugin Registry")); rpt.AddFile(FileNames::PluginSettings(), wxT("Plugin Settings")); @@ -1081,7 +1081,7 @@ void AudacityApp::GenerateCrashReport(wxDebugReport::Context ctx) AudacityLogger *logger = GetLogger(); if (logger) { - rpt.AddText(wxT("log.txt"), logger->GetLog(), wxT("Audacity Log")); + rpt.AddText(wxT("log.txt"), logger->GetLog(), _TS("Audacity Log")); } bool ok = wxDebugReportPreviewStd().Show(rpt); @@ -1197,8 +1197,8 @@ bool AudacityApp::OnInit() wxTheApp->SetAppName(appName); // Explicitly set since OSX will use it for the "Quit" menu item - wxTheApp->SetAppDisplayName(wxT("Audacity")); - wxTheApp->SetVendorName(wxT("Audacity")); + wxTheApp->SetAppDisplayName(appName); + wxTheApp->SetVendorName(appName); // Unused strings that we want to be translated, even though // we're not using them yet... diff --git a/src/AudacityLogger.cpp b/src/AudacityLogger.cpp index 92bd0f3df..6d41a108d 100644 --- a/src/AudacityLogger.cpp +++ b/src/AudacityLogger.cpp @@ -79,7 +79,7 @@ void AudacityLogger::DoLogText(const wxString & str) TimeStamp(&stamp); - mBuffer << stamp << wxT("Audacity ") << AUDACITY_VERSION_STRING << wxT("\n"); + mBuffer << stamp << _TS("Audacity ") << AUDACITY_VERSION_STRING << wxT("\n"); } mBuffer << str << wxT("\n"); diff --git a/src/HelpText.cpp b/src/HelpText.cpp index af2603193..258808d52 100644 --- a/src/HelpText.cpp +++ b/src/HelpText.cpp @@ -208,7 +208,7 @@ static wxString HelpTextBuiltIn( const wxString & Key ) wxString(wxT("

"))+ _("Audacity can import unprotected files in many other formats (such as M4A and WMA, \ compressed WAV files from portable recorders and audio from video files) if you download and install \ -the optional [[http://manual.audacityteam.org/man/faq_opening_and_saving_files.html#foreign| \ +the optional [[http://manual.audacityteam.org/man/faq_opening_and_saving_files.html#foreign|\ FFmpeg library]] to your computer.") + wxT("

") + _("You can also read our help on importing \ [[http://manual.audacityteam.org/man/faq_opening_and_saving_files.html#midi|MIDI files]] \ @@ -263,4 +263,4 @@ wxString FormatHtmlText( const wxString & Text ){ wxT("\">") + WrapText( LinkExpand( Text ))+ wxT(""); -} \ No newline at end of file +} diff --git a/src/Project.cpp b/src/Project.cpp index 1382b5e02..3478ab029 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -871,7 +871,7 @@ END_EVENT_TABLE() AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id, const wxPoint & pos, const wxSize & size) - : wxFrame(parent, id, wxT("Audacity"), pos, size), + : wxFrame(parent, id, _TS("Audacity"), pos, size), mRate((double) gPrefs->Read(wxT("/SamplingRate/DefaultProjectSampleRate"), AudioIO::GetOptimalSupportedSampleRate())), mDefaultFormat((sampleFormat) gPrefs-> Read(wxT("/SamplingRate/DefaultProjectSampleFormat"), floatSample)), @@ -1380,14 +1380,14 @@ void AudacityProject::SetProjectTitle( int number) // is none. if( number >= 0 ){ /* i18n-hint: The %02i is the project number, the %s is the project name.*/ - name = wxString::Format( wxT("[Project %02i] Audacity \"%s\""), number+1 , + name = wxString::Format( _TS("[Project %02i] Audacity \"%s\""), number+1 , name.IsEmpty() ? "" : name.c_str() ); } // If we are not showing numbers, then shows as 'Audacity'. else if( name.IsEmpty() ) { mbLoadedFromAup = false; - name = wxT("Audacity"); + name = _TS("Audacity"); } if (mIsRecovered) diff --git a/src/Theme.cpp b/src/Theme.cpp index 41d187ade..fabe42d32 100644 --- a/src/Theme.cpp +++ b/src/Theme.cpp @@ -434,6 +434,17 @@ void FlowPacker::SetNewGroup( int iGroupSize ) mComponentWidth=0; } +void FlowPacker::SetColourGroup( ) +{ + myPosBase = 750; + mxPos =0; + mOldFlags = mFlags; + iImageGroupSize = 1; + iImageGroupIndex = -1; + mComponentWidth=0; + myHeight = 11; +} + void FlowPacker::GetNextPosition( int xSize, int ySize ) { // if the height has increased, then we are on a NEW group. @@ -504,7 +515,7 @@ int SourceOutputStream::OpenFile(const wxString & Filename) File.Write( wxT("//\r\n") ); File.Write( wxT("// This file was Auto-Generated.\r\n") ); File.Write( wxT("// It is included by Theme.cpp.\r\n") ); - File.Write( wxT("// Only check this into SVN if you've read and understood the guidelines!\r\n\r\n ") ); + File.Write( wxT("// Only check this into Git if you've read and understood the guidelines!\r\n\r\n ") ); } return bOk; } @@ -588,9 +599,8 @@ void ThemeBase::CreateImageCache( bool bBinarySave ) // Now save the colours. int x,y; - mFlow.SetNewGroup(1); - const int iColSize=10; - mFlow.myHeight = iColSize+1; + mFlow.SetColourGroup(); + const int iColSize = 10; for(i=0;i<(int)mColours.GetCount();i++) { mFlow.GetNextPosition( iColSize, iColSize ); @@ -711,8 +721,8 @@ void ThemeBase::WriteImageMap( ) } } // Now save the colours. - mFlow.SetNewGroup(1); - const int iColSize=10; + mFlow.SetColourGroup(); + const int iColSize = 10; for(i=0;i<(int)mColours.GetCount();i++) { mFlow.GetNextPosition( iColSize, iColSize ); @@ -849,10 +859,9 @@ bool ThemeBase::ReadImageCache( bool bBinaryRead, bool bOkIfNotFound) // return true; //To not load colours.. // Now load the colours. int x,y; - mFlow.SetNewGroup(1); + mFlow.SetColourGroup(); wxColour TempColour; const int iColSize=10; - mFlow.myHeight = iColSize+1; for(i=0;i<(int)mColours.GetCount();i++) { mFlow.GetNextPosition( iColSize, iColSize ); diff --git a/src/Theme.h b/src/Theme.h index a7296b5ce..77f332224 100644 --- a/src/Theme.h +++ b/src/Theme.h @@ -60,6 +60,7 @@ public: void Init(int width); void GetNextPosition( int xSize, int ySize ); void SetNewGroup( int iGroupSize ); + void SetColourGroup( ); wxRect Rect(); void RectMid( int &x, int &y ); diff --git a/src/ThemeAsCeeCode.h b/src/ThemeAsCeeCode.h index 92b655a82..6efef7549 100644 --- a/src/ThemeAsCeeCode.h +++ b/src/ThemeAsCeeCode.h @@ -2,7 +2,7 @@ // // This file was Auto-Generated. // It is included by Theme.cpp. -// Only check this into SVN if you've read and understood the guidelines! +// Only check this into Git if you've read and understood the guidelines! 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,1,184, 0,0,3,68,8,6,0,0,0,194,5,58,248,0,0,0,4,115,66,73, diff --git a/src/export/Export.h b/src/export/Export.h index 138a49d45..2c8e895c5 100644 --- a/src/export/Export.h +++ b/src/export/Export.h @@ -174,7 +174,6 @@ public: wxFileName GetAutoExportFileName(); private: - wxString mFormatName; bool ExamineTracks(); bool GetFilename(); bool CheckFilename(); @@ -186,6 +185,7 @@ private: void OnFilterChanged(wxFileCtrlEvent & evt); private: + wxString mFormatName; FileDialog *mDialog; wxString mFileDialogTitle; AudacityProject *mProject; diff --git a/src/import/ImportGStreamer.cpp b/src/import/ImportGStreamer.cpp index 5d14b5122..9568ea459 100644 --- a/src/import/ImportGStreamer.cpp +++ b/src/import/ImportGStreamer.cpp @@ -264,7 +264,7 @@ void GetGStreamerImportPlugin(ImportPluginList &importPluginList, UnusableImportPluginList & WXUNUSED(unusableImportPluginList)) { - wxLogMessage(wxT("Audacity is built against GStreamer version %d.%d.%d-%d"), + wxLogMessage(_TS("Audacity is built against GStreamer version %d.%d.%d-%d"), GST_VERSION_MAJOR, GST_VERSION_MINOR, GST_VERSION_MICRO, diff --git a/src/prefs/TracksPrefs.cpp b/src/prefs/TracksPrefs.cpp index 031366d6c..b8424fee9 100644 --- a/src/prefs/TracksPrefs.cpp +++ b/src/prefs/TracksPrefs.cpp @@ -197,7 +197,6 @@ void TracksPrefs::SetPinnedHeadPreference(bool value, bool flush) gPrefs->Flush(); } - bool TracksPrefs::Apply() { ShuttleGui S(this, eIsSavingToPrefs); diff --git a/src/widgets/ASlider.cpp b/src/widgets/ASlider.cpp index dcd906b6d..2d773315d 100644 --- a/src/widgets/ASlider.cpp +++ b/src/widgets/ASlider.cpp @@ -1615,11 +1615,6 @@ void ASlider::OnPaint(wxPaintEvent & WXUNUSED(event)) { wxPaintDC dc(this); -#ifdef EXPERIMENTAL_THEMING - wxColour Col(GetParent()->GetBackgroundColour()); - this->SetBackgroundColour( Col ); -#endif - mLWSlider->OnPaint(dc); if ( mSliderIsFocused ) diff --git a/src/widgets/Meter.cpp b/src/widgets/Meter.cpp index 1b378266a..2e80ea842 100644 --- a/src/widgets/Meter.cpp +++ b/src/widgets/Meter.cpp @@ -316,11 +316,13 @@ Meter::Meter(AudacityProject *project, { if(mIsInput) { - mIcon = std::make_unique(MicMenuNarrow_xpm); + //mIcon = new wxBitmap(MicMenuNarrow_xpm); + mIcon = std::make_unique(wxBitmap(theTheme.Bitmap(bmpMic))); } else { - mIcon = std::make_unique(SpeakerMenuNarrow_xpm); + //mIcon = new wxBitmap(SpeakerMenuNarrow_xpm); + mIcon = std::make_unique(wxBitmap(theTheme.Bitmap(bmpSpeaker))); } }