From: Carl Hetherington Date: Thu, 10 Jan 2019 22:13:08 +0000 (+0000) Subject: Check modified before File -> Close happens. X-Git-Tag: v2.13.98~3 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=123854f87845e030f7b72c7edddb6b5e48242d41 Check modified before File -> Close happens. --- diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index a70d243d9..7b5696a1c 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -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()); }