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 418 of file HelpMenus.cpp.

419{
420 static auto menu = std::shared_ptr{
421 Menu( wxT("Help"), XXO("&Help"),
422 Section( "Basic",
423 Command( wxT("QuickHelp"), XXO("&Quick Help..."), OnQuickHelp,
425 Command( wxT("Manual"), XXO("&Manual..."), OnManual,
427 ),
428
429 #ifdef __WXMAC__
430 Items
431 #else
432 Section
433 #endif
434 ( "Other",
435 Menu( wxT("Diagnostics"), XXO("&Diagnostics"),
436 Command( wxT("DeviceInfo"), XXO("Au&dio Device Info..."),
439 Command( wxT("Log"), XXO("Show &Log..."), OnShowLog,
441 #if defined(HAS_CRASH_REPORT)
442 Command( wxT("CrashReport"), XXO("&Generate Support Data..."),
443 OnCrashReport, AlwaysEnabledFlag )
444 #endif
445
446 #ifdef IS_ALPHA
447 ,
448 // alpha-only items don't need to internationalize, so use
449 // Verbatim for labels
450
451 Command( wxT("RaiseSegfault"), Verbatim("Test segfault report"),
452 OnSegfault, AlwaysEnabledFlag ),
453
454 Command( wxT("ThrowException"), Verbatim("Test exception report"),
455 OnException, AlwaysEnabledFlag ),
456
457 Command( wxT("ViolateAssertion"), Verbatim("Test assertion report"),
458 OnAssertion, AlwaysEnabledFlag ),
459
460 // Menu explorer. Perhaps this should become a macro command
461 Command( wxT("MenuTree"), Verbatim("Menu Tree..."),
464
465 Command(
466 wxT("FrameStatistics"), Verbatim("Frame Statistics..."),
469 #endif
470 )
471 ),
472
473 Section( "Extra",
474 #if defined(HAVE_UPDATES_CHECK)
475 Command( wxT("Updates"), XXO("&Check for Updates..."),
476 OnCheckForUpdates,
478 #endif
479 Command( wxT("About"), XXO("&About Audacity"), OnAbout,
481 )
482 ) };
483 return menu;
484}
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:321
void OnAudioDeviceInfo(const CommandContext &context)
Definition: HelpMenus.cpp:270
void OnQuickHelp(const CommandContext &context)
Definition: HelpMenus.cpp:254
void OnShowLog(const CommandContext &context)
Definition: HelpMenus.cpp:279
void OnFrameStatistics(const CommandContext &)
Definition: HelpMenus.cpp:367
void OnAbout(const CommandContext &context)
Definition: HelpMenus.cpp:379
void OnManual(const CommandContext &context)
Definition: HelpMenus.cpp:262

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 379 of file HelpMenus.cpp.

380{
381#ifdef __WXMAC__
382 // Modeless dialog, consistent with other Mac applications
383 // Simulate the application Exit menu item
384 wxCommandEvent evt{ wxEVT_MENU, wxID_ABOUT };
385 wxTheApp->AddPendingEvent( evt );
386#else
387 auto &project = context.project;
388 auto &window = GetProjectFrame( project );
389
390 // Windows and Linux still modal.
391 AboutDialog dlog( &window );
392 dlog.ShowModal();
393#endif
394}
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 270 of file HelpMenus.cpp.

271{
272 auto &project = context.project;
273 auto gAudioIO = AudioIOBase::Get();
274 wxString info = gAudioIO->GetDeviceInfo();
276 XO("Audio Device Info"), wxT("deviceinfo.txt") );
277}
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 367 of file HelpMenus.cpp.

368{
370}
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 262 of file HelpMenus.cpp.

263{
264 auto &project = context.project;
267 L"Main_Page");
268}
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 321 of file HelpMenus.cpp.

322{
323 auto &project = context.project;
324 enum : unsigned { TAB = 3 };
325
326 unsigned level{};
327 wxString indentation;
328 wxString info;
329 auto Indent = [&](){ info += indentation; };
330 auto Return = [&](){ info += '\n'; };
331
332 using namespace MenuRegistry;
333 auto visitor = Visitor<Traits>{
334 std::tuple{
335 [&](const MenuItem &item, const auto&) {
336 Indent();
337 // using GET for alpha only diagnostic tool
338 info += item.name.GET();
339 Return();
340 indentation = wxString{ ' ', TAB * ++level };
341 },
342
343 [&](const SingleItem &item, const auto&) {
344 // using GET for alpha only diagnostic tool
345 Indent();
346 info += item.name.GET();
347 Return();
348 },
349
350 [&](const MenuItem &item, const auto&) {
351 indentation = wxString{ ' ', TAB * --level };
352 }
353 },
354 [&]() {
355 static const wxString separatorName{ '=', 20 };
356 Indent();
357 info += separatorName;
358 Return();
359 }
360 };
362
364 Verbatim("Menu Tree"), wxT("menutree.txt"), true );
365}
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 247 of file HelpMenus.cpp.

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

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 254 of file HelpMenus.cpp.

255{
256 auto &project = context.project;
259 L"Quick_Help");
260}

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 279 of file HelpMenus.cpp.

280{
282}
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 486 of file HelpMenus.cpp.