Remove TranslatableStringArray.h

This commit is contained in:
Paul Licameli 2020-02-02 17:40:45 -05:00
parent 3a764279ba
commit 3b77af5dfc
15 changed files with 32 additions and 122 deletions

View File

@ -268,7 +268,6 @@ src/TrackPanelResizerCell.cpp
src/TrackPanelResizerCell.h
src/TrackUtilities.cpp
src/TrackUtilities.h
src/TranslatableStringArray.h
src/UIHandle.cpp
src/UIHandle.h
src/UndoManager.cpp

View File

@ -2416,7 +2416,6 @@
2840CF4B0AEB807E00F49FC3 /* util.c */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.c; name = util.c; path = twolame/libtwolame/util.c; sourceTree = "<group>"; tabWidth = 3; };
2840CF4C0AEB807E00F49FC3 /* util.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; name = util.h; path = twolame/libtwolame/util.h; sourceTree = "<group>"; tabWidth = 3; };
2840CF840AEB83DB00F49FC3 /* ExportMP2.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ExportMP2.cpp; sourceTree = "<group>"; tabWidth = 3; };
284416391B82D6BC0000574D /* TranslatableStringArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TranslatableStringArray.h; sourceTree = "<group>"; };
2844163A1B82D6BC0000574D /* WaveTrackLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WaveTrackLocation.h; sourceTree = "<group>"; };
28456AC00A2C180E00C23C1E /* ThemePrefs.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ThemePrefs.cpp; sourceTree = "<group>"; tabWidth = 3; };
28456AC10A2C180E00C23C1E /* ThemePrefs.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ThemePrefs.h; sourceTree = "<group>"; tabWidth = 3; };
@ -4709,7 +4708,6 @@
5E74D2DB1CC4429700D88B0B /* tracks */,
5E2B3E5D22BD97A7005042E1 /* TrackUtilities.cpp */,
5E2B3E5E22BD97A7005042E1 /* TrackUtilities.h */,
284416391B82D6BC0000574D /* TranslatableStringArray.h */,
5E15123B1DB000C000702E29 /* UIHandle.cpp */,
5E15123C1DB000C000702E29 /* UIHandle.h */,
1790B0F209883BFD008A330A /* UndoManager.cpp */,

View File

@ -314,7 +314,6 @@ audacity_SOURCES = \
TrackPanelResizerCell.h \
TrackUtilities.cpp \
TrackUtilities.h \
TranslatableStringArray.h \
UIHandle.h \
UIHandle.cpp \
UndoManager.cpp \

View File

