Quell config-save warning when we're only trying to save history.
authorCarl Hetherington <cth@carlh.net>
Tue, 9 Oct 2018 19:20:59 +0000 (20:20 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 9 Oct 2018 19:20:59 +0000 (20:20 +0100)
src/lib/config.cc
src/lib/config.h
src/tools/dcpomatic_player.cc

index 1d83f0a257b48c8b33da3d534930d7afa6c5869e..eb13112d2556d101533cdea9e85d5a575be41274 100644 (file)
@@ -1083,7 +1083,7 @@ Config::add_to_history_internal (vector<boost::filesystem::path>& h, boost::file
                h.pop_back ();
        }
 
-       changed ();
+       changed (HISTORY);
 }
 
 bool
index a470bf391ab02bdefed27c1d9cf81b7d08e3e261..94690a72709d9a8f1c615b89a428f57e8e2e4095 100644 (file)
@@ -78,6 +78,7 @@ public:
                SOUND_OUTPUT,
                INTERFACE_COMPLEXITY,
                PLAYER_DCP_DIRECTORY,
+               HISTORY,
 #ifdef DCPOMATIC_VARIANT_SWAROOP
                PLAYER_BACKGROUND_IMAGE,
 #endif
index cc6e294ff6e0b2108a8e454b8ca3c72f00685001..c20c3cbd88d5490aab84ab5b7cccb046804e8a42 100644 (file)
@@ -137,7 +137,7 @@ public:
                SetIcon (wxIcon (std_to_wx ("id")));
 #endif
 
-               _config_changed_connection = Config::instance()->Changed.connect (boost::bind (&DOMFrame::config_changed, this));
+               _config_changed_connection = Config::instance()->Changed.connect (boost::bind (&DOMFrame::config_changed, this, _1));
                update_from_config ();
 
                Bind (wxEVT_MENU, boost::bind (&DOMFrame::file_open, this), ID_file_open);
@@ -835,19 +835,21 @@ private:
                _update_news_requested = false;
        }
 
-       void config_changed ()
+       void config_changed (Config::Property prop)
        {
                /* Instantly save any config changes when using the player GUI */
                try {
                        Config::instance()->write_config();
                } catch (FileError& e) {
-                       error_dialog (
-                               this,
-                               wxString::Format(
-                                       _("Could not write to config file at %s.  Your changes have not been saved."),
-                                       std_to_wx(e.file().string())
-                                       )
-                               );
+                       if (prop != Config::HISTORY) {
+                               error_dialog (
+                                       this,
+                                       wxString::Format(
+                                               _("Could not write to config file at %s.  Your changes have not been saved."),
+                                               std_to_wx(e.file().string())
+                                               )
+                                       );
+                       }
                } catch (exception& e) {
                        error_dialog (
                                this,