Check modified before File -> Close happens.
authorCarl Hetherington <cth@carlh.net>
Thu, 10 Jan 2019 22:13:08 +0000 (22:13 +0000)
committerCarl Hetherington <cth@carlh.net>
Thu, 10 Jan 2019 22:13:08 +0000 (22:13 +0000)
src/tools/dcpomatic.cc

index a70d243d936b352847b805e3d4f9636290802384..7b5696a1c1581b8007a4a69a8160d68b38fe1065 100644 (file)
@@ -590,6 +590,26 @@ private:
 
        void file_close ()
        {
+               if (_film && _film->dirty ()) {
+
+                       FilmChangedClosingDialog* dialog = new FilmChangedClosingDialog (_film->name ());
+                       int const r = dialog->run ();
+                       delete dialog;
+
+                       switch (r) {
+                       case wxID_NO:
+                               /* Don't save and carry on to close */
+                               break;
+                       case wxID_YES:
+                               /* Save and carry on to close */
+                               _film->write_metadata ();
+                               break;
+                       case wxID_CANCEL:
+                               /* Stop */
+                               return;
+                       }
+               }
+
                set_film (shared_ptr<Film>());
        }