summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-01-10 22:13:08 +0000
committerCarl Hetherington <cth@carlh.net>2019-01-10 22:13:08 +0000
commit123854f87845e030f7b72c7edddb6b5e48242d41 (patch)
treefb1502f8a93e6f12d0ee88d6937f9afe2224612b /src/tools
parent1f8b61e4d89622c9087c8c49ea988ad1c903f64e (diff)
Check modified before File -> Close happens.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/dcpomatic.cc20
1 files changed, 20 insertions, 0 deletions
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<Film>());
}