14#include <wx/artprov.h>
16#include <wx/collpane.h>
18#include <wx/html/htmlwin.h>
21#include <wx/settings.h>
23#include <wx/statbmp.h>
24#include <wx/stattext.h>
25#include <wx/statusbr.h>
26#include <wx/textctrl.h>
27#include <wx/bmpbuttn.h>
50#elif defined(__WXMSW__)
51 return root->ConvertDialogToPixels(wxSize(2, 0)).x;
71 const wxString& log, const
bool modal)
73 parent, wxID_ANY, dlogTitle, wxDefaultPosition, wxDefaultSize,
74 wxDEFAULT_DIALOG_STYLE)
84 mReport = std::make_unique<audacity::sentry::Report> (ex);
88 const wxFont headingFont = wxFont(wxFontInfo(12).Bold());
89 const wxFont textFont = wxFont(wxFontInfo(10));
95 S.StartHorizontalLay(wxEXPAND, 0);
97 S.AddSpace(40 - CollapsibleBorderSize, 0);
99 S.StartVerticalLay(wxEXPAND, 0);
103 S.StartHorizontalLay(wxEXPAND, 0);
105 S.AddSpace(CollapsibleBorderSize);
107 S.StartVerticalLay(wxEXPAND, 0);
109 S.StartHorizontalLay(wxEXPAND, 1);
111 S.StartVerticalLay(0);
113 wxBitmap bitmap = wxArtProvider::GetBitmap(
114 wxART_WARNING, wxART_MESSAGE_BOX, wxSize(24, 24));
117 safenew wxStaticBitmap(
S.GetParent(), -1, bitmap));
125 S.StartVerticalLay(0);
130 .AddVariableText(message,
false, 0, 560)
131 ->SetFont(headingFont);
135 S.EndHorizontalLay();
141 XO(
"More information about this error may be available %s."));
147 "https://audacityteam.org/errors");
151 S.AddVariableText(
XO(
152 "Would you like to send a report to help us fix this issue?"))
159 XO(
"All reports are anonymous. See %s for more info."));
164 XO(
"our Privacy Policy"),
165 "https://www.audacityteam.org/about/desktop-privacy-notice/");
171 S.EndHorizontalLay();
175 S.StartHorizontalLay(wxEXPAND, 0);
177 auto pane =
safenew wxCollapsiblePane(
178 S.GetParent(), wxID_ANY,
XO(
"Problem details").Translation());
180 S.Style(wxEXPAND | wxALIGN_LEFT);
189 wxTE_RICH | wxTE_READONLY | wxTE_MULTILINE | wxTE_DONTWRAP)
191 .
Name(
XO(
"Problem details"))
192 .
AddTextBox({}, mReport->GetReportPreview(), 0);
202 mCommentsControl = SI.
Style(wxTE_MULTILINE)
204 .Name(
XO(
"Comments"))
205 .AddTextBox({}, {}, 0);
212 S.EndHorizontalLay();
216 S.StartHorizontalLay(wxEXPAND);
218 if (!mHelpUrl.empty())
220 wxBitmapButton* helpButton =
223 helpButton->SetToolTip(
XO(
"Help").Translation());
224 helpButton->SetLabel(
XO(
"Help").Translation());
229 S.Id(wxID_NO).AddButton(
XC(
"&Don't send",
"crash reporter button"));
233 S.Id(wxID_YES).AddButton(
XC(
"&Send",
"crash reporter button"));
235 S.EndHorizontalLay();
243 S.EndHorizontalLay();
248 GetSizer()->Fit(
this);
249 SetMinSize(GetSize());
265 [
this](
int code, std::string body) {
280 if (helpUrl.StartsWith(
wxT(
"innerlink:")))
Declare functions to perform UTF-8 to std::wstring conversions.
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
constexpr bool ErrorReportDialogHasUserComment
constexpr int MaxUserCommentLength
TranslatableString TitleText(const wxString &Key)
wxString HelpText(const wxString &Key)
Declare a class to report errors to Sentry.
A dialog, that has "Send", "Don't send" and help buttons.
void OnSend(wxCommandEvent &event)
wxTextCtrl * mCommentsControl
void OnDontSend(wxCommandEvent &event)
std::unique_ptr< audacity::sentry::Report > mReport
void OnHelp(wxCommandEvent &event)
static void ShowHelp(wxWindow *parent, const FilePath &localFileName, const URLString &remoteURL, bool bModal=false, bool alwaysDefaultBrowser=false)
static void ShowHtmlText(wxWindow *pParent, const TranslatableString &Title, const wxString &HtmlText, bool bIsFile=false, bool bModal=false)
const wxString & GET() const
Explicit conversion to wxString, meant to be ugly-looking and demanding of a comment why it's correct...
wxTextCtrl * AddTextBox(const TranslatableString &Caption, const wxString &Value, const int nChars)
void StartVerticalLay(int iProp=1)
wxStaticText * AddVariableText(const TranslatableString &Str, bool bCenter=false, int PositionFlags=0, int wrapWidth=0)
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
wxSizerItem * AddSpace(int width, int height, int prop=0)
ShuttleGui & Name(const TranslatableString &name)
ShuttleGui & Style(long iStyle)
wxBitmap & Bitmap(int iIndex)
Holds a msgid for the translation catalog; may also bind format arguments.
void CallAfter(Action action)
Schedule an action to be done later, and in the main thread.
int GetCollapsiblePaneBorder(wxWindow *root)
std::string ToUTF8(const std::wstring &wstr)
A DTO for the Sentry Exception interface.
Exception & AddData(std::string key, AnonymizedMessage value)
Add a payload to the exception.
static Exception Create(std::string type, AnonymizedMessage value)
Create a new exception.