@ -355,22 +355,22 @@ am__audacity_SOURCES_DIST = BlockFile.cpp BlockFile.h DirManager.cpp \
TrackPanelListener.h TrackPanelMouseEvent.h \
TrackPanelResizeHandle.cpp TrackPanelResizeHandle.h \
TrackPanelResizerCell.cpp TrackPanelResizerCell.h \
TrackUtilities.cpp TrackUtilities.h TranslatableStringArray.h \
UIHandle.h UIHandle.cpp UndoManager.cpp UndoManager.h \
UserException.cpp UserException.h ViewInfo.cpp ViewInfo.h \
VoiceKey.cpp VoiceKey.h WaveClip.cpp WaveClip.h WaveTrack.cpp \
WaveTrack.h WaveTrackLocation.h WrappedType.cpp WrappedType.h \
ZoomInfo.cpp ZoomInfo.h wxFileNameWrapper.h \
commands/AppCommandEvent.cpp commands/AppCommandEvent.h \
commands/AudacityCommand.cpp commands/AudacityCommand.h \
commands/BatchEvalCommand.cpp commands/BatchEvalCommand.h \
commands/Command.cpp commands/Command.h \
commands/CommandBuilder.cpp commands/CommandBuilder.h \
commands/CommandContext.cpp commands/CommandContext.h \
commands/CommandDirectory.cpp commands/CommandDirectory.h \
commands/CommandFlag.h commands/CommandFunctors.h \
commands/CommandHandler.cpp commands/CommandHandler.h \
commands/CommandManager.cpp commands/CommandManager.h \
TrackUtilities.cpp TrackUtilities.h UIHandle.h UIHandle.cpp \
UndoManager.cpp UndoManager.h UserException.cpp \
UserException.h ViewInfo.cpp ViewInfo.h VoiceKey.cpp \
VoiceKey.h WaveClip.cpp WaveClip.h WaveTrack.cpp WaveTrack.h \
WaveTrackLocation.h WrappedType.cpp WrappedType.h ZoomInfo.cpp \
ZoomInfo.h wxFileNameWrapper.h commands/AppCommandEvent.cpp \
commands/AppCommandEvent.h commands/AudacityCommand.cpp \
commands/AudacityCommand.h commands/BatchEvalCommand.cpp \
commands/BatchEvalCommand.h commands/Command.cpp \
commands/Command.h commands/CommandBuilder.cpp \
commands/CommandBuilder.h commands/CommandContext.cpp \
commands/CommandContext.h commands/CommandDirectory.cpp \
commands/CommandDirectory.h commands/CommandFlag.h \
commands/CommandFunctors.h commands/CommandHandler.cpp \
commands/CommandHandler.h commands/CommandManager.cpp \
commands/CommandManager.h \
commands/CommandManagerWindowClasses.h commands/CommandMisc.h \
commands/CommandSignature.cpp commands/CommandSignature.h \
commands/CommandTargets.h commands/CommandType.cpp \
@ -1883,22 +1883,22 @@ audacity_SOURCES = $(libaudacity_la_SOURCES) AboutDialog.cpp \
TrackPanelListener.h TrackPanelMouseEvent.h \
TrackPanelResizeHandle.cpp TrackPanelResizeHandle.h \
TrackPanelResizerCell.cpp TrackPanelResizerCell.h \
TrackUtilities.cpp TrackUtilities.h TranslatableStringArray.h \
UIHandle.h UIHandle.cpp UndoManager.cpp UndoManager.h \
UserException.cpp UserException.h ViewInfo.cpp ViewInfo.h \
VoiceKey.cpp VoiceKey.h WaveClip.cpp WaveClip.h WaveTrack.cpp \
WaveTrack.h WaveTrackLocation.h WrappedType.cpp WrappedType.h \
ZoomInfo.cpp ZoomInfo.h wxFileNameWrapper.h \
commands/AppCommandEvent.cpp commands/AppCommandEvent.h \
commands/AudacityCommand.cpp commands/AudacityCommand.h \
commands/BatchEvalCommand.cpp commands/BatchEvalCommand.h \
commands/Command.cpp commands/Command.h \
commands/CommandBuilder.cpp commands/CommandBuilder.h \
commands/CommandContext.cpp commands/CommandContext.h \
commands/CommandDirectory.cpp commands/CommandDirectory.h \
commands/CommandFlag.h commands/CommandFunctors.h \
commands/CommandHandler.cpp commands/CommandHandler.h \
commands/CommandManager.cpp commands/CommandManager.h \
TrackUtilities.cpp TrackUtilities.h UIHandle.h UIHandle.cpp \
UndoManager.cpp UndoManager.h UserException.cpp \
UserException.h ViewInfo.cpp ViewInfo.h VoiceKey.cpp \
VoiceKey.h WaveClip.cpp WaveClip.h WaveTrack.cpp WaveTrack.h \
WaveTrackLocation.h WrappedType.cpp WrappedType.h ZoomInfo.cpp \
ZoomInfo.h wxFileNameWrapper.h commands/AppCommandEvent.cpp \
commands/AppCommandEvent.h commands/AudacityCommand.cpp \
commands/AudacityCommand.h commands/BatchEvalCommand.cpp \
commands/BatchEvalCommand.h commands/Command.cpp \
commands/Command.h commands/CommandBuilder.cpp \
commands/CommandBuilder.h commands/CommandContext.cpp \
commands/CommandContext.h commands/CommandDirectory.cpp \
commands/CommandDirectory.h commands/CommandFlag.h \
commands/CommandFunctors.h commands/CommandHandler.cpp \
commands/CommandHandler.h commands/CommandManager.cpp \
commands/CommandManager.h \
commands/CommandManagerWindowClasses.h commands/CommandMisc.h \
commands/CommandSignature.cpp commands/CommandSignature.h \
commands/CommandTargets.h commands/CommandType.cpp \

View File

@ -24,7 +24,6 @@
#include "Resample.h"
#include "Prefs.h"
#include "TranslatableStringArray.h"
#include "Internat.h"
#include "../include/audacity/ComponentInterface.h"

View File

@ -48,7 +48,6 @@
#include "Project.h"
#include "ProjectFileIORegistry.h"
#include "ShuttleGui.h"
#include "TranslatableStringArray.h"
#include "widgets/Grid.h"
#include "widgets/AudacityMessageBox.h"
#include "widgets/HelpSystem.h"

View File

