Revert "Use make_shared<>."
[dcpomatic.git] / src / wx / report_problem_dialog.cc
index 971619dafffab76df647dfe979d161eded09de13..68411ee917144f98a5f16879a9a5be360d95c81a 100644 (file)
@@ -1,19 +1,20 @@
 /*
-    Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
 
-    This program is free software; you can redistribute it and/or modify
+    This file is part of DCP-o-matic.
+
+    DCP-o-matic is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation; either version 2 of the License, or
     (at your option) any later version.
 
-    This program is distributed in the hope that it will be useful,
+    DCP-o-matic is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
     You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
 
 */
 
@@ -27,6 +28,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 +68,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);
 }