Audacity  3.0.3
Public Member Functions | Private Member Functions | List of all members
ApplicationPrefs Class Referencefinal

A PrefsPanel to enable/disable certain general application options like checking updates, etc. More...

#include <ApplicationPrefs.h>

Inheritance diagram for ApplicationPrefs:
Collaboration diagram for ApplicationPrefs:

Public Member Functions

 ApplicationPrefs (wxWindow *parent, wxWindowID winid)
 ~ApplicationPrefs ()
ComponentInterfaceSymbol GetSymbol () override
TranslatableString GetDescription () override
bool Commit () override
ManualPageID HelpPageName () override
 If not empty string, the Help button is added below the panel. More...
- Public Member Functions inherited from PrefsPanel
 PrefsPanel (wxWindow *parent, wxWindowID winid, const TranslatableString &title)
virtual ~PrefsPanel ()
virtual void Preview ()
virtual PluginPath GetPath ()
virtual VendorSymbol GetVendor ()
virtual wxString GetVersion ()
virtual bool ShowsPreviewButton ()
virtual void PopulateOrExchange (ShuttleGui &WXUNUSED(S))
virtual void Cancel ()
- Public Member Functions inherited from wxPanelWrapper
 wxPanelWrapper ()
 wxPanelWrapper (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel"))
bool Create (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel"))
void SetLabel (const TranslatableString &label)
void SetName (const TranslatableString &name)
void SetToolTip (const TranslatableString &toolTip)
void SetName ()
- Public Member Functions inherited from wxTabTraversalWrapper< wxPanel >
 wxTabTraversalWrapper (Args &&... args)
 wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete
 wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete

Private Member Functions

void Populate ()
void PopulateOrExchange (ShuttleGui &S) override

Additional Inherited Members

- Public Types inherited from PrefsPanel
using Factories = std::vector< PrefsPanel::PrefsNode >
using Factory = std::function< PrefsPanel *(wxWindow *parent, wxWindowID winid, AudacityProject *) >
- Static Public Member Functions inherited from PrefsPanel
static FactoriesDefaultFactories ()

Detailed Description

A PrefsPanel to enable/disable certain general application options like checking updates, etc.

Definition at line 21 of file ApplicationPrefs.h.

Constructor & Destructor Documentation

◆ ApplicationPrefs()

ApplicationPrefs::ApplicationPrefs ( wxWindow *  parent,
wxWindowID  winid 

Definition at line 33 of file ApplicationPrefs.cpp.

34 : PrefsPanel(parent, winid, XO("Application"))
35 {
36  Populate();
37 }

References Populate().

Here is the call graph for this function:

◆ ~ApplicationPrefs()

ApplicationPrefs::~ApplicationPrefs ( )

Definition at line 39 of file ApplicationPrefs.cpp.

40 {
41 }

Member Function Documentation

◆ Commit()

bool ApplicationPrefs::Commit ( )

Implements PrefsPanel.

Definition at line 106 of file ApplicationPrefs.cpp.

107 {
108  ShuttleGui S(this, eIsSavingToPrefs);
111  return true;
112 }

References eIsSavingToPrefs, and PopulateOrExchange().

Here is the call graph for this function:

◆ GetDescription()

TranslatableString ApplicationPrefs::GetDescription ( )

Implements ComponentInterface.

Definition at line 48 of file ApplicationPrefs.cpp.

49 {
50  return XO("Preferences for Application");
51 }

References XO.

◆ GetSymbol()

ComponentInterfaceSymbol ApplicationPrefs::GetSymbol ( )

Implements ComponentInterface.

Definition at line 43 of file ApplicationPrefs.cpp.

44 {
46 }

References s_ComponentInterfaceSymbol.

◆ HelpPageName()

ManualPageID ApplicationPrefs::HelpPageName ( )

If not empty string, the Help button is added below the panel.

Default returns empty string.

Reimplemented from PrefsPanel.

Definition at line 53 of file ApplicationPrefs.cpp.

54 {
55  return "Application_Preferences";
56 }

◆ Populate()

void ApplicationPrefs::Populate ( )

Definition at line 58 of file ApplicationPrefs.cpp.

59 {
60  //------------------------- Main section --------------------
61  // Now construct the GUI itself.
62  // Use 'eIsCreatingFromPrefs' so that the GUI is
63  // initialised with values from gPrefs.
66  // ----------------------- End of main section --------------
67 }

References eIsCreatingFromPrefs, and PopulateOrExchange().

Referenced by ApplicationPrefs().

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

◆ PopulateOrExchange()

void ApplicationPrefs::PopulateOrExchange ( ShuttleGui S)

Definition at line 69 of file ApplicationPrefs.cpp.

70 {
71  S.SetBorder(2);
72  S.StartScroller();
74  /* i18n-hint: Title for the update notifications panel in the preferences dialog. */
75  S.StartStatic(XO("Update notifications"));
76  {
77  S.TieCheckBox(
78  /* i18n-hint: Check-box title that configures periodic updates checking. */
79  XXC("&Check for updates", "application preferences"),
82  S.StartVerticalLay();
83  {
84  S.AddFixedText(XO(
85  "App update checking requires network access. In order to protect your privacy, Audacity does not store any personal information."),
86  false, 470);
88  /* i18n-hint: %s will be replaced with "our Privacy Policy" */
89  AccessibleLinksFormatter privacyPolicy(XO("See %s for more info."));
91  privacyPolicy.FormatLink(
92  /* i18n-hint: Title of hyperlink to the privacy policy. This is an object of "See". */
93  wxT("%s"), XO("our Privacy Policy"),
94  "");
96  privacyPolicy.Populate(S);
97  }
99  S.EndVerticalLay();
100  }
102  S.EndStatic();
103  S.EndScroller();
104 }

References ShuttleGuiBase::AddFixedText(), DefaultUpdatesCheckingFlag, ShuttleGuiBase::EndScroller(), ShuttleGuiBase::EndStatic(), ShuttleGuiBase::EndVerticalLay(), AccessibleLinksFormatter::FormatLink(), AccessibleLinksFormatter::Populate(), ShuttleGuiBase::SetBorder(), ShuttleGuiBase::StartScroller(), ShuttleGuiBase::StartStatic(), ShuttleGuiBase::StartVerticalLay(), ShuttleGuiBase::TieCheckBox(), XO, and XXC.

Referenced by Commit(), and Populate().

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

The documentation for this class was generated from the following files:
void StartVerticalLay(int iProp=1)
Definition: ShuttleGui.cpp:1184
wxCheckBox * TieCheckBox(const TranslatableString &Prompt, bool &Var)
Definition: ShuttleGui.cpp:1629
#define XO(s)
Definition: Internat.h:31
void PopulateOrExchange(ShuttleGui &S) override
Definition: ApplicationPrefs.cpp:69
void EndScroller()
Definition: ShuttleGui.cpp:971
BoolSetting DefaultUpdatesCheckingFlag
Definition: Prefs.cpp:65
wxScrolledWindow * StartScroller(int iStyle=0)
Definition: ShuttleGui.cpp:938
void EndVerticalLay()
Definition: ShuttleGui.cpp:1203
void AddFixedText(const TranslatableString &Str, bool bCenter=false, int wrapWidth=0)
Definition: ShuttleGui.cpp:440
wxStaticBox * StartStatic(const TranslatableString &Str, int iProp=0)
Definition: ShuttleGui.cpp:893
@ eIsSavingToPrefs
Definition: ShuttleGui.h:48
static ComponentInterfaceSymbol s_ComponentInterfaceSymbol
Definition: ApplicationPrefs.cpp:31
#define XXC(s, c)
Definition: Internat.h:47
void Populate()
Definition: ApplicationPrefs.cpp:58
void SetBorder(int Border)
Definition: ShuttleGui.h:489
@ eIsCreatingFromPrefs
Definition: ShuttleGui.h:47
void EndStatic()
Definition: ShuttleGui.cpp:922
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631
PrefsPanel(wxWindow *parent, wxWindowID winid, const TranslatableString &title)
Definition: PrefsPanel.h:90