Update the UI on a change to the configured cinema/screen database (#2951).
authorCarl Hetherington <cth@carlh.net>
Fri, 17 Jan 2025 02:01:17 +0000 (03:01 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 22 Jan 2025 13:34:25 +0000 (14:34 +0100)
src/tools/dcpomatic_kdm.cc

index d554107cdf7e6637f7307438e9ce0f9f5454b21f..af69aca3cf14397d6ca346c0fd5ff3006f39bfea 100644 (file)
@@ -242,7 +242,7 @@ public:
                overall_panel->SetSizer (main_sizer);
 
                /* Instantly save any config changes when using a DCP-o-matic GUI */
-               Config::instance()->Changed.connect (boost::bind (&Config::write, Config::instance ()));
+               Config::instance()->Changed.connect(boost::bind(&DOMFrame::config_changed, this, _1));
 
                _screens->ScreensChanged.connect(boost::bind(&DOMFrame::screens_changed, this));
                _create->Bind (wxEVT_BUTTON, bind (&DOMFrame::create_kdms, this));
@@ -265,6 +265,16 @@ public:
        }
 
 private:
+       void config_changed(Config::Property what)
+       {
+               /* Instantly save any config changes when using a DCP-o-matic GUI */
+               Config::instance()->write();
+
+               if (what == Config::CINEMAS_FILE) {
+                       _screens->update();
+               }
+       }
+
        void file_exit ()
        {
                /* false here allows the close handler to veto the close request */