+
+void
+Config::changed (Property what)
+{
+ Changed (what);
+}
+
+void
+Config::set_kdm_email_to_default ()
+{
+ _kdm_subject = _("KDM delivery: $CPL_NAME");
+
+ _kdm_email = _(
+ "Dear Projectionist\n\n"
+ "Please find attached KDMs for $CPL_NAME.\n\n"
+ "Cinema: $CINEMA_NAME\n"
+ "Screen(s): $SCREENS\n\n"
+ "The KDMs are valid from $START_TIME until $END_TIME.\n\n"
+ "Best regards,\nDCP-o-matic"
+ );
+}
+
+void
+Config::reset_kdm_email ()
+{
+ set_kdm_email_to_default ();
+ changed ();
+}
+
+void
+Config::add_to_history (boost::filesystem::path p)
+{
+ /* Remove existing instances of this path in the history */
+ _history.erase (remove (_history.begin(), _history.end(), p), _history.end ());
+
+ _history.insert (_history.begin (), p);
+ if (_history.size() > HISTORY_SIZE) {
+ _history.pop_back ();
+ }
+
+ changed ();
+}
+
+bool
+Config::have_existing (string file)
+{
+ return boost::filesystem::exists (path (file, false));
+}
+
+void
+Config::read_cinemas (cxml::Document const & f)
+{
+ _cinemas.clear ();
+ list<cxml::NodePtr> cin = f.node_children ("Cinema");
+ for (list<cxml::NodePtr>::iterator i = cin.begin(); i != cin.end(); ++i) {
+ /* Slightly grotty two-part construction of Cinema here so that we can use
+ shared_from_this.
+ */
+ shared_ptr<Cinema> cinema (new Cinema (*i));
+ cinema->read_screens (*i);
+ _cinemas.push_back (cinema);
+ }
+}
+
+void
+Config::set_cinemas_file (boost::filesystem::path file)
+{
+ _cinemas_file = file;
+
+ if (boost::filesystem::exists (_cinemas_file)) {
+ /* Existing file; read it in */
+ cxml::Document f ("Cinemas");
+ f.read_file (_cinemas_file);
+ read_cinemas (f);
+ }
+
+ changed (OTHER);
+}