From 771ba62be4e59439bf1b8dd622502e51f6444145 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 30 May 2016 10:34:24 +0100 Subject: [PATCH] Add Cancel button to custom colour conversion dialogue (#880). --- ChangeLog | 3 +++ src/wx/content_colour_conversion_dialog.cc | 2 +- src/wx/video_panel.cc | 10 +++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3a1f362f9..38b976fac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2016-05-30 Carl Hetherington + * Add Cancel button to custom colour conversion + dialogue (#880). + * Give the option to abort the operation when creating a new film or opening an existing one (#847). diff --git a/src/wx/content_colour_conversion_dialog.cc b/src/wx/content_colour_conversion_dialog.cc index 995e80f6b..badfb894f 100644 --- a/src/wx/content_colour_conversion_dialog.cc +++ b/src/wx/content_colour_conversion_dialog.cc @@ -51,7 +51,7 @@ ContentColourConversionDialog::ContentColourConversionDialog (wxWindow* parent, overall_sizer->Add (new wxStaticLine (this, wxID_ANY), 0, wxEXPAND); overall_sizer->Add (_editor); - wxSizer* buttons = CreateSeparatedButtonSizer (wxOK); + wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL); if (buttons) { overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder()); } diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc index 0a8feadc8..8a8dbd181 100644 --- a/src/wx/video_panel.cc +++ b/src/wx/video_panel.cc @@ -414,9 +414,13 @@ VideoPanel::edit_colour_conversion_clicked () } ContentColourConversionDialog* d = new ContentColourConversionDialog (this, vc.front()->video->yuv ()); - d->set (vc.front()->video->colour_conversion().get_value_or (PresetColourConversion::all().front ().conversion)); - d->ShowModal (); - vc.front()->video->set_colour_conversion (d->get ()); + d->set (vc.front()->video->colour_conversion().get_value_or (PresetColourConversion::all().front().conversion)); + if (d->ShowModal() == wxID_OK) { + vc.front()->video->set_colour_conversion (d->get ()); + } else { + /* Reset the colour conversion choice */ + film_content_changed (VideoContentProperty::COLOUR_CONVERSION); + } d->Destroy (); } -- 2.30.2