X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fconfirm_kdm_email_dialog.cc;h=eca34b5cfb1ff5901bcac03590ae78b74821d3ce;hb=36ce958a516567d8481163692c028a88c6ce0df7;hp=69ee7feec909e15ec560b72b840e4b0773fc0470;hpb=cb2546eaf5e2f109ca5309f3dc04e6c17b8037e5;p=dcpomatic.git diff --git a/src/wx/confirm_kdm_email_dialog.cc b/src/wx/confirm_kdm_email_dialog.cc index 69ee7feec..eca34b5cf 100644 --- a/src/wx/confirm_kdm_email_dialog.cc +++ b/src/wx/confirm_kdm_email_dialog.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2016 Carl Hetherington + Copyright (C) 2016-2018 Carl Hetherington This file is part of DCP-o-matic. @@ -20,6 +20,8 @@ #include "confirm_kdm_email_dialog.h" #include "wx_util.h" +#include "static_text.h" +#include "check_box.h" #include "lib/config.h" #include "lib/cinema_kdms.h" #include @@ -28,31 +30,21 @@ using std::list; using std::string; ConfirmKDMEmailDialog::ConfirmKDMEmailDialog (wxWindow* parent, list emails) - : wxDialog (parent, wxID_ANY, _("Confirm KDM email")) + : QuestionDialog (parent, _("Confirm KDM email"), _("Send emails"), _("Don't send emails")) { - wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL); - wxString message = _("Are you sure you want to send emails to the following addresses?\n\n"); BOOST_FOREACH (string i, emails) { message += "\t" + std_to_wx (i) + "\n"; } - sizer->Add (new wxStaticText (this, wxID_ANY, message), 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER); - - wxCheckBox* shut_up = new wxCheckBox (this, wxID_ANY, _("Don't ask this again")); - sizer->Add (shut_up, 0, wxALL, DCPOMATIC_DIALOG_BORDER); + _sizer->Add (new StaticText (this, message), 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER); - shut_up->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, bind (&ConfirmKDMEmailDialog::shut_up, this, _1)); + wxCheckBox* shut_up = new CheckBox (this, _("Don't ask this again")); + _sizer->Add (shut_up, 0, wxALL, DCPOMATIC_DIALOG_BORDER); - wxStdDialogButtonSizer* buttons = CreateStdDialogButtonSizer (0); - sizer->Add (CreateSeparatedSizer(buttons), wxSizerFlags().Expand().DoubleBorder()); - buttons->SetAffirmativeButton (new wxButton (this, wxID_OK, _("Send emails"))); - buttons->SetNegativeButton (new wxButton (this, wxID_CANCEL, _("Don't send emails"))); - buttons->Realize (); + shut_up->Bind (wxEVT_CHECKBOX, bind (&ConfirmKDMEmailDialog::shut_up, this, _1)); - SetSizer (sizer); - sizer->Layout (); - sizer->SetSizeHints (this); + layout (); } void