Try to warn about the dangers of not providing an email address on problem reports.
[dcpomatic.git] / src / wx / report_problem_dialog.cc
index 44505565c0e283084f2539de548bd8dc2b0e69f9..3345e21f0ad6519147740ca37a554810219175e2 100644 (file)
@@ -27,6 +27,7 @@
 using std::string;
 using boost::shared_ptr;
 
+/** @param film Film that we are working on, or 0 */
 ReportProblemDialog::ReportProblemDialog (wxWindow* parent, shared_ptr<Film> film)
        : wxDialog (parent, wxID_ANY, _("Report A Problem"))
        , _film (film)
@@ -66,6 +67,29 @@ ReportProblemDialog::ReportProblemDialog (wxWindow* parent, shared_ptr<Film> fil
        _email->SetValue (std_to_wx (Config::instance()->kdm_from ()));
        _table->Add (_email, 1, wxEXPAND);
 
+       /* We can't use Wrap() here as it doesn't work with markup:
+        * http://trac.wxwidgets.org/ticket/13389
+        */
+
+       wxString in = _("<i>It is important that you enter a valid email address here, otherwise I can't ask you for more details on your problem.</i>");
+       wxString out;
+       int const width = 45;
+       int current = 0;
+       for (size_t i = 0; i < in.Length(); ++i) {
+               if (in[i] == ' ' && current >= width) {
+                       out += '\n';
+                       current = 0;
+               } else {
+                       out += in[i];
+                       ++current;
+               }
+       }
+
+       wxStaticText* n = new wxStaticText (this, wxID_ANY, wxT (""));
+       n->SetLabelMarkup (out);
+       _table->AddSpacer (0);
+       _table->Add (n, 1, wxEXPAND);
+
        _overall_sizer->Layout ();
        _overall_sizer->SetSizeHints (this);
 }