Audacity  3.0.3
ApplicationPrefs.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  ApplicationPrefs.cpp
6 
7  Anton Gerasimov
8 
9 
10 *******************************************************************//*******************************************************************/
16 
17 
18 #include "ApplicationPrefs.h"
19 #include "update/UpdateManager.h"
20 
21 #include <wx/defs.h>
22 #include <wx/hyperlink.h>
23 
24 #include "Prefs.h"
25 #include "../ShuttleGui.h"
26 
28 
30 
32 
33 ApplicationPrefs::ApplicationPrefs(wxWindow * parent, wxWindowID winid)
34 : PrefsPanel(parent, winid, XO("Application"))
35 {
36  Populate();
37 }
38 
40 {
41 }
42 
44 {
46 }
47 
49 {
50  return XO("Preferences for Application");
51 }
52 
54 {
55  return "Application_Preferences";
56 }
57 
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 }
68 
70 {
71  S.SetBorder(2);
72  S.StartScroller();
73 
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"),
81 
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);
87 
88  /* i18n-hint: %s will be replaced with "our Privacy Policy" */
89  AccessibleLinksFormatter privacyPolicy(XO("See %s for more info."));
90 
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  "https://www.audacityteam.org/about/desktop-privacy-notice/");
95 
96  privacyPolicy.Populate(S);
97  }
98 
99  S.EndVerticalLay();
100  }
101 
102  S.EndStatic();
103  S.EndScroller();
104 }
105 
107 {
108  ShuttleGui S(this, eIsSavingToPrefs);
110 
111  return true;
112 }
113 
114 namespace{
116  [](wxWindow *parent, wxWindowID winid, AudacityProject *)
117  {
118  wxASSERT(parent); // to justify safenew
119  return safenew ApplicationPrefs(parent, winid);
120  }
121 };
122 }
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
ShuttleGuiBase::StartVerticalLay
void StartVerticalLay(int iProp=1)
Definition: ShuttleGui.cpp:1184
ApplicationPrefs::GetDescription
TranslatableString GetDescription() override
Definition: ApplicationPrefs.cpp:48
ShuttleGuiBase::TieCheckBox
wxCheckBox * TieCheckBox(const TranslatableString &Prompt, bool &Var)
Definition: ShuttleGui.cpp:1629
ApplicationPrefs::Commit
bool Commit() override
Definition: ApplicationPrefs.cpp:106
UpdateManager.h
Declare a class that handles managing of updates.
anonymous_namespace{ApplicationPrefs.cpp}::sAttachment
PrefsPanel::Registration sAttachment
Definition: ApplicationPrefs.cpp:115
PrefsPanel::Registration
Definition: PrefsPanel.h:84
XO
#define XO(s)
Definition: Internat.h:31
ApplicationPrefs.h
ApplicationPrefs::ApplicationPrefs
ApplicationPrefs(wxWindow *parent, wxWindowID winid)
Definition: ApplicationPrefs.cpp:33
ApplicationPrefs::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S) override
Definition: ApplicationPrefs.cpp:69
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterfaceSymbol.h:27
ShuttleGuiBase::EndScroller
void EndScroller()
Definition: ShuttleGui.cpp:971
ApplicationPrefs::GetSymbol
ComponentInterfaceSymbol GetSymbol() override
Definition: ApplicationPrefs.cpp:43
ApplicationPrefs::HelpPageName
ManualPageID HelpPageName() override
If not empty string, the Help button is added below the panel.
Definition: ApplicationPrefs.cpp:53
DefaultUpdatesCheckingFlag
BoolSetting DefaultUpdatesCheckingFlag
Definition: Prefs.cpp:65
ApplicationPrefs
A PrefsPanel to enable/disable certain general application options like checking updates,...
Definition: ApplicationPrefs.h:22
ShuttleGuiBase::StartScroller
wxScrolledWindow * StartScroller(int iStyle=0)
Definition: ShuttleGui.cpp:938
ShuttleGuiBase::EndVerticalLay
void EndVerticalLay()
Definition: ShuttleGui.cpp:1203
ShuttleGuiBase::AddFixedText
void AddFixedText(const TranslatableString &Str, bool bCenter=false, int wrapWidth=0)
Definition: ShuttleGui.cpp:440
ShuttleGuiBase::StartStatic
wxStaticBox * StartStatic(const TranslatableString &Str, int iProp=0)
Definition: ShuttleGui.cpp:893
eIsSavingToPrefs
@ eIsSavingToPrefs
Definition: ShuttleGui.h:48
ApplicationPrefs::~ApplicationPrefs
~ApplicationPrefs()
Definition: ApplicationPrefs.cpp:39
TaggedIdentifier< ManualPageIDTag >
s_ComponentInterfaceSymbol
static ComponentInterfaceSymbol s_ComponentInterfaceSymbol
Definition: ApplicationPrefs.cpp:31
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:92
XXC
#define XXC(s, c)
Definition: Internat.h:47
ApplicationPrefs::Populate
void Populate()
Definition: ApplicationPrefs.cpp:58
PrefsPanel
Base class for a panel in the PrefsDialog. Classes derived from this class include BatchPrefs,...
Definition: PrefsPanel.h:51
Prefs.h
ShuttleGuiBase::SetBorder
void SetBorder(int Border)
Definition: ShuttleGui.h:489
eIsCreatingFromPrefs
@ eIsCreatingFromPrefs
Definition: ShuttleGui.h:47
ShuttleGuiBase::EndStatic
void EndStatic()
Definition: ShuttleGui.cpp:922
safenew
#define safenew
Definition: MemoryX.h:10
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631