X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fscreen_dialog.cc;h=32a0bce43f12ac0345920a2aa28bda00137f5621;hb=9c04891e53ef3f0693a91ca6f50f0e6625c109eb;hp=6584e1ad6e92ba1b8a04a34ab761efdfa332b03b;hpb=089b90439e745a218494e76b45e7df6215af01df;p=dcpomatic.git diff --git a/src/wx/screen_dialog.cc b/src/wx/screen_dialog.cc index 6584e1ad6..32a0bce43 100644 --- a/src/wx/screen_dialog.cc +++ b/src/wx/screen_dialog.cc @@ -65,7 +65,9 @@ ScreenDialog::ScreenDialog (wxWindow* parent, string title, string name, shared_ overall_sizer->Layout (); overall_sizer->SetSizeHints (this); - _certificate_load->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (ScreenDialog::load_certificate), 0, this); + _certificate_load->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ScreenDialog::load_certificate, this)); + + setup_sensitivity (); } string @@ -81,7 +83,7 @@ ScreenDialog::certificate () const } void -ScreenDialog::load_certificate (wxCommandEvent &) +ScreenDialog::load_certificate () { wxFileDialog* d = new wxFileDialog (this, _("Select Certificate File")); @@ -95,4 +97,13 @@ ScreenDialog::load_certificate (wxCommandEvent &) } d->Destroy (); + + setup_sensitivity (); +} + +void +ScreenDialog::setup_sensitivity () +{ + wxButton* ok = dynamic_cast (FindWindowById (wxID_OK, this)); + ok->Enable (_certificate); }