diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-07-08 00:13:00 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-07-08 01:52:16 +0100 |
| commit | b74bc6135a6a690bf5674638a8bea56e5580fd08 (patch) | |
| tree | 0686281f3b6dc067093a841e30fe2193038f695e /src/wx/hints_dialog.cc | |
| parent | 09d5906f44907aab5afb41ce2da887550c0011a8 (diff) | |
Show hints before make DCP (#823).
Diffstat (limited to 'src/wx/hints_dialog.cc')
| -rw-r--r-- | src/wx/hints_dialog.cc | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/src/wx/hints_dialog.cc b/src/wx/hints_dialog.cc index f45eda0f7..cb971a671 100644 --- a/src/wx/hints_dialog.cc +++ b/src/wx/hints_dialog.cc @@ -22,6 +22,7 @@ #include "wx_util.h" #include "lib/film.h" #include "lib/hints.h" +#include "lib/config.h" #include <wx/richtext/richtextctrl.h> #include <boost/foreach.hpp> @@ -32,7 +33,7 @@ using boost::shared_ptr; using boost::optional; using boost::dynamic_pointer_cast; -HintsDialog::HintsDialog (wxWindow* parent, boost::weak_ptr<Film> film) +HintsDialog::HintsDialog (wxWindow* parent, boost::weak_ptr<Film> film, bool ok) : wxDialog (parent, wxID_ANY, _("Hints")) , _film (film) { @@ -40,11 +41,23 @@ HintsDialog::HintsDialog (wxWindow* parent, boost::weak_ptr<Film> film) _text = new wxRichTextCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (400, 300), wxRE_READONLY); sizer->Add (_text, 1, wxEXPAND | wxALL, 6); - wxSizer* buttons = CreateSeparatedButtonSizer (wxOK); - if (buttons) { - sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder()); + if (!ok) { + wxCheckBox* b = new wxCheckBox (this, wxID_ANY, _("Don't show hints again")); + sizer->Add (b, 0, wxALL, 6); + b->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, bind (&HintsDialog::shut_up, this, _1)); } + wxStdDialogButtonSizer* buttons = CreateStdDialogButtonSizer (0); + sizer->Add (CreateSeparatedSizer(buttons), wxSizerFlags().Expand().DoubleBorder()); + if (ok) { + buttons->SetAffirmativeButton (new wxButton (this, wxID_OK)); + } else { + buttons->SetAffirmativeButton (new wxButton (this, wxID_OK, _("Make DCP anyway"))); + buttons->SetNegativeButton (new wxButton (this, wxID_CANCEL, _("Go back"))); + } + + buttons->Realize (); + SetSizer (sizer); sizer->Layout (); sizer->SetSizeHints (this); @@ -83,3 +96,9 @@ HintsDialog::film_changed () _text->EndSymbolBullet (); } } + +void +HintsDialog::shut_up (wxCommandEvent& ev) +{ + Config::instance()->set_show_hints_before_make_dcp (!ev.IsChecked()); +} |
