1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-07 12:12:23 +01:00
Files
audacity/src/widgets/ErrorDialog.h
James Crook ce9938787c Use alpha or released or local manual for "help on selection".
Previously this was hard coded to use the online alphamanual.
Some other help-on-errors paths were hardcoded to use the online manual, and did not use local help even if available, so these were changed too.

Also two naming changes in the code:
ShowHelpDialog() became ShowHelp() because it typically shows the help in your browser, only showing the help in a dialog under certain circumstances.
The helpURL parameter became helpPage since it is usually a page name that is then elaborated into a url.
The Link() function became InnerLink().

Some careful http -> https changes made too.
2017-08-25 13:59:16 +01:00

88 lines
2.4 KiB
C++

/**********************************************************************
Audacity: A Digital Audio Editor
ErrorDialog.h
Jimmy Johnson
James Crook
**********************************************************************/
#ifndef __AUDACITY_ERRORDIALOG__
#define __AUDACITY_ERRORDIALOG__
#include "../Audacity.h"
#include <wx/defs.h>
#include <wx/window.h>
#include "wxPanelWrapper.h"
class AudacityProject;
class ErrorDialog /* not final */ : public wxDialogWrapper
{
public:
// constructors and destructors
ErrorDialog(wxWindow *parent,
const wxString & dlogTitle,
const wxString & message,
const wxString & helpPage,
const bool Close = true, const bool modal = true);
virtual ~ErrorDialog(){}
private:
wxString dhelpPage;
bool dClose;
bool dModal;
void OnOk( wxCommandEvent &event );
void OnHelp( wxCommandEvent &event );
DECLARE_EVENT_TABLE()
};
// Helper class to make browser "simulate" a modal dialog
class HtmlTextHelpDialog final : public BrowserDialog
{
public:
HtmlTextHelpDialog(wxWindow *pParent, const wxString &title)
: BrowserDialog{ pParent, title }
{
#if !wxCHECK_VERSION(3, 0, 0)
MakeModal( true );
#endif
}
virtual ~HtmlTextHelpDialog()
{
#if !wxCHECK_VERSION(3, 0, 0)
MakeModal( false );
#endif
// On Windows, for some odd reason, the Audacity window will be sent to
// the back. So, make sure that doesn't happen.
GetParent()->Raise();
}
};
/// Displays an error dialog with a button that offers help
void ShowErrorDialog(wxWindow *parent,
const wxString &dlogTitle,
const wxString &message,
const wxString &helpPage,
bool Close = true);
/// Displays a modeless error dialog with a button that offers help
void ShowModelessErrorDialog(wxWindow *parent,
const wxString &dlogTitle,
const wxString &message,
const wxString &helpPage,
bool Close = true);
/// Displays a custom modeless error dialog for aliased file errors
void ShowAliasMissingDialog(AudacityProject *parent,
const wxString &dlogTitle,
const wxString &message,
const wxString &helpPage,
const bool Close = true);
#endif // __AUDACITY_ERRORDIALOG__