Audacity  3.0.3
HistoryWindow.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  HistoryWindow.cpp
6 
7  Joshua Haberman
8  Leland Lucius
9 
10 *******************************************************************//*******************************************************************/
18 
19 
20 #include "HistoryWindow.h"
21 
22 #include <wx/app.h>
23 #include <wx/defs.h>
24 #include <wx/button.h>
25 #include <wx/dialog.h>
26 #include <wx/event.h>
27 #include <wx/frame.h>
28 #include <wx/imaglist.h>
29 #include <wx/intl.h>
30 #include <wx/listctrl.h>
31 #include <wx/settings.h>
32 #include <wx/spinctrl.h>
33 #include <wx/stattext.h>
34 #include <wx/textctrl.h>
35 
36 #include "AudioIO.h"
37 #include "Clipboard.h"
38 #include "CommonCommandFlags.h"
39 #include "../images/Arrow.xpm"
40 #include "../images/Empty9x16.xpm"
41 #include "UndoManager.h"
42 #include "Project.h"
43 #include "ProjectFileIO.h"
44 #include "ProjectHistory.h"
45 #include "ShuttleGui.h"
47 #include "widgets/HelpSystem.h"
48 
49 enum {
50  ID_AVAIL = 1000,
57 };
58 
59 BEGIN_EVENT_TABLE(HistoryDialog, wxDialogWrapper)
60  EVT_SHOW(HistoryDialog::OnShow)
61  EVT_SIZE(HistoryDialog::OnSize)
69 
70 #define HistoryTitle XO("History")
71 
73  wxDialogWrapper(FindProjectFrame( parent ), wxID_ANY, HistoryTitle,
74  wxDefaultPosition, wxDefaultSize,
75  wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER )
76 {
77  SetName();
78 
79  mManager = manager;
80  mProject = parent;
81  mSelected = 0;
82  mAudioIOBusy = false;
83 
84  //------------------------- Main section --------------------
85  // Construct the GUI.
86  ShuttleGui S(this, eIsCreating);
87  Populate(S);
88 
89  wxTheApp->Bind(EVT_AUDIOIO_PLAYBACK,
91  this);
92 
93  wxTheApp->Bind(EVT_AUDIOIO_CAPTURE,
95  this);
96 
97  Clipboard::Get().Bind(
98  EVT_CLIPBOARD_CHANGE, &HistoryDialog::UpdateDisplay, this);
99  parent->Bind(EVT_UNDO_PUSHED, &HistoryDialog::UpdateDisplay, this);
100  parent->Bind(EVT_UNDO_MODIFIED, &HistoryDialog::UpdateDisplay, this);
101  parent->Bind(EVT_UNDO_OR_REDO, &HistoryDialog::UpdateDisplay, this);
102  parent->Bind(EVT_UNDO_RESET, &HistoryDialog::UpdateDisplay, this);
103  parent->Bind(EVT_UNDO_PURGE, &HistoryDialog::UpdateDisplay, this);
104 }
105 
107 {
108  auto imageList = std::make_unique<wxImageList>(9, 16);
109  imageList->Add(wxIcon(empty9x16_xpm));
110  imageList->Add(wxIcon(arrow_xpm));
111 
112  S.SetBorder(5);
113  S.StartVerticalLay(true);
114  {
115  S.StartStatic(XO("&Manage History"), 1);
116  {
117  mList = S
118  .MinSize()
119  .ConnectRoot(wxEVT_KEY_DOWN, &HistoryDialog::OnListKeyDown)
120  .AddListControlReportMode(
121  { { XO("Action"), wxLIST_FORMAT_LEFT, 260 },
122  { XO("Used Space"), wxLIST_FORMAT_LEFT, 125 } },
123  wxLC_SINGLE_SEL
124  );
125 
126  //Assign rather than set the image list, so that it is deleted later.
127  // AssignImageList takes ownership
128  mList->AssignImageList(imageList.release(), wxIMAGE_LIST_SMALL);
129 
130  S.StartMultiColumn(3, wxCENTRE);
131  {
132  S.AddPrompt(XXO("&Total space used"));
133  mTotal = S.Id(ID_TOTAL).Style(wxTE_READONLY).AddTextBox({}, wxT(""), 10);
134  S.AddVariableText( {} )->Hide();
135 
136 #if defined(ALLOW_DISCARD)
137  S.AddPrompt(XXO("&Undo levels available"));
138  mAvail = S.Id(ID_AVAIL).Style(wxTE_READONLY).AddTextBox({}, wxT(""), 10);
139  S.AddVariableText( {} )->Hide();
140 
141  S.AddPrompt(XXO("&Levels to discard"));
142  mLevels = safenew wxSpinCtrl(S.GetParent(),
143  ID_LEVELS,
144  wxT("1"),
145  wxDefaultPosition,
146  wxDefaultSize,
147  wxSP_ARROW_KEYS,
148  0,
150  0);
151  S.AddWindow(mLevels);
152  /* i18n-hint: (verb)*/
153  mDiscard = S.Id(ID_DISCARD).AddButton(XXO("&Discard"));
154 #endif
155  S.AddPrompt(XXO("Clip&board space used"));
156  mClipboard = S.Style(wxTE_READONLY).AddTextBox({}, wxT(""), 10);
157 
158 #if defined(ALLOW_DISCARD)
159  S.Id(ID_DISCARD_CLIPBOARD).AddButton(XXO("D&iscard"));
160 #endif
161  }
162  S.EndMultiColumn();
163  }
164  S.EndStatic();
165 #if defined(ALLOW_DISCARD)
166  mCompact = safenew wxButton(this, ID_COMPACT, _("&Compact"));
168 #else
170 #endif
171  }
172  S.EndVerticalLay();
173  // ----------------------- End of main section --------------
174 
175  Layout();
176  Fit();
177  SetMinSize(GetSize());
178  mList->SetColumnWidth(0, mList->GetClientSize().x - mList->GetColumnWidth(1));
179  mList->SetTextColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
180 }
181 
182 void HistoryDialog::OnAudioIO(wxCommandEvent& evt)
183 {
184  evt.Skip();
185 
186  if (evt.GetInt() != 0)
187  mAudioIOBusy = true;
188  else
189  mAudioIOBusy = false;
190 
191 #if defined(ALLOW_DISCARD)
192  mDiscard->Enable(!mAudioIOBusy);
193  mCompact->Enable(!mAudioIOBusy);
194 #endif
195 }
196 
198 {
199  e.Skip();
200  if(IsShown())
201  DoUpdate();
202 }
203 
204 bool HistoryDialog::Show( bool show )
205 {
206  if ( show && !IsShown())
207  DoUpdate();
208  return wxDialogWrapper::Show( show );
209 }
210 
212 {
213  int i;
214 
216 
217  mList->DeleteAllItems();
218 
219  wxLongLong_t total = 0;
221  for (i = 0; i < (int)mManager->GetNumStates(); i++) {
222  TranslatableString desc, size;
223 
224  total += mManager->GetLongDescription(i, &desc, &size);
225  mList->InsertItem(i, desc.Translation(), i == mSelected ? 1 : 0);
226  mList->SetItem(i, 1, size.Translation());
227  }
228 
229  mTotal->SetValue(Internat::FormatSize(total).Translation());
230 
231  auto clipboardUsage = mManager->GetClipboardSpaceUsage();
232  mClipboard->SetValue(Internat::FormatSize(clipboardUsage).Translation());
233 #if defined(ALLOW_DISCARD)
234  FindWindowById(ID_DISCARD_CLIPBOARD)->Enable(clipboardUsage > 0);
235 #endif
236 
237  mList->EnsureVisible(mSelected);
238 
239  mList->SetItemState(mSelected,
240  wxLIST_STATE_FOCUSED | wxLIST_STATE_SELECTED,
241  wxLIST_STATE_FOCUSED | wxLIST_STATE_SELECTED);
242 
243  UpdateLevels();
244 }
245 
247 {
248 #if defined(ALLOW_DISCARD)
249  wxWindow *focus;
250  int value = mLevels->GetValue();
251 
252  if (value > mSelected) {
253  value = mSelected;
254  }
255 
256  if (value == 0) {
257  value = 1;
258  }
259 
260  mLevels->SetValue(value);
261  mLevels->SetRange(1, mSelected);
262 
263  mAvail->SetValue(wxString::Format(wxT("%d"), mSelected));
264 
265  focus = FindFocus();
266  if ((focus == mDiscard || focus == mLevels) && mSelected == 0) {
267  mList->SetFocus();
268  }
269 
270  mLevels->Enable(mSelected > 0);
271  mDiscard->Enable(!mAudioIOBusy && mSelected > 0);
272 #endif
273 }
274 
275 void HistoryDialog::OnDiscard(wxCommandEvent & WXUNUSED(event))
276 {
277  int i = mLevels->GetValue();
278 
279  mSelected -= i;
280  mManager->RemoveStates(0, i);
282 
283  while(--i >= 0)
284  mList->DeleteItem(i);
285 
286  DoUpdate();
287 }
288 
289 void HistoryDialog::OnDiscardClipboard(wxCommandEvent & WXUNUSED(event))
290 {
291  Clipboard::Get().Clear();
292 }
293 
294 void HistoryDialog::OnCompact(wxCommandEvent & WXUNUSED(event))
295 {
296  auto &projectFileIO = ProjectFileIO::Get(*mProject);
297 
298  projectFileIO.ReopenProject();
299 
300  auto baseFile = wxFileName(projectFileIO.GetFileName());
301  auto walFile = wxFileName(projectFileIO.GetFileName() + wxT("-wal"));
302  auto before = baseFile.GetSize() + walFile.GetSize();
303 
304  projectFileIO.Compact({}, true);
305 
306  auto after = baseFile.GetSize() + walFile.GetSize();
307 
309  XO("Compacting actually freed %s of disk space.")
310  .Format(Internat::FormatSize((before - after).GetValue())),
311  XO("History"));
312 }
313 
314 void HistoryDialog::OnGetURL(wxCommandEvent & WXUNUSED(event))
315 {
316  HelpSystem::ShowHelp(this, wxT("Undo,_Redo_and_History"));
317 }
318 
319 void HistoryDialog::OnItemSelected(wxListEvent &event)
320 {
321  if (mAudioIOBusy) {
322  mList->SetItemState(mSelected,
323  wxLIST_STATE_FOCUSED | wxLIST_STATE_SELECTED,
324  wxLIST_STATE_FOCUSED | wxLIST_STATE_SELECTED);
325  return;
326  }
327 
328  int selected = event.GetIndex();
329  int i;
330 
331  for (i = 0; i < mList->GetItemCount(); i++) {
332  mList->SetItemImage(i, 0);
333  if (i > selected)
334  mList->SetItemTextColour(i, *wxLIGHT_GREY);
335  else
336  mList->SetItemTextColour(i, mList->GetTextColour());
337  }
338  mList->SetItemImage(selected, 1);
339 
340  // Do not do a SetStateTo() if we're not actually changing the selected
341  // entry. Doing so can cause unnecessary delays upon initial load or while
342  // clicking the same entry over and over.
343  if (selected != mSelected) {
344  ProjectHistory::Get( *mProject ).SetStateTo(selected);
345  }
346  mSelected = selected;
347 
348  UpdateLevels();
349 }
350 
351 void HistoryDialog::OnListKeyDown(wxKeyEvent & event)
352 {
353  switch (event.GetKeyCode())
354  {
355  case WXK_RETURN:
356  // Don't know why wxListCtrls prevent default dialog action,
357  // but they do, so handle it.
358  EmulateButtonClickIfPresent(GetAffirmativeId());
359  break;
360 
361  default:
362  event.Skip();
363  break;
364  }
365 }
366 
367 void HistoryDialog::OnCloseWindow(wxCloseEvent & WXUNUSED(event))
368 {
369  this->Show(false);
370 }
371 
372 void HistoryDialog::OnShow(wxShowEvent & event)
373 {
374  if (event.IsShown())
375  {
376  mList->SetFocus();
377  }
378 }
379 
380 void HistoryDialog::OnSize(wxSizeEvent & WXUNUSED(event))
381 {
382  Layout();
383  mList->SetColumnWidth(0, mList->GetClientSize().x - mList->GetColumnWidth(1));
384  if (mList->GetItemCount() > 0)
385  mList->EnsureVisible(mSelected);
386 }
387 
388 // PrefsListener implementation
390 {
391  bool shown = IsShown();
392  if (shown) {
393  Show(false);
394  }
395 
396  SetSizer(nullptr);
397  DestroyChildren();
398 
400  ShuttleGui S(this, eIsCreating);
401  Populate(S);
402 
403  if (shown) {
404  Show(true);
405  }
406 }
407 
408 // Remaining code hooks this add-on into the application
409 #include "commands/CommandContext.h"
410 #include "commands/CommandManager.h"
411 
412 namespace {
413 
414 // History window attached to each project is built on demand by:
416  []( AudacityProject &parent ) -> wxWeakRef< wxWindow > {
417  auto &undoManager = UndoManager::Get( parent );
418  return safenew HistoryDialog( &parent, &undoManager );
419  }
420 };
421 
422 // Define our extra menu item that invokes that factory
424  void OnHistory(const CommandContext &context)
425  {
426  auto &project = context.project;
427 
428  auto historyWindow = &project.AttachedWindows::Get( sHistoryWindowKey );
429  historyWindow->Show();
430  historyWindow->Raise();
431  }
432 };
433 
435  // Handler is not stateful. Doesn't need a factory registered with
436  // AudacityProject.
437  static Handler instance;
438  return instance;
439 }
440 
441 // Register that menu item
442 
443 using namespace MenuTable;
444 AttachedItem sAttachment{ wxT("View/Windows"),
445  // History window should be available either for UndoAvailableFlag
446  // or RedoAvailableFlag,
447  // but we can't make the AddItem flags and mask have both,
448  // because they'd both have to be true for the
449  // command to be enabled.
450  // If user has Undone the entire stack, RedoAvailableFlag is on
451  // but UndoAvailableFlag is off.
452  // If user has done things but not Undone anything,
453  // RedoAvailableFlag is off but UndoAvailableFlag is on.
454  // So in either of those cases,
455  // (AudioIONotBusyFlag | UndoAvailableFlag | RedoAvailableFlag) mask
456  // would fail.
457  // The only way to fix this in the current architecture
458  // is to hack in special cases for RedoAvailableFlag
459  // in AudacityProject::UpdateMenus() (ugly)
460  // and CommandManager::HandleCommandEntry() (*really* ugly --
461  // shouldn't know about particular command names and flags).
462  // Here's the hack that would be necessary in
463  // AudacityProject::UpdateMenus(), if somebody decides to do it:
464  // // Because EnableUsingFlags requires all the flag bits match the
465  // // corresponding mask bits,
466  // // "UndoHistory" specifies only
467  // // AudioIONotBusyFlag | UndoAvailableFlag, because that
468  // // covers the majority of cases where it should be enabled.
469  // // If history is not empty but we've Undone the whole stack,
470  // // we also want to enable,
471  // // to show the Redo's on stack.
472  // // "UndoHistory" might already be enabled,
473  // // but add this check for RedoAvailableFlag.
474  // if (flags & RedoAvailableFlag)
475  // GetCommandManager()->Enable(wxT("UndoHistory"), true);
476  // So for now, enable the command regardless of stack.
477  // It will just show empty sometimes.
478  // FOR REDESIGN,
479  // clearly there are some limitations with the flags/mask bitmaps.
480 
482  /* i18n-hint: Clicking this menu item shows the various editing steps
483  that have been taken.*/
484  Command( wxT("UndoHistory"), XXO("&History..."), &Handler::OnHistory,
485  AudioIONotBusyFlag() ) )
486 };
487 
488 }
EVT_BUTTON
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
TranslatableString
Definition: Types.h:290
eIsCreating
@ eIsCreating
Definition: ShuttleGui.h:36
ShuttleGuiBase::StartVerticalLay
void StartVerticalLay(int iProp=1)
Definition: ShuttleGui.cpp:1177
HistoryDialog
Works with UndoManager to allow user to see descriptions of and undo previous commands....
Definition: HistoryWindow.h:28
HistoryDialog::OnDiscard
void OnDiscard(wxCommandEvent &event)
Definition: HistoryWindow.cpp:275
ProjectFileIO.h
anonymous_namespace{HistoryWindow.cpp}::findCommandHandler
CommandHandlerObject & findCommandHandler(AudacityProject &)
Definition: HistoryWindow.cpp:434
HelpSystem.h
MenuTable::FinderScope
Definition: CommandManager.h:465
UndoManager::CalculateSpaceUsage
void CalculateSpaceUsage()
Definition: UndoManager.cpp:94
AudacityMessageBox
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption=AudacityMessageBoxCaptionStr(), long style=wxOK|wxCENTRE, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
Definition: AudacityMessageBox.h:20
HistoryDialog::mSelected
int mSelected
Definition: HistoryWindow.h:67
Project.h
EVT_LIST_ITEM_SELECTED
EVT_LIST_ITEM_SELECTED(CurvesListID, EditCurvesDialog::OnListSelectionChange) EVT_LIST_ITEM_DESELECTED(CurvesListID
Constructor.
AudioIONotBusyFlag
const ReservedCommandFlag & AudioIONotBusyFlag()
Definition: CommonCommandFlags.cpp:127
Clipboard.h
Format
Abstract base class used in importing a file.
Clipboard::Clear
void Clear()
Definition: Clipboard.cpp:41
CommandManager.h
ShuttleGui::MinSize
ShuttleGui & MinSize()
Definition: ShuttleGui.h:740
XO
#define XO(s)
Definition: Internat.h:32
ProjectFileIO::Get
static ProjectFileIO & Get(AudacityProject &project)
Definition: ProjectFileIO.cpp:267
HistoryDialog::OnGetURL
void OnGetURL(wxCommandEvent &event)
Definition: HistoryWindow.cpp:314
HistoryDialog::mClipboard
wxTextCtrl * mClipboard
Definition: HistoryWindow.h:61
anonymous_namespace{HistoryWindow.cpp}::sAttachment
AttachedItem sAttachment
Definition: HistoryWindow.cpp:444
ShuttleGuiBase::EndMultiColumn
void EndMultiColumn()
Definition: ShuttleGui.cpp:1212
MenuTable::AttachedItem
Definition: CommandManager.h:688
ID_FILESIZE
@ ID_FILESIZE
Definition: HistoryWindow.cpp:51
HistoryDialog::OnItemSelected
void OnItemSelected(wxListEvent &event)
Definition: HistoryWindow.cpp:319
ClientData::Site::RegisteredFactory
Client code makes static instance from a factory of attachments; passes it to Get or Find as a retrie...
Definition: ClientData.h:266
desc
const TranslatableString desc
Definition: ExportPCM.cpp:56
anonymous_namespace{HistoryWindow.cpp}::Handler
Definition: HistoryWindow.cpp:423
ShuttleGui::Id
ShuttleGui & Id(int id)
Definition: ShuttleGui.cpp:2248
HistoryDialog::mAvail
wxTextCtrl * mAvail
Definition: HistoryWindow.h:62
HistoryDialog::HistoryDialog
HistoryDialog(AudacityProject *parent, UndoManager *manager)
Definition: HistoryWindow.cpp:72
HistoryDialog::mLevels
wxSpinCtrl * mLevels
Definition: HistoryWindow.h:63
HistoryDialog::OnCompact
void OnCompact(wxCommandEvent &event)
Definition: HistoryWindow.cpp:294
ShuttleGui::Style
ShuttleGui & Style(long iStyle)
Definition: ShuttleGui.h:734
HistoryDialog::OnCloseWindow
void OnCloseWindow(wxCloseEvent &event)
Definition: HistoryWindow.cpp:367
eOkButton
@ eOkButton
Definition: ShuttleGui.h:607
CommandContext.h
XXO
#define XXO(s)
Definition: Internat.h:45
ID_DISCARD_CLIPBOARD
@ ID_DISCARD_CLIPBOARD
Definition: HistoryWindow.cpp:55
CommandContext
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
Definition: CommandContext.h:22
anonymous_namespace{HistoryWindow.cpp}::Handler::OnHistory
void OnHistory(const CommandContext &context)
Definition: HistoryWindow.cpp:424
ShuttleGuiBase::AddTextBox
wxTextCtrl * AddTextBox(const TranslatableString &Caption, const wxString &Value, const int nChars)
Definition: ShuttleGui.cpp:631
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1203
ShuttleGuiBase::EndVerticalLay
void EndVerticalLay()
Definition: ShuttleGui.cpp:1196
eHelpButton
@ eHelpButton
Definition: ShuttleGui.h:611
FindProjectFrame
wxFrame * FindProjectFrame(AudacityProject *project)
Get a pointer to the window associated with a project, or null if the given pointer is null.
Definition: Project.h:172
Internat::FormatSize
static TranslatableString FormatSize(wxLongLong size)
Convert a number to a string while formatting it in bytes, KB, MB, GB.
Definition: Internat.cpp:208
HistoryDialog::mManager
UndoManager * mManager
Definition: HistoryWindow.h:58
ShuttleGuiBase::GetParent
wxWindow * GetParent()
Definition: ShuttleGui.h:503
HistoryDialog::mAudioIOBusy
bool mAudioIOBusy
Definition: HistoryWindow.h:68
UndoManager.h
ID_AVAIL
@ ID_AVAIL
Definition: HistoryWindow.cpp:50
HistoryDialog::mDiscard
wxButton * mDiscard
Definition: HistoryWindow.h:64
UndoManager::GetLongDescription
wxLongLong_t GetLongDescription(unsigned int n, TranslatableString *desc, TranslatableString *size)
Definition: UndoManager.cpp:131
HistoryDialog::mList
wxListCtrl * mList
Definition: HistoryWindow.h:59
HistoryDialog::mTotal
wxTextCtrl * mTotal
Definition: HistoryWindow.h:60
HistoryTitle
#define HistoryTitle
Definition: HistoryWindow.cpp:70
ShuttleGui.h
HistoryDialog::OnDiscardClipboard
void OnDiscardClipboard(wxCommandEvent &event)
Definition: HistoryWindow.cpp:289
ShuttleGuiBase::AddButton
wxButton * AddButton(const TranslatableString &Text, int PositionFlags=wxALIGN_CENTRE, bool setDefault=false)
Definition: ShuttleGui.cpp:353
ID_COMPACT
@ ID_COMPACT
Definition: HistoryWindow.cpp:56
ShuttleGuiBase::StartStatic
wxStaticBox * StartStatic(const TranslatableString &Str, int iProp=0)
Definition: ShuttleGui.cpp:886
wxDialogWrapper
Definition: wxPanelWrapper.h:81
Clipboard::Get
static Clipboard & Get()
Definition: Clipboard.cpp:29
UndoManager::GetClipboardSpaceUsage
wxLongLong_t GetClipboardSpaceUsage() const
Definition: UndoManager.h:202
ShuttleGuiBase::AddWindow
wxWindow * AddWindow(wxWindow *pWindow)
Definition: ShuttleGui.cpp:292
HelpSystem::ShowHelp
static void ShowHelp(wxWindow *parent, const wxString &localFileName, const wxString &remoteURL, bool bModal=false, bool alwaysDefaultBrowser=false)
Definition: HelpSystem.cpp:238
HistoryDialog::UpdateLevels
void UpdateLevels()
Definition: HistoryWindow.cpp:246
HistoryDialog::OnSize
void OnSize(wxSizeEvent &event)
Definition: HistoryWindow.cpp:380
HistoryDialog::UpdateDisplay
void UpdateDisplay(wxEvent &e)
Definition: HistoryWindow.cpp:197
anonymous_namespace{HistoryWindow.cpp}::sHistoryWindowKey
AudacityProject::AttachedWindows::RegisteredFactory sHistoryWindowKey
Definition: HistoryWindow.cpp:415
_
#define _(s)
Definition: Internat.h:76
UndoManager::Get
static UndoManager & Get(AudacityProject &project)
Definition: UndoManager.cpp:57
MenuTable::Command
std::unique_ptr< CommandItem > Command(const CommandID &name, const TranslatableString &label_in, void(Handler::*pmf)(const CommandContext &), CommandFlag flags, const CommandManager::Options &options={}, CommandHandlerFinder finder=FinderScope::DefaultFinder())
Definition: CommandManager.h:655
AudioIO.h
ShuttleGui::ConnectRoot
auto ConnectRoot(wxEventTypeTag< Tag > eventType, void(Handler::*func)(Argument &)) -> typename std::enable_if< std::is_base_of< Argument, Tag >::value, ShuttleGui & >::type
Definition: ShuttleGui.h:706
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:112
AudacityMessageBox.h
HistoryDialog::UpdatePrefs
void UpdatePrefs() override
Definition: HistoryWindow.cpp:389
HistoryDialog::OnShow
void OnShow(wxShowEvent &event)
Definition: HistoryWindow.cpp:372
CommandHandlerObject
wxEvtHandler CommandHandlerObject
Definition: CommandFunctors.h:28
ProjectHistory.h
HistoryDialog::OnAudioIO
void OnAudioIO(wxCommandEvent &evt)
Definition: HistoryWindow.cpp:182
ID_DISCARD
@ ID_DISCARD
Definition: HistoryWindow.cpp:54
wxDialogWrapper::SetTitle
void SetTitle(const TranslatableString &title)
Definition: wxPanelWrapper.cpp:66
ShuttleGui::AddStandardButtons
void AddStandardButtons(long buttons=eOkButton|eCancelButton, wxWindow *extra=NULL)
Definition: ShuttleGui.cpp:2406
UndoManager::GetCurrentState
unsigned int GetCurrentState()
Definition: UndoManager.cpp:265
HistoryDialog::Populate
void Populate(ShuttleGui &S)
Definition: HistoryWindow.cpp:106
HistoryDialog::DoUpdate
void DoUpdate()
Definition: HistoryWindow.cpp:211
HistoryWindow.h
ShuttleGuiBase::AddPrompt
void AddPrompt(const TranslatableString &Prompt, int wrapWidth=0)
Right aligned text string.
Definition: ShuttleGui.cpp:231
TranslatableString::Translation
wxString Translation() const
Definition: Types.h:337
ShuttleGuiBase::SetBorder
void SetBorder(int Border)
Definition: ShuttleGui.h:497
MenuTable
Definition: CommandManager.h:396
wxDialogWrapper::SetName
void SetName()
Definition: wxPanelWrapper.cpp:81
ID_TOTAL
@ ID_TOTAL
Definition: HistoryWindow.cpp:52
ShuttleGuiBase::AddVariableText
wxStaticText * AddVariableText(const TranslatableString &Str, bool bCenter=false, int PositionFlags=0, int wrapWidth=0)
Definition: ShuttleGui.cpp:456
ShuttleGuiBase::EndStatic
void EndStatic()
Definition: ShuttleGui.cpp:915
safenew
#define safenew
Definition: MemoryX.h:8
UndoManager
Maintain a non-persistent list of states of the project, to support undo and redo commands.
Definition: UndoManager.h:137
HistoryDialog::OnListKeyDown
void OnListKeyDown(wxKeyEvent &event)
Definition: HistoryWindow.cpp:351
CommonCommandFlags.h
HistoryDialog::mProject
AudacityProject * mProject
Definition: HistoryWindow.h:57
CommandContext::project
AudacityProject & project
Definition: CommandContext.h:52
END_EVENT_TABLE
END_EVENT_TABLE()
HistoryDialog::mCompact
wxButton * mCompact
Definition: HistoryWindow.h:65
UndoManager::RemoveStates
void RemoveStates(size_t begin, size_t end)
Definition: UndoManager.cpp:207
ProjectHistory::Get
static ProjectHistory & Get(AudacityProject &project)
Definition: ProjectHistory.cpp:26
HistoryDialog::Show
bool Show(bool show=true) override
Definition: HistoryWindow.cpp:204
ID_LEVELS
@ ID_LEVELS
Definition: HistoryWindow.cpp:53
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:638
ProjectHistory::SetStateTo
void SetStateTo(unsigned int n, bool doAutosave=true)
Definition: ProjectHistory.cpp:169
UndoManager::GetNumStates
unsigned int GetNumStates()
Definition: UndoManager.cpp:260