Audacity  2.2.2
Classes | Functions
ErrorDialog.cpp File Reference
#include "../Audacity.h"
#include <wx/button.h>
#include <wx/icon.h>
#include <wx/dialog.h>
#include <wx/intl.h>
#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/utils.h>
#include <wx/html/htmlwin.h>
#include <wx/settings.h>
#include <wx/statusbr.h>
#include "LinkingHtmlWindow.h"
#include "../Theme.h"
#include "../AllThemeResources.h"
#include "../ShuttleGui.h"
#include "../HelpText.h"
#include "../Internat.h"
#include "../Project.h"
#include "../Prefs.h"
#include "HelpSystem.h"
#include "ErrorDialog.h"

Go to the source code of this file.

Classes

class  AliasedFileMissingDialog
 Special case of ErrorDialog for reporting missing alias files. More...
 

Functions

void ShowErrorDialog (wxWindow *parent, const wxString &dlogTitle, const wxString &message, const wxString &helpPage, const bool Close)
 Displays an error dialog with a button that offers help. More...
 
void ShowModelessErrorDialog (wxWindow *parent, const wxString &dlogTitle, const wxString &message, const wxString &helpPage, const bool Close)
 Displays a modeless error dialog with a button that offers help. More...
 
void ShowAliasMissingDialog (AudacityProject *parent, const wxString &dlogTitle, const wxString &message, const wxString &helpPage, const bool Close)
 Displays a custom modeless error dialog for aliased file errors. More...
 
wxString AudacityMessageBoxCaptionStr ()
 

Function Documentation

wxString AudacityMessageBoxCaptionStr ( )

Definition at line 236 of file ErrorDialog.cpp.

References _().

Referenced by MessageBoxException::DelayedHandlerAction(), and ThemeBase::SaveComponents().

237 {
238  return _("Message");
239 }
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown"))), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop"))), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom"))), OnMoveTrack) void TrackMenuTable::OnSetName(wxCommandEvent &)
void ShowAliasMissingDialog ( AudacityProject parent,
const wxString &  dlogTitle,
const wxString &  message,
const wxString &  helpPage,
const bool  Close 
)

Displays a custom modeless error dialog for aliased file errors.

Definition at line 208 of file ErrorDialog.cpp.

References safenew.

Referenced by AudacityApp::OnTimer().

213 {
214  wxASSERT(parent); // to justify safenew
215  ErrorDialog *dlog = safenew AliasedFileMissingDialog(parent, dlogTitle, message, helpPage, Close, false);
216  // Don't center because in many cases (effect, export, etc) there will be a progress bar in the center that blocks this.
217  // instead put it just above or on the top of the project.
218  wxPoint point;
219  point.x = 0;
220 
221  point.y = parent ? parent->GetPosition().y - 200 : 100;
222 
223  if (point.y < 100)
224  point.y = 100;
225  dlog->SetPosition(point);
226  dlog->CentreOnParent(wxHORIZONTAL);
227 
228  // This needs to be modeless because user may need to
229  // stop playback AND read dialog's instructions.
230  dlog->Show();
231  // ANSWER-ME: Vigilant Sentry flags this method as not deleting dlog, so a mem leak.
232  // PRL: answer is that the parent window guarantees destruction of the dialog
233  // but in practice Destroy() in OnOK does that
234 }
#define safenew
Definition: Audacity.h:223
Special case of ErrorDialog for reporting missing alias files.
Definition: ErrorDialog.cpp:48
Gives an Error message with an option for help.
Definition: ErrorDialog.h:24
void ShowErrorDialog ( wxWindow *  parent,
const wxString &  dlogTitle,
const wxString &  message,
const wxString &  helpPage,
const bool  Close 
)

Displays an error dialog with a button that offers help.

Definition at line 176 of file ErrorDialog.cpp.

Referenced by AudacityProject::Import(), ControlToolBar::OnRecord(), ControlToolBar::PlayPlayRegion(), Effect::Preview(), and CommandManager::TellUserWhyDisallowed().

181 {
182  ErrorDialog dlog(parent, dlogTitle, message, helpPage, Close);
183  dlog.CentreOnParent();
184  dlog.ShowModal();
185 }
Gives an Error message with an option for help.
Definition: ErrorDialog.h:24
void ShowModelessErrorDialog ( wxWindow *  parent,
const wxString &  dlogTitle,
const wxString &  message,
const wxString &  helpPage,
const bool  Close 
)

Displays a modeless error dialog with a button that offers help.

Definition at line 189 of file ErrorDialog.cpp.

References safenew.

194 {
195  // ensure it has some parent.
196  if( !parent )
197  parent = wxTheApp->GetTopWindow();
198  wxASSERT(parent);
199  ErrorDialog *dlog = safenew ErrorDialog(parent, dlogTitle, message, helpPage, Close, false);
200  dlog->CentreOnParent();
201  dlog->Show();
202  // ANSWER-ME: Vigilant Sentry flagged this method as not deleting dlog, so
203  // is this actually a mem leak.
204  // PRL: answer is that the parent window guarantees destruction of the dialog
205  // but in practice Destroy() in OnOK does that
206 }
#define safenew
Definition: Audacity.h:223
Gives an Error message with an option for help.
Definition: ErrorDialog.h:24