diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/screen_dialog.cc | 7 |
1 files 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<wxButton*> (FindWindowById (wxID_OK, this)); if (ok) { - ok->Enable (static_cast<bool>(_recipient)); + ok->Enable (static_cast<bool>(_recipient) && !_name->GetValue().IsEmpty()); } } |