@ -1,66 +0,0 @@
/**********************************************************************
Audacity: A Digital Audio Editor
TranslatableStringArray.h
Paul Licameli
**********************************************************************/
#ifndef __AUDACITY_TRANSLATABLE_STRING_ARRAY__
#define __AUDACITY_TRANSLATABLE_STRING_ARRAY__
#include <wx/app.h> // used in inline function template
class wxArrayStringEx;
wxDECLARE_EXPORTED_EVENT(AUDACITY_DLL_API, EVT_LANGUAGE_CHANGE, wxCommandEvent);
/*
This class can maintain a static table containing user visible strings that updates
itself properly when the language is changed in Preferences.
Typical usage is to define a derived class, override Populate(), and then
make a singleton instance of the class.
Populate() is called only as needed to fill the table on demand the first
time it is used after application startup or language change.
*/
template<typename ArrayType> class TranslatableArray /* not final */
: public wxEvtHandler
{
public:
TranslatableArray()
{
if (wxTheApp)
wxTheApp->Bind(EVT_LANGUAGE_CHANGE,
&TranslatableArray::Invalidate,
this);
}
const ArrayType& Get()
{
if (mContents.empty())
Populate();
return mContents;
}
protected:
// Override this function to fill in mContents,
// typically by lines like
// mContents.push_back(_("Translate me"));
virtual void Populate() = 0;
void Invalidate(wxCommandEvent &evt)
{
mContents.clear();
evt.Skip();
}
ArrayType mContents;
};
#endif

View File

@ -46,7 +46,6 @@
#include "../Shuttle.h"
#include "../ShuttleGui.h"
#include "../widgets/valnum.h"
#include "../TranslatableStringArray.h"
enum kTableType
{

View File

@ -59,7 +59,6 @@
#include "../FileFormats.h"
#include "../Mix.h"
#include "../Tags.h"
#include "../TranslatableStringArray.h"
#include "../widgets/AudacityMessageBox.h"
#include "../widgets/HelpSystem.h"

View File

@ -35,11 +35,8 @@
#include "ThemePrefs.h"
#include "../AColor.h"
#include "../TranslatableStringArray.h"
#include "../widgets/AudacityMessageBox.h"
wxDEFINE_EVENT(EVT_LANGUAGE_CHANGE, wxCommandEvent);
GUIPrefs::GUIPrefs(wxWindow * parent, wxWindowID winid)
/* i18n-hint: refers to Audacity's user interface settings */
: PrefsPanel(parent, winid, XO("Interface"))
@ -350,12 +347,6 @@ wxString GUIPrefs::SetLang( const wxString & lang )
Internat::Init();
// Notify listeners of language changes
{
wxCommandEvent evt(EVT_LANGUAGE_CHANGE);
wxTheApp->ProcessEvent(evt);
}
// Unused strings that we want to be translated, even though
// we're not using them yet...
using future1 = decltype( XO("Master Gain Control") );

View File

@ -19,7 +19,6 @@ Paul Licameli
#include "../Experimental.h"
#include "../NumberScale.h"
#include "../TranslatableStringArray.h"
#include <algorithm>

View File

@ -23,7 +23,6 @@ Paul Licameli
#include <wx/intl.h>
#include "../Prefs.h"
#include "../TranslatableStringArray.h"
WaveformSettings::Globals::Globals()

View File

@ -172,7 +172,6 @@ different formats.
#include "../AllThemeResources.h"
#include "../AColor.h"
#include "../KeyboardCapture.h"
#include "../TranslatableStringArray.h"
#include <algorithm>
#include <math.h>

View File

@ -647,7 +647,6 @@
<ClInclude Include="..\..\..\src\tracks\ui\Scrubbing.h" />
<ClInclude Include="..\..\..\src\tracks\ui\ScrubUI.h" />
<ClInclude Include="..\..\..\src\tracks\ui\TrackView.h" />
<ClInclude Include="..\..\..\src\TranslatableStringArray.h" />
<ClInclude Include="..\..\..\src\UserException.h" />
<ClInclude Include="..\..\..\src\tracks\ui\SliderHandle.h" />
<ClInclude Include="..\..\..\src\tracks\ui\TimeShiftHandle.h" />

View File

@ -2122,9 +2122,6 @@
<ClInclude Include="..\..\..\src\effects\VST\VSTControlMSW.h">
<Filter>src\effects\VST</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\TranslatableStringArray.h">
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\TrackPanelListener.h">
<Filter>src</Filter>
</ClInclude>