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 a70d243..7b5696a 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>());
        }