diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-04-12 22:51:00 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-04-12 22:51:00 +0100 |
| commit | 1d5ea1b139942bad5500ae40f0646da3fd29dc7f (patch) | |
| tree | 869bde206dedaa251c87d2f91d34925dc07facaf /src | |
| parent | b6d292349cbe43a97db7d7314a4fe3c0c5cb8566 (diff) | |
Disable OK in export dialogue until a filename has been specified (#1260).
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/export_dialog.cc | 14 | ||||
| -rw-r--r-- | src/wx/export_dialog.h | 3 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/wx/export_dialog.cc b/src/wx/export_dialog.cc index 712ef4a7e..9f6207e66 100644 --- a/src/wx/export_dialog.cc +++ b/src/wx/export_dialog.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2017 Carl Hetherington <cth@carlh.net> + Copyright (C) 2017-2018 Carl Hetherington <cth@carlh.net> This file is part of DCP-o-matic. @@ -21,6 +21,7 @@ #include "export_dialog.h" #include "file_picker_ctrl.h" #include "wx_util.h" +#include <wx/filepicker.h> #include <boost/bind.hpp> using boost::bind; @@ -61,8 +62,12 @@ ExportDialog::ExportDialog (wxWindow* parent) _format->SetSelection (0); _format->Bind (wxEVT_CHOICE, bind (&ExportDialog::format_changed, this)); + _file->Bind (wxEVT_FILEPICKER_CHANGED, bind (&ExportDialog::file_changed, this)); layout (); + + wxButton* ok = dynamic_cast<wxButton *> (FindWindowById (wxID_OK, this)); + ok->Enable (false); } void @@ -91,3 +96,10 @@ ExportDialog::mixdown_to_stereo () const { return _mixdown->GetValue (); } + +void +ExportDialog::file_changed () +{ + wxButton* ok = dynamic_cast<wxButton *> (FindWindowById (wxID_OK, this)); + ok->Enable (true); +} diff --git a/src/wx/export_dialog.h b/src/wx/export_dialog.h index d785d910d..c2498d6a1 100644 --- a/src/wx/export_dialog.h +++ b/src/wx/export_dialog.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2017 Carl Hetherington <cth@carlh.net> + Copyright (C) 2017-2018 Carl Hetherington <cth@carlh.net> This file is part of DCP-o-matic. @@ -36,6 +36,7 @@ public: private: void format_changed (); + void file_changed (); wxChoice* _format; wxCheckBox* _mixdown; |
