MCPcopy Create free account
hub / github.com/audacity/audacity / Warn

Method Warn

src/AudacityFileConfig.cpp:149–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149void AudacityFileConfig::Warn() const
150{
151 wxDialogWrapper dlg(nullptr, wxID_ANY, XO("Audacity Configuration Error"));
152
153 ShuttleGui S(&dlg, eIsCreating);
154
155 wxButton *retryButton;
156 wxButton *quitButton;
157
158 S.SetBorder(5);
159 S.StartVerticalLay(wxEXPAND, 1);
160 {
161 S.SetBorder(15);
162 S.StartHorizontalLay(wxALIGN_RIGHT, 0);
163 {
164 S.AddFixedText(
165 XO("The following configuration file could not be accessed:\n\n"
166 "\t%s\n\n"
167 "This could be caused by many reasons, but the most likely are that "
168 "the disk is full or you do not have write permissions to the file. "
169 "\n\n"
170 "You can attempt to correct the issue and then click \"Retry\" to continue.\n\n"
171 "If you choose to \"Quit Audacity\", your project may be left in an unsaved "
172 "state which will be recovered the next time you open it.")
173 .Format(mLocalFilename),
174 false,
175 500);
176 }
177 S.EndHorizontalLay();
178
179 S.SetBorder(5);
180 S.StartHorizontalLay(wxALIGN_RIGHT, 0);
181 {
182 // Can't use themed bitmap since the theme manager might not be
183 // initialized yet and it requires a configuration file.
184 wxButton *b = S.Id(wxID_HELP).AddBitmapButton(wxBitmap(Help_xpm));
185 b->SetToolTip( XO("Help").Translation() );
186 b->SetLabel(XO("Help").Translation()); // for screen readers
187
188 b = S.Id(wxID_CANCEL).AddButton(XXO("&Quit Audacity"));
189 b = S.Id(wxID_OK).AddButton(XXO("&Retry"));
190 dlg.SetAffirmativeId(wxID_OK);
191
192 b->SetDefault();
193 b->SetFocus();
194 }
195 S.EndHorizontalLay();
196 }
197 S.EndVerticalLay();
198
199 dlg.Layout();
200 dlg.GetSizer()->Fit(&dlg);
201 dlg.SetMinSize(dlg.GetSize());
202 dlg.Center();
203
204 auto onButton = [&](wxCommandEvent &e)
205 {
206 dlg.EndModal(e.GetId());

Callers

nothing calls this directly

Calls 15

AddFixedTextMethod · 0.80
AddBitmapButtonMethod · 0.80
TranslationMethod · 0.80
SetDefaultMethod · 0.80
GetSizerMethod · 0.80
GetIdMethod · 0.80
BindMethod · 0.80
wxBitmapClass · 0.50
OpenInDefaultBrowserFunction · 0.50
SetToolTipMethod · 0.45
SetLabelMethod · 0.45
AddButtonMethod · 0.45

Tested by

no test coverage detected