Audacity 3.2.0
UnwritableLocationErrorDialog.cpp
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 UnwritableLocationError.h
6
7 Dmitry Vedenko
8
9**********************************************************************/
10
12
13#include "HelpSystem.h"
14#include "ShuttleGui.h"
15
16#include "prefs/PrefsDialog.h"
18
23
24UnwritableLocationErrorDialog::UnwritableLocationErrorDialog(wxWindow* parent, const wxString& path)
26 parent, -1, XO("Error"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX)
27{
29
30 S.SetBorder(8);
31
32 S.StartVerticalLay();
33 {
34 S.AddSpace(0, 12);
35
36 S.StartHorizontalLay();
37 {
38 S.AddSpace(12, 0);
39
40 S.StartVerticalLay();
41 {
42 S.AddFixedText(
43 /* i18n-hint: %s is replaced with a directory path. */
44 XO("Unable to write files to directory: %s.").Format(path),
45 false, 500);
46
47 S.AddFixedText(
48 /* i18n-hint: This message describes the error in the Error dialog. */
49 XO("Please check that the directory exists, has the necessary permissions, and the drive isn't full."),
50 false, 0);
51
52 S.AddSpace(0, 8);
53
54 AccessibleLinksFormatter preferencesMessage(
55 /* i18n-hint: %s is replaced with 'Preferences > Directories'. */
56 XO("You can change the directory in %s."));
57
58 preferencesMessage.FormatLink(
59 /* i18n-hint: Hyperlink title that opens Preferences dialog on Directories page. */
60 wxT("%s"), XO("Preferences > Directories"), [parent, this]() {
61 EndModal(wxID_OK);
62
63 GlobalPrefsDialog dialog(parent, nullptr);
64
65 dialog.SelectPageByName(XO("Directories").Translation());
66 dialog.ShowModal();
67 });
68
69
70 preferencesMessage.Populate(S);
71 }
72 S.EndVerticalLay();
73
74 S.AddSpace(12, 0);
75 }
76 S.EndHorizontalLay();
77
78 S.AddSpace(0, 12);
79
80 S.AddStandardButtons(eHelpButton | eOkButton);
81 }
82 S.EndVerticalLay();
83
84 Layout();
85 Fit();
86 Center();
87}
88
90{
91
92}
93
95{
96 EndModal(wxID_OK);
97}
98
100{
101 HelpSystem::ShowHelp(this, "Error:_Disk_full_or_not_writable", false);
102}
wxT("CloseDown"))
END_EVENT_TABLE()
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
XO("Cut/Copy/Paste")
@ eIsCreating
Definition: ShuttleGui.h:37
@ eOkButton
Definition: ShuttleGui.h:609
@ eHelpButton
Definition: ShuttleGui.h:613
#define S(N)
Definition: ToChars.cpp:64
Abstract base class used in importing a file.
static void ShowHelp(wxWindow *parent, const FilePath &localFileName, const URLString &remoteURL, bool bModal=false, bool alwaysDefaultBrowser=false)
Definition: HelpSystem.cpp:231
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
An error dialog about unwritable location, that allows to navigate to settings quickly.