Audacity 3.2.0
Classes | Functions | Variables
anonymous_namespace{HelpMenus.cpp} Namespace Reference

Classes

class  QuickFixDialog
 Class which makes a dialog for displaying quick fixes to common issues. More...
 

Functions

 END_EVENT_TABLE ()
 
void OnQuickFix (const CommandContext &context)
 
void OnQuickHelp (const CommandContext &context)
 
void OnManual (const CommandContext &context)
 
void OnAudioDeviceInfo (const CommandContext &context)
 
void OnShowLog (const CommandContext &context)
 
void OnMenuTree (const CommandContext &context)
 
void OnFrameStatistics (const CommandContext &)
 
void OnAbout (const CommandContext &context)
 
auto HelpMenu ()
 

Variables

AttachedItem sAttachment1 { Indirect(HelpMenu()) }
 

Function Documentation

◆ END_EVENT_TABLE()

anonymous_namespace{HelpMenus.cpp}::END_EVENT_TABLE ( )

◆ HelpMenu()

auto anonymous_namespace{HelpMenus.cpp}::HelpMenu ( )

Definition at line 412 of file HelpMenus.cpp.

413{
414 static auto menu = std::shared_ptr{
415 Menu( wxT("Help"), XXO("&Help"),
416 Section( "Basic",
417 Command( wxT("QuickHelp"), XXO("&Quick Help..."), OnQuickHelp,
419 Command( wxT("Manual"), XXO("&Manual..."), OnManual,
421 ),
422
423 #ifdef __WXMAC__
424 Items
425 #else
426 Section
427 #endif
428 ( "Other",
429 Menu( wxT("Diagnostics"), XXO("&Diagnostics"),
430 Command( wxT("DeviceInfo"), XXO("Au&dio Device Info..."),
433 Command( wxT("Log"), XXO("Show &Log..."), OnShowLog,
435 #if defined(HAS_CRASH_REPORT)
436 Command( wxT("CrashReport"), XXO("&Generate Support Data..."),
437 OnCrashReport, AlwaysEnabledFlag )
438 #endif
439
440 #ifdef IS_ALPHA
441 ,
442 // alpha-only items don't need to internationalize, so use
443 // Verbatim for labels
444
445 Command( wxT("RaiseSegfault"), Verbatim("Test segfault report"),
446 OnSegfault, AlwaysEnabledFlag ),
447
448 Command( wxT("ThrowException"), Verbatim("Test exception report"),
449 OnException, AlwaysEnabledFlag ),
450
451 Command( wxT("ViolateAssertion"), Verbatim("Test assertion report"),
452 OnAssertion, AlwaysEnabledFlag ),
453
454 // Menu explorer. Perhaps this should become a macro command
455 Command( wxT("MenuTree"), Verbatim("Menu Tree..."),
458
459 Command(
460 wxT("FrameStatistics"), Verbatim("Frame Statistics..."),
463 #endif
464 )
465 ),
466
467 Section( "Extra",
468 #if defined(HAVE_UPDATES_CHECK)
469 Command( wxT("Updates"), XXO("&Check for Updates..."),
470 OnCheckForUpdates,
472 #endif
473 Command( wxT("About"), XXO("&About Audacity"), OnAbout,
475 )
476 ) };
477 return menu;
478}
wxT("CloseDown"))
constexpr CommandFlag AlwaysEnabledFlag
Definition: CommandFlag.h:34
const ReservedCommandFlag & AudioIONotBusyFlag()
XXO("&Cut/Copy/Paste Toolbar")
TranslatableString Verbatim(wxString str)
Require calls to the one-argument constructor to go through this distinct global function name.
constexpr auto Section
Definition: MenuRegistry.h:436
constexpr auto Items
Definition: MenuRegistry.h:427
constexpr auto Command
Definition: MenuRegistry.h:456
constexpr auto Menu
Items will appear in a main toolbar menu or in a sub-menu.
Definition: MenuRegistry.h:445
void OnMenuTree(const CommandContext &context)
Definition: HelpMenus.cpp:320
void OnAudioDeviceInfo(const CommandContext &context)
Definition: HelpMenus.cpp:269
void OnQuickHelp(const CommandContext &context)
Definition: HelpMenus.cpp:253
void OnShowLog(const CommandContext &context)
Definition: HelpMenus.cpp:278
void OnFrameStatistics(const CommandContext &)
Definition: HelpMenus.cpp:366
void OnAbout(const CommandContext &context)
Definition: HelpMenus.cpp:378
void OnManual(const CommandContext &context)
Definition: HelpMenus.cpp:261

References AlwaysEnabledFlag, AudioIONotBusyFlag(), MenuRegistry::Command, MenuRegistry::Items, MenuRegistry::Menu, OnAbout(), OnAudioDeviceInfo(), OnFrameStatistics(), OnManual(), OnMenuTree(), OnQuickHelp(), OnShowLog(), MenuRegistry::Section, Verbatim(), wxT(), and XXO().

Here is the call graph for this function:

◆ OnAbout()

void anonymous_namespace{HelpMenus.cpp}::OnAbout ( const CommandContext context)

Definition at line 378 of file HelpMenus.cpp.

379{
380#ifdef __WXMAC__
381 // Modeless dialog, consistent with other Mac applications
382 // Simulate the application Exit menu item
383 wxCommandEvent evt{ wxEVT_MENU, wxID_ABOUT };
384 wxTheApp->AddPendingEvent( evt );
385#else
386 auto &project = context.project;
387 auto &window = GetProjectFrame( project );
388
389 // Windows and Linux still modal.
390 AboutDialog dlog( &window );
391 dlog.ShowModal();
392#endif
393}
AUDACITY_DLL_API wxFrame & GetProjectFrame(AudacityProject &project)
Get the top-level window associated with the project (as a wxFrame only, when you do not need to use ...
const auto project
The AboutDialog shows the program version and developer credits.
Definition: AboutDialog.h:32
AudacityProject & project

References GetProjectFrame(), CommandContext::project, and project.

Referenced by HelpMenu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnAudioDeviceInfo()

void anonymous_namespace{HelpMenus.cpp}::OnAudioDeviceInfo ( const CommandContext context)

Definition at line 269 of file HelpMenus.cpp.

270{
271 auto &project = context.project;
272 auto gAudioIO = AudioIOBase::Get();
273 wxString info = gAudioIO->GetDeviceInfo();
275 XO("Audio Device Info"), wxT("deviceinfo.txt") );
276}
XO("Cut/Copy/Paste")
void ShowDiagnostics(AudacityProject &project, const wxString &info, const TranslatableString &description, const wxString &defaultPath, bool fixedWidth)
static AudioIOBase * Get()
Definition: AudioIOBase.cpp:94

References AudioIOBase::Get(), CommandContext::project, project, ShowDiagnostics(), wxT(), and XO().

Referenced by HelpMenu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnFrameStatistics()

void anonymous_namespace{HelpMenus.cpp}::OnFrameStatistics ( const CommandContext )

Definition at line 366 of file HelpMenus.cpp.

367{
369}
static void Show(bool show)
Shows the dialog.

References FrameStatisticsDialog::Show().

Referenced by HelpMenu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnManual()

void anonymous_namespace{HelpMenus.cpp}::OnManual ( const CommandContext context)

Definition at line 261 of file HelpMenus.cpp.

262{
263 auto &project = context.project;
266 L"Main_Page");
267}
static void ShowHelp(wxWindow *parent, const FilePath &localFileName, const URLString &remoteURL, bool bModal=false, bool alwaysDefaultBrowser=false)
Definition: HelpSystem.cpp:231

References GetProjectFrame(), CommandContext::project, project, and HelpSystem::ShowHelp().

Referenced by HelpMenu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnMenuTree()

void anonymous_namespace{HelpMenus.cpp}::OnMenuTree ( const CommandContext context)

Definition at line 320 of file HelpMenus.cpp.

321{
322 auto &project = context.project;
323 enum : unsigned { TAB = 3 };
324
325 unsigned level{};
326 wxString indentation;
327 wxString info;
328 auto Indent = [&](){ info += indentation; };
329 auto Return = [&](){ info += '\n'; };
330
331 using namespace MenuRegistry;
332 auto visitor = Visitor<Traits>{
333 std::tuple{
334 [&](const MenuItem &item, const auto&) {
335 Indent();
336 // using GET for alpha only diagnostic tool
337 info += item.name.GET();
338 Return();
339 indentation = wxString{ ' ', TAB * ++level };
340 },
341
342 [&](const SingleItem &item, const auto&) {
343 // using GET for alpha only diagnostic tool
344 Indent();
345 info += item.name.GET();
346 Return();
347 },
348
349 [&](const MenuItem &item, const auto&) {
350 indentation = wxString{ ' ', TAB * --level };
351 }
352 },
353 [&]() {
354 static const wxString separatorName{ '=', 20 };
355 Indent();
356 info += separatorName;
357 Return();
358 }
359 };
361
363 Verbatim("Menu Tree"), wxT("menutree.txt"), true );
364}
const wxString & GET() const
Explicit conversion to wxString, meant to be ugly-looking and demanding of a comment why it's correct...
Definition: Identifier.h:66
MENUS_API void Visit(Visitor< Traits > &visitor, AudacityProject &project)
Common abstract base class for items that are not groups.
Definition: Registry.h:224
const Identifier name
Definition: Registry.h:86

References CommandContext::project, project, ShowDiagnostics(), Verbatim(), MenuRegistry::Visit(), and wxT().

Referenced by HelpMenu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnQuickFix()

void anonymous_namespace{HelpMenus.cpp}::OnQuickFix ( const CommandContext context)

Definition at line 246 of file HelpMenus.cpp.

247{
248 auto &project = context.project;
250 dlg.ShowModal();
251}
Class which makes a dialog for displaying quick fixes to common issues.
Definition: HelpMenus.cpp:48

References GetProjectFrame(), CommandContext::project, and project.

Here is the call graph for this function:

◆ OnQuickHelp()

void anonymous_namespace{HelpMenus.cpp}::OnQuickHelp ( const CommandContext context)

Definition at line 253 of file HelpMenus.cpp.

254{
255 auto &project = context.project;
258 L"Quick_Help");
259}

References GetProjectFrame(), CommandContext::project, project, and HelpSystem::ShowHelp().

Referenced by HelpMenu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnShowLog()

void anonymous_namespace{HelpMenus.cpp}::OnShowLog ( const CommandContext context)

Definition at line 278 of file HelpMenus.cpp.

279{
281}
static void Show(bool show=true)
Show or hide the unique logging window; create it on demand the first time it is shown.
Definition: LogWindow.cpp:61

References LogWindow::Show().

Referenced by HelpMenu().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ sAttachment1

AttachedItem anonymous_namespace{HelpMenus.cpp}::sAttachment1 { Indirect(HelpMenu()) }

Definition at line 480 of file HelpMenus.cpp.