From a618339514026c5f9129a9f786289952cdbd3cdf Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 22 Dec 2015 21:20:01 +0000 Subject: [PATCH] Fix sensitivity of OK in the screen dialog. --- src/wx/screen_dialog.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/wx/screen_dialog.cc b/src/wx/screen_dialog.cc index bec531879..6c95c0bae 100644 --- a/src/wx/screen_dialog.cc +++ b/src/wx/screen_dialog.cc @@ -119,11 +119,10 @@ ScreenDialog::ScreenDialog (wxWindow* parent, string title, string name, optiona _sizer->Add (_trusted_device_list, wxGBPosition (r, 0), wxGBSpan (1, 3), wxEXPAND); ++r; + _name->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&ScreenDialog::setup_sensitivity, this)); _get_recipient_from_file->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ScreenDialog::get_recipient_from_file, this)); _download_recipient->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ScreenDialog::download_recipient, this)); - setup_sensitivity (); - overall_sizer->Add (_sizer, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER); wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL); @@ -133,6 +132,8 @@ ScreenDialog::ScreenDialog (wxWindow* parent, string title, string name, optiona overall_sizer->Layout (); overall_sizer->SetSizeHints (this); + + setup_sensitivity (); } string @@ -185,7 +186,7 @@ ScreenDialog::setup_sensitivity () { wxButton* ok = dynamic_cast (FindWindowById (wxID_OK, this)); if (ok) { - ok->Enable (static_cast(_recipient)); + ok->Enable (static_cast(_recipient) && !_name->GetValue().IsEmpty()); } } -- 2.30.2