1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 16:10:06 +02:00

PopupMenuTable does not need TranslatableArray...

... because the strings in it are TranslatableString, not translated
This commit is contained in:
Paul Licameli 2020-02-02 17:32:23 -05:00
parent 48b5988c7d
commit 6e57428e47
2 changed files with 16 additions and 4 deletions

View File

@ -608,9 +608,8 @@ protected:
WaveTrackMenuTable &WaveTrackMenuTable::Instance( Track * pTrack )
{
static WaveTrackMenuTable instance;
wxCommandEvent evt;
// Clear it out so we force a repopulate
instance.Invalidate( evt );
instance.Clear();
// Ensure we know how to populate.
// Messy, but the design does not seem to offer an alternative.
// We won't use pTrack after populate.

View File

@ -25,7 +25,6 @@ class wxString;
#include "../MemoryX.h"
#include "../Internat.h"
#include "../TranslatableStringArray.h"
class PopupMenuTable;
@ -53,7 +52,7 @@ struct PopupMenuTableEntry
bool IsValid() const { return type != Invalid; }
};
class PopupMenuTable : public TranslatableArray< std::vector<PopupMenuTableEntry> >
class PopupMenuTable : public wxEvtHandler
{
public:
typedef PopupMenuTableEntry Entry;
@ -95,6 +94,20 @@ public:
// No memory management responsibility is assumed by this function.
static std::unique_ptr<Menu> BuildMenu
(wxEvtHandler *pParent, PopupMenuTable *pTable, void *pUserData = NULL);
protected:
virtual void Populate() = 0;
void Clear() { mContents.clear(); }
using Entries = std::vector<PopupMenuTableEntry>;
const Entries& Get()
{
if (mContents.empty())
Populate();
return mContents;
}
Entries mContents;
};
/*