summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-10-19 23:21:51 +0200
committerCarl Hetherington <cth@carlh.net>2020-10-19 23:21:51 +0200
commit5c3a792617be3764806256020fce87af26b643c1 (patch)
tree90f5fbfc310c34f69d34dd4d6e2bb7662d97c412
parent9bad8a0103b8ea37246c7a719865e840b40dad43 (diff)
Playlist editor: save configuration when it changes.
-rw-r--r--src/tools/dcpomatic_playlist.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/tools/dcpomatic_playlist.cc b/src/tools/dcpomatic_playlist.cc
index 6a0281505..9027e7e30 100644
--- a/src/tools/dcpomatic_playlist.cc
+++ b/src/tools/dcpomatic_playlist.cc
@@ -476,6 +476,8 @@ public:
Bind (wxEVT_MENU, boost::bind (&DOMFrame::file_exit, this), wxID_EXIT);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::help_about, this), wxID_ABOUT);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::edit_preferences, this), wxID_PREFERENCES);
+
+ _config_changed_connection = Config::instance()->Changed.connect(boost::bind(&DOMFrame::config_changed, this));
}
private:
@@ -548,10 +550,28 @@ private:
m->Append (help, _("&Help"));
}
+
+ void config_changed ()
+ {
+ try {
+ Config::instance()->write_config();
+ } catch (exception& e) {
+ error_dialog (
+ this,
+ wxString::Format (
+ _("Could not write to config file at %s. Your changes have not been saved."),
+ std_to_wx (Config::instance()->cinemas_file().string()).data()
+ )
+ );
+ }
+ }
+
+
ContentDialog* _content_dialog;
PlaylistList* _playlist_list;
PlaylistContent* _playlist_content;
wxPreferencesEditor* _config_dialog;
+ boost::signals2::scoped_connection _config_changed_connection;
};
/** @class App