diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/report_problem_dialog.cc | 18 | ||||
| -rw-r--r-- | src/wx/report_problem_dialog.h | 2 |
2 files changed, 15 insertions, 5 deletions
diff --git a/src/wx/report_problem_dialog.cc b/src/wx/report_problem_dialog.cc index 9079b344d..2a0fb6bbd 100644 --- a/src/wx/report_problem_dialog.cc +++ b/src/wx/report_problem_dialog.cc @@ -105,17 +105,16 @@ ReportProblemDialog::ReportProblemDialog(wxWindow* parent, shared_ptr<Film> film _overall_sizer->SetSizeHints(this); _summary->SetFocus(); + + _email->Bind(wxEVT_TEXT, boost::bind(&ReportProblemDialog::setup_sensitivity, this)); + + setup_sensitivity(); } void ReportProblemDialog::report() { - 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() == char_to_wx("carl@dcpomatic.com") || _email->GetValue() == char_to_wx("cth@carlh.net")) { error_dialog(this, wxString::Format(_("Enter your email address for the contact, not %s"), _email->GetValue().data())); return; @@ -124,3 +123,12 @@ ReportProblemDialog::report() JobManager::instance()->add(make_shared<SendProblemReportJob>(_film, wx_to_std(_email->GetValue()), wx_to_std(_summary->GetValue()))); } + +void +ReportProblemDialog::setup_sensitivity() +{ + if (auto ok = dynamic_cast<wxButton *>(FindWindowById(wxID_OK, this))) { + ok->Enable(!_email->GetValue().IsEmpty()); + } +} + diff --git a/src/wx/report_problem_dialog.h b/src/wx/report_problem_dialog.h index c43defd41..ad76795a3 100644 --- a/src/wx/report_problem_dialog.h +++ b/src/wx/report_problem_dialog.h @@ -39,6 +39,8 @@ public: void report(); private: + void setup_sensitivity(); + std::shared_ptr<Film> _film; wxSizer* _overall_sizer; |
