From aa97e44d334f3e2a1924059e10407aae85519eba Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 12 Apr 2018 22:51:00 +0100 Subject: Disable OK in export dialogue until a filename has been specified (#1260). --- ChangeLog | 8 ++++++++ src/wx/export_dialog.cc | 14 +++++++++++++- src/wx/export_dialog.h | 3 ++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2813785bf..02029d714 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2018-04-12 Carl Hetherington + + * Prevent error when starting export without specifying a filename (#1260). + +2018-04-11 Carl Hetherington + + * Fix 3D DCP handling in the player. + 2018-04-10 Carl Hetherington * Fix disappearing subtitles when they are added from text files 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 + Copyright (C) 2017-2018 Carl Hetherington 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 #include 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 (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 (FindWindowById (wxID_OK, this)); + ok->Enable (true); +} diff --git a/src/wx/export_dialog.h b/src/wx/export_dialog.h index 0406c562f..1bc323a14 100644 --- a/src/wx/export_dialog.h +++ b/src/wx/export_dialog.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2017 Carl Hetherington + Copyright (C) 2017-2018 Carl Hetherington This file is part of DCP-o-matic. @@ -36,6 +36,7 @@ public: private: void format_changed (); + void file_changed (); wxChoice* _format; wxCheckBox* _mixdown; -- cgit v1.2.3