1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-09 05:01:57 +01:00

Gale suggested showing current key shortcuts for toolbar controls tooltips. This implements it for ControlToolBar (aka Transport toolbar).

One tricky aspect was that until GetActiveProject() is ready to return non-NULL,  ControlToolBar::RegenerateToolsTooltips() cannot get the project's CommandManager, so cannot get the shortcuts. Changed ControlToolBar::RegenerateToolsTooltips() to be public and now call it late in wAudacityProject(). When called before the project is completely instantiated, in the rewritten ControlToolBar::RegenerateToolsTooltips(), it just sets the tooltips to the names without the keys, pretty much as now -- but I don't think users will ever see that because of the subsequent call. 

Anyway, did it in a more programmatic way than the previous code, which reduces string literals duplication.

Btw, I changed the start value for the ID_PLAY_BUTTON because the former value of 0 causes FindWindow() to return the toolbar rather than the button -- wxWidgets bug. 

Also got rid of some cruft and applied a few WXUNUSED.
This commit is contained in:
v.audacity
2013-07-23 22:07:56 +00:00
parent 019ec26ddf
commit b8128af0c5
4 changed files with 55 additions and 43 deletions

View File

@@ -497,6 +497,10 @@ AudacityProject *CreateNewAudacityProject()
//Set the new project as active:
SetActiveProject(p);
// Okay, GetActiveProject() is ready. Now we can get its CommandManager,
// and add the shortcut keys to the tooltips.
p->GetControlToolBar()->RegenerateToolsTooltips();
ModuleManager::Dispatch(ProjectInitialized);
p->Show(true);