Audacity 3.2.0
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
WhatsNewDialog Class Referencefinal

#include <WhatsNewDialog.h>

Inheritance diagram for WhatsNewDialog:
[legend]
Collaboration diagram for WhatsNewDialog:
[legend]

Public Member Functions

 WhatsNewDialog (wxWindow *parent, wxWindowID id)
 
 ~WhatsNewDialog () override
 
- Public Member Functions inherited from wxDialogWrapper
 wxDialogWrapper ()
 
 wxDialogWrapper (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog"))
 
bool Create (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog"))
 
void SetTitle (const TranslatableString &title)
 
void SetLabel (const TranslatableString &title)
 
void SetName (const TranslatableString &title)
 
void SetName ()
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxDialog >
 wxTabTraversalWrapper (Args &&... args)
 
 wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete
 
 wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 

Static Public Member Functions

static void Show (AudacityProject &project)
 

Private Member Functions

void Populate (ShuttleGui &S)
 
void OnOK (wxCommandEvent &)
 

Private Attributes

wxCheckBox * mDontShowAgain {}
 

Detailed Description

Definition at line 20 of file WhatsNewDialog.h.

Constructor & Destructor Documentation

◆ WhatsNewDialog()

WhatsNewDialog::WhatsNewDialog ( wxWindow *  parent,
wxWindowID  id 
)

Definition at line 163 of file WhatsNewDialog.cpp.

164 : wxDialogWrapper(parent, id, XO("Welcome to Audacity!"))
165{
166
167 SetSize(FromDIP(wxSize(WindowWidth, WindowHeight)));
168
169#if defined(__WXMSW__)
170 //On Windows UI controls doesn't use same theme preference
171 //as per application, we should use the latter one to get
172 //match with LinkingHtmlWindow's theme
173 SetBackgroundColour(theTheme.Colour(clrMedium));
174#endif
175 SetName();
176 ShuttleGui S( this, eIsCreating );
177 Populate( S );
178 Centre();
179}
XO("Cut/Copy/Paste")
@ eIsCreating
Definition: ShuttleGui.h:37
THEME_API Theme theTheme
Definition: Theme.cpp:82
#define S(N)
Definition: ToChars.cpp:64
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
wxColour & Colour(int iIndex)
void Populate(ShuttleGui &S)

References ThemeBase::Colour(), eIsCreating, S, theTheme, anonymous_namespace{WhatsNewDialog.cpp}::WindowHeight, and anonymous_namespace{WhatsNewDialog.cpp}::WindowWidth.

Here is the call graph for this function:

◆ ~WhatsNewDialog()

WhatsNewDialog::~WhatsNewDialog ( )
overridedefault

Member Function Documentation

◆ OnOK()

void WhatsNewDialog::OnOK ( wxCommandEvent &  evt)
private

Definition at line 281 of file WhatsNewDialog.cpp.

282{
283 gPrefs->Write(wxT("/GUI/ShowSplashScreen"), !mDontShowAgain->IsChecked() );
284 gPrefs->Flush();
286}
wxT("CloseDown"))
audacity::BasicSettings * gPrefs
Definition: Prefs.cpp:68
wxCheckBox * mDontShowAgain
virtual bool Flush() noexcept=0
virtual bool Write(const wxString &key, bool value)=0
IMPORT_EXPORT_API ExportResult Show(ExportTask exportTask)

References audacity::BasicSettings::Flush(), gPrefs, mDontShowAgain, ExportProgressUI::Show(), audacity::BasicSettings::Write(), and wxT().

Here is the call graph for this function:

◆ Populate()

void WhatsNewDialog::Populate ( ShuttleGui S)
private

Definition at line 191 of file WhatsNewDialog.cpp.

192{
193 bool showSplashScreen;
194 gPrefs->Read(wxT("/GUI/ShowSplashScreen"), &showSplashScreen, true );
195
196 FSHelper helper;
197
198 S.StartHorizontalLay(wxEXPAND);
199 {
200 S.SetBorder(20);
201 const auto whatsnew = safenew LinkingHtmlWindow(S.GetParent());
202 whatsnew->SetPage(MakeWhatsNewText());
203 whatsnew->SetBackgroundColour(S.GetParent()->GetBackgroundColour());
204 S
205 .Prop(1)
206#if defined(SHOW_MUSEHUB)
207 .Position(wxEXPAND | wxLEFT | wxTOP | wxBOTTOM)
208#else
209 .Position(wxEXPAND | wxALL)
210#endif
211 .AddWindow(whatsnew);
212
213#if defined(SHOW_MUSEHUB)
214 S.AddSpace(20);
215
216 const auto getplugins = safenew LinkingHtmlWindow(S.GetParent());
217 getplugins->SetPage(MakeGetPluginsText());
218 getplugins->SetBackgroundColour(S.GetParent()->GetBackgroundColour());
219 S
220 .Prop(1)
221 .Position(wxEXPAND | wxTOP | wxRIGHT | wxBOTTOM)
222 .AddWindow(getplugins);
223#endif
224 }
225 S.EndHorizontalLay();
226
227 const auto line = safenew wxWindow(S.GetParent(), wxID_ANY);
228 line->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW));
229 line->SetSize(-1, 1);
230
231 S
232 .Prop(0)
233 .Position(wxEXPAND)
234 .AddWindow(line);
235
236 S.StartHorizontalLay(wxALIGN_CENTRE, 0);
237 {
238 S.SetBorder(10);
239 const auto tutorialsLink = safenew wxHyperlinkCtrl(
240 S.GetParent(),
241 wxID_ANY,
242 _("View tutorials"),
243 "https://support.audacityteam.org/");
244 S
245 .Position(wxTOP | wxBOTTOM)
246 .AddWindow(tutorialsLink);
247
248 S.AddSpace(25);
249
250 const auto forumLink = safenew wxHyperlinkCtrl(
251 S.GetParent(),
252 wxID_ANY,
253 _("Visit our forum"),
254 "https://forum.audacityteam.org/");
255 S
256 .Position(wxTOP | wxBOTTOM)
257 .AddWindow(forumLink);
258 }
259 S.EndHorizontalLay();
260
261 S.Position(wxEXPAND).StartPanel(2);
262 {
263 S.StartHorizontalLay(wxEXPAND);
264 {
265 S.SetBorder(4);
267 .Position(wxALL | wxALIGN_CENTRE)
268 .AddCheckBox( XXO("Don't show this again at start up"), !showSplashScreen);
269
270 S.AddSpace(1,1,1);
271
272 S
273 .Id(wxID_OK)
274 .AddButton(XXO("OK"), wxALL, true);
275 }
276 S.EndHorizontalLay();
277 }
278 S.EndPanel();
279}
XXO("&Cut/Copy/Paste Toolbar")
#define _(s)
Definition: Internat.h:73
#define safenew
Definition: MemoryX.h:10
An HtmlWindow that handles linked clicked - usually the link will go to our own local copy of the man...
Definition: HelpSystem.h:126
virtual bool Read(const wxString &key, bool *value) const =0

References _, gPrefs, anonymous_namespace{WhatsNewDialog.cpp}::MakeGetPluginsText(), anonymous_namespace{WhatsNewDialog.cpp}::MakeWhatsNewText(), mDontShowAgain, audacity::BasicSettings::Read(), S, safenew, wxT(), and XXO().

Here is the call graph for this function:

◆ Show()

void WhatsNewDialog::Show ( AudacityProject project)
static

Definition at line 183 of file WhatsNewDialog.cpp.

184{
185 auto dialog = &GetAttachedWindows(project)
187 dialog->CenterOnParent();
188 dialog->wxDialogWrapper::Show();
189}
AUDACITY_DLL_API AttachedWindows & GetAttachedWindows(AudacityProject &project)
const auto project
AttachedWindows::RegisteredFactory sWhatsNewWindow
Subclass & Get(const RegisteredFactory &key)
Get reference to an attachment, creating on demand if not present, down-cast it to Subclass.
Definition: ClientData.h:318

References ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Get(), GetAttachedWindows(), project, and sWhatsNewWindow.

Referenced by AudacityApp::InitPart2().

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

Member Data Documentation

◆ mDontShowAgain

wxCheckBox* WhatsNewDialog::mDontShowAgain {}
private

Definition at line 22 of file WhatsNewDialog.h.

Referenced by OnOK(), and Populate().


The documentation for this class was generated from the following files: