Add Cancel button to custom colour conversion dialogue (#880).
authorCarl Hetherington <cth@carlh.net>
Mon, 30 May 2016 09:34:24 +0000 (10:34 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 30 May 2016 09:34:24 +0000 (10:34 +0100)
ChangeLog
src/wx/content_colour_conversion_dialog.cc
src/wx/video_panel.cc

index 3a1f362f9d9e2a0c22670998b3cce0f934a17fab..38b976fac3dcc85e80b284a17a7afdd9337218c3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2016-05-30  Carl Hetherington  <cth@carlh.net>
 
+       * 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).
 
index 995e80f6b6c705c0fee404103bd6792fd0164fec..badfb894f7391ef350bb8360805158ea82040615 100644 (file)
@@ -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());
        }
index 0a8feadc82279f32d248a3b59202c0e4c6af32a6..8a8dbd181609e5c15734cc2fc4770bcdb5fd5c20 100644 (file)
@@ -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 ();
 }