summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-12-22 21:20:01 +0000
committerCarl Hetherington <cth@carlh.net>2015-12-22 21:20:01 +0000
commita618339514026c5f9129a9f786289952cdbd3cdf (patch)
treeff547bb3df571816a17eb7a09db6126277a89246 /src
parentaa9d99923a11559e8a0bd320bc2bb13461033175 (diff)
Fix sensitivity of OK in the screen dialog.
Diffstat (limited to 'src')
-rw-r--r--src/wx/screen_dialog.cc7
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());
}
}