Only write config on change from the UI, not (say) from tests.
[dcpomatic.git] / src / tools / dcpomatic.cc
index e0c0148b07d6179f53969b2d5ce323a1191af384..e59220785b82aefb3234cedc6ac2c9c90de68fbc 100644 (file)
@@ -236,6 +236,9 @@ public:
                Bind (wxEVT_MENU, boost::bind (&ContentPanel::add_file_clicked, _film_editor->content_panel()), ID_add_file);
                wxAcceleratorTable accel_table (1, accel);
                SetAcceleratorTable (accel_table);
+
+               /* Instantly save any config changes when using the DCP-o-matic GUI */
+               Config::instance()->Changed.connect (boost::bind (&Config::write, Config::instance ()));
        }
 
        void new_film (boost::filesystem::path path)