Audacity 3.2.0
UpdateNoticeDialog.cpp
Go to the documentation of this file.
1
2/*!********************************************************************
3
4 Audacity: A Digital Audio Editor
5
6 @file UpdateNoticeDialog.cpp
7 @brief Declare a dialog to notify the user about automatic update checking.
8
9 Dmitry Vedenko
10 **********************************************************************/
11
12#include "UpdateNoticeDialog.h"
13
14#include <wx/button.h>
15#include <wx/stattext.h>
16
17#include "ShuttleGui.h"
18#include "CodeConversions.h"
19#include "prefs/PrefsDialog.h"
21
22
23static const auto title =
24 /* i18n-hint: Title of the app update notice dialog. */
25 XO("App update checking");
26
27static const auto firstParagraph =
28 /* i18n-hint: The first paragraph of app update notice dialog. */
29 XO("To stay up to date, you will receive an in-app notification whenever there is a new version of Audacity available to download.");
30
31static const auto secondParagraph =
32 /* i18n-hint: The second paragraph of app update notice dialog */
33 XO("In order to protect your privacy, Audacity does not collect any personal information. However, app update checking does require network access.");
34
35static const auto thirdParagraph =
36 /* i18n-hint: Hint to the user about how to turn the app update off. %s is replaced with "Preferences > Application" link*/
37 XO("You can turn off app update checking at any time in %s.");
38
39
40BEGIN_EVENT_TABLE(UpdateNoticeDialog, wxDialogWrapper)
44
46
49 /* i18n-hint: Title of the app update notice dialog. */
50 parent, -1, XO("App updates"), wxDefaultPosition, wxDefaultSize,
51 wxCAPTION | wxCLOSE_BOX)
52{
54
55 S.StartVerticalLay();
56 {
57 S.AddSpace(0, 16);
58
59 S.StartHorizontalLay(wxEXPAND, 0);
60 {
61 S.AddSpace(24, 0);
62
63 S.StartPanel();
64 {
65 S.SetBorder(8);
66
67 wxStaticText* titleCtrl = S.AddVariableText(title, false, 0, 500);
68
69 wxFont font = titleCtrl->GetFont().MakeLarger().MakeBold();
70
71 titleCtrl->SetFont(font);
72
73 S.AddFixedText(firstParagraph, false, 500);
74
75 S.AddFixedText(secondParagraph, false, 500);
76
77 S.AddSpace(0, 8);
78
79 /* i18n-hint: %s will be replaced with "our Privacy Policy" */
80 AccessibleLinksFormatter privacyPolicy(XO("See %s for more info."));
81
82 privacyPolicy.FormatLink(
83 /* i18n-hint: Title of hyperlink to the privacy policy. This is an object of "See". */
84 wxT("%s"), XO("our Privacy Policy"),
85 "https://www.audacityteam.org/about/desktop-privacy-notice/");
86
87 privacyPolicy.Populate(S);
88
89 AccessibleLinksFormatter preferencesMessage(thirdParagraph);
90
91 preferencesMessage.FormatLink(
92 // i18n-hint: a page in the Preferences dialog; use same name
93 wxT("%s"), XO("Preferences > Application"), [this]() {
94 GlobalPrefsDialog dialog(this /* parent */, nullptr);
95
96 dialog.SelectPageByName(XO("Application").Translation());
97 dialog.ShowModal();
98 });
99
100 preferencesMessage.Populate(S);
101 }
102 S.EndPanel();
103
104 S.AddSpace(24, 0);
105 }
106 S.EndHorizontalLay();
107
108 S.StartHorizontalLay(wxEXPAND);
109 {
110 S.AddSpace(1, 0, 1);
111
112 S.Id(wxID_OK).AddButton(XO("&OK"))->SetFocus();
113
114 S.AddSpace(8, 0);
115 }
116 S.EndHorizontalLay();
117 }
118
119 S.EndVerticalLay();
120
121 Fit();
122 Layout();
123
124 Center();
125}
126
127void UpdateNoticeDialog::OnOk(wxCommandEvent&)
128{
129 EndModal(wxOK);
130}
131
133{
134 Fit();
135 Layout();
136}
wxT("CloseDown"))
IMPLEMENT_CLASS(AudioSetupToolBar, ToolBar)
END_EVENT_TABLE()
Declare functions to perform UTF-8 to std::wstring conversions.
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
XO("Cut/Copy/Paste")
@ eIsCreating
Definition: ShuttleGui.h:37
#define S(N)
Definition: ToChars.cpp:64
static const auto title
static const auto firstParagraph
static const auto secondParagraph
static const auto thirdParagraph
Define a dialog to notify the user about automatic update checking.
void SelectPageByName(const wxString &pageName)
int ShowModal() override
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
Dialog, that notifies the users about automatic updates checking.
void OnOk(wxCommandEvent &)
void OnSize(wxSizeEvent &)
void SetFocus(const WindowPlacement &focus)
Set the window that accepts keyboard input.
Definition: BasicUI.h:392