Make sure that crop preview rectangle is properly hidden when we close the auto crop...
[dcpomatic.git] / src / wx / content_menu.cc
index b86137358596e67bd59f591d40026011ff11a833..dbfbbd82bb76c92dbea38651b2f03cff89230637 100644 (file)
 #include "lib/image_content.h"
 #include "lib/job_manager.h"
 #include "lib/playlist.h"
-#include "lib/video_content.h"
-#include "lib/warnings.h"
 #include <dcp/cpl.h>
 #include <dcp/decrypted_kdm.h>
 #include <dcp/exceptions.h>
 #include <dcp/search.h>
-DCPOMATIC_DISABLE_WARNINGS
+#include <dcp/warnings.h>
+LIBDCP_DISABLE_WARNINGS
 #include <wx/dirdlg.h>
 #include <wx/wx.h>
-DCPOMATIC_ENABLE_WARNINGS
+LIBDCP_ENABLE_WARNINGS
 
 
 using std::dynamic_pointer_cast;
@@ -559,13 +558,13 @@ ContentMenu::auto_crop ()
 
        /* Handle the user closing the dialog (with OK or cancel) */
        _auto_crop_dialog->Bind (wxEVT_BUTTON, [this, viewer](wxCommandEvent& ev) {
+               _auto_crop_config_connection.disconnect ();
+               _auto_crop_viewer_connection.disconnect ();
                if (ev.GetId() == wxID_OK) {
                        _content.front()->video->set_crop(_auto_crop_dialog->get());
                }
                _auto_crop_dialog->Show (false);
                viewer->unset_crop_guess ();
-               _auto_crop_config_connection.disconnect ();
-               _auto_crop_viewer_connection.disconnect ();
        });
 
        /* Update the view when something in the dialog is changed */