X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Fwx%2Freport_problem_dialog.cc;h=5497908ca69b413336412bb52530ad9fe2be7a4b;hp=8ec275b4e3b0de9254179c3e95cb61d9f4159eff;hb=be436f229587905e89ac768b3c57b0e983cfe7fa;hpb=dd9be86db6cde0afa5da0d1d1ac43b42e05dca26 diff --git a/src/wx/report_problem_dialog.cc b/src/wx/report_problem_dialog.cc index 8ec275b4e..5497908ca 100644 --- a/src/wx/report_problem_dialog.cc +++ b/src/wx/report_problem_dialog.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014-2018 Carl Hetherington + Copyright (C) 2014-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,18 +18,22 @@ */ + +#include "check_box.h" #include "report_problem_dialog.h" -#include "wx_util.h" #include "static_text.h" -#include "check_box.h" +#include "wx_util.h" #include "lib/config.h" #include "lib/job_manager.h" #include "lib/send_problem_report_job.h" #include + +using std::make_shared; using std::string; using std::shared_ptr; + /** @param parent Parent window. * @param film Film that we are working on, or 0. */ @@ -45,21 +49,21 @@ ReportProblemDialog::ReportProblemDialog (wxWindow* parent, shared_ptr fil _overall_sizer->Add (_table, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER); - wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL); + auto buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL); if (buttons) { _overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder()); } - wxString t = _("My problem is"); + auto t = _("My problem is"); int flags = wxALIGN_TOP | wxLEFT | wxRIGHT; #ifdef __WXOSX__ flags |= wxALIGN_RIGHT; t += wxT (":"); #endif - wxStaticText* m = new StaticText (this, t); + auto m = new StaticText (this, t); _table->Add (m, 1, flags, 6); - _summary = new wxTextCtrl (this, wxID_ANY, wxT (""), wxDefaultPosition, wxSize (320, 240), wxTE_MULTILINE); + _summary = new wxTextCtrl (this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(320, 240), wxTE_MULTILINE); _table->Add (_summary, 1, wxEXPAND | wxALIGN_TOP); _send_logs = new CheckBox (this, _("Send logs")); @@ -90,7 +94,7 @@ ReportProblemDialog::ReportProblemDialog (wxWindow* parent, shared_ptr fil } } - wxStaticText* n = new StaticText (this, wxT ("")); + auto n = new StaticText (this, wxT("")); n->SetLabelMarkup (out); _table->AddSpacer (0); _table->Add (n, 1, wxEXPAND); @@ -101,18 +105,20 @@ ReportProblemDialog::ReportProblemDialog (wxWindow* parent, shared_ptr fil _summary->SetFocus (); } + void ReportProblemDialog::report () { - if (_email->GetValue().IsEmpty ()) { + if (_email->GetValue().IsEmpty()) { error_dialog (this, _("Please enter an email address so that we can contact you with any queries about the problem.")); return; } if (_email->GetValue() == "carl@dcpomatic.com" || _email->GetValue() == "cth@carlh.net") { - error_dialog (this, wxString::Format (_("Enter your email address for the contact, not %s"), _email->GetValue().data())); + error_dialog (this, wxString::Format(_("Enter your email address for the contact, not %s"), _email->GetValue().data())); return; } - JobManager::instance()->add (shared_ptr (new SendProblemReportJob (_film, wx_to_std (_email->GetValue ()), wx_to_std (_summary->GetValue ())))); + JobManager::instance()->add (make_shared(_film, wx_to_std(_email->GetValue()), wx_to_std(_summary->GetValue()))); } +