Audacity  3.0.3
NoUpdatesAvailableDialog.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  @file NoUpdatesAvailableDialog.cpp
6  @brief Define a dialog with Information about no updates available.
7 
8  Anton Gerasimov
9 
10 **********************************************************************/
11 
13 
14 #include "widgets/HelpSystem.h"
15 #include "ShuttleGui.h"
16 
17 #include "prefs/PrefsDialog.h"
19 
20 #include <wx/stattext.h>
21 
22 static const auto title =
23 /* i18n-hint: Title of the dialog no updates available. */
24 XO("No Updates Available");
25 
26 BEGIN_EVENT_TABLE(NoUpdatesAvailableDialog, wxDialogWrapper)
29 
32  parent, -1, XO("Check for Updates"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX)
33 {
34  ShuttleGui S(this, eIsCreating);
35 
36  S.SetBorder(8);
37 
38  S.StartVerticalLay();
39  {
40  S.AddSpace(0, 12);
41 
43  {
44  S.AddSpace(12, 0);
45 
46  S.StartVerticalLay();
47  {
48  wxStaticText* titleCtrl = S.AddVariableText(title, false, 0, 500);
49 
50  wxFont font = titleCtrl->GetFont().MakeLarger().MakeBold();
51 
52  titleCtrl->SetFont(font);
53 
54  AccessibleLinksFormatter preferencesMessage(
55  /* i18n-hint: %s is replaced with 'Preferences > Application'. */
56  XO("If you want to change your preference for automatic updates checking, you can find it in %s."));
57 
58  preferencesMessage.FormatLink(
59  /* i18n-hint: Hyperlink title that opens Preferences dialog on Application page and is substituted into "... you can find it in %s." string. */
60  wxT("%s"), XO("Preferences > Application"), [parent, this]() {
61  EndModal(wxID_OK);
62 
63  GlobalPrefsDialog dialog(parent, nullptr);
64 
65  dialog.SelectPageByName(XO("Application").Translation());
66  dialog.ShowModal();
67  });
68 
69  preferencesMessage.Populate(S);
70  }
71  S.EndVerticalLay();
72 
73  S.AddSpace(12, 0);
74  }
75  S.EndHorizontalLay();
76 
77  S.AddSpace(0, 12);
78 
80  }
81  S.EndVerticalLay();
82 
83  Layout();
84  Fit();
85  Center();
86 }
87 
89 {
90  ;
91 }
92 
93 void NoUpdatesAvailableDialog::OnOk(wxCommandEvent&)
94 {
95  EndModal(wxID_OK);
96 }
NoUpdatesAvailableDialog.h
PrefsDialog::ShowModal
int ShowModal() override
Definition: PrefsDialog.cpp:596
EVT_BUTTON
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
eIsCreating
@ eIsCreating
Definition: ShuttleGui.h:38
ShuttleGuiBase::StartVerticalLay
void StartVerticalLay(int iProp=1)
Definition: ShuttleGui.cpp:1184
HelpSystem.h
PrefsDialog.h
ShuttleGui::AddSpace
wxSizerItem * AddSpace(int width, int height, int prop=0)
Definition: ShuttleGui.cpp:2459
for
for(int ii=0, nn=names.size();ii< nn;++ii)
Definition: SpectrumVZoomHandle.cpp:276
NoUpdatesAvailableDialog
Information dialog about no updates available, that allows to navigate to settings quickly.
Definition: NoUpdatesAvailableDialog.h:19
XO
#define XO(s)
Definition: Internat.h:31
ShuttleGuiBase::EndHorizontalLay
void EndHorizontalLay()
Definition: ShuttleGui.cpp:1177
ShuttleGuiBase::StartHorizontalLay
void StartHorizontalLay(int PositionFlags=wxALIGN_CENTRE, int iProp=1)
Definition: ShuttleGui.cpp:1167
ShuttleGuiBase::EndVerticalLay
void EndVerticalLay()
Definition: ShuttleGui.cpp:1203
PrefsDialog::SelectPageByName
void SelectPageByName(const wxString &pageName)
Definition: PrefsDialog.cpp:778
ShuttleGui.h
wxDialogWrapper
Definition: wxPanelWrapper.h:81
NoUpdatesAvailableDialog::OnOk
void OnOk(wxCommandEvent &event)
Definition: NoUpdatesAvailableDialog.cpp:93
title
static const auto title
Definition: NoUpdatesAvailableDialog.cpp:22
eOkButton
@ eOkButton
Definition: ShuttleGui.h:600
NoUpdatesAvailableDialog::~NoUpdatesAvailableDialog
virtual ~NoUpdatesAvailableDialog()
Definition: NoUpdatesAvailableDialog.cpp:88
GlobalPrefsDialog
Definition: PrefsDialog.h:81
ShuttleGui::AddStandardButtons
void AddStandardButtons(long buttons=eOkButton|eCancelButton, wxWindow *extra=NULL)
Definition: ShuttleGui.cpp:2444
ShuttleGuiBase::SetBorder
void SetBorder(int Border)
Definition: ShuttleGui.h:489
ShuttleGuiBase::AddVariableText
wxStaticText * AddVariableText(const TranslatableString &Str, bool bCenter=false, int PositionFlags=0, int wrapWidth=0)
Definition: ShuttleGui.cpp:463
END_EVENT_TABLE
END_EVENT_TABLE()
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631