summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-10-09 20:20:59 +0100
committerCarl Hetherington <cth@carlh.net>2018-10-09 20:20:59 +0100
commit23f2dc3bfb94930b938281c7f1e5663b761fa508 (patch)
treedd295cd45925133ce186d26bdc47eec6169960e3 /src
parent4042290c541734f529979ed45c19b0623a1d99c2 (diff)
Quell config-save warning when we're only trying to save history.
Diffstat (limited to 'src')
-rw-r--r--src/lib/config.cc2
-rw-r--r--src/lib/config.h1
-rw-r--r--src/tools/dcpomatic_player.cc20
3 files changed, 13 insertions, 10 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc
index 1d83f0a25..eb13112d2 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -1083,7 +1083,7 @@ Config::add_to_history_internal (vector<boost::filesystem::path>& h, boost::file
h.pop_back ();
}
- changed ();
+ changed (HISTORY);
}
bool
diff --git a/src/lib/config.h b/src/lib/config.h
index a470bf391..94690a727 100644
--- a/src/lib/config.h
+++ b/src/lib/config.h
@@ -78,6 +78,7 @@ public:
SOUND_OUTPUT,
INTERFACE_COMPLEXITY,
PLAYER_DCP_DIRECTORY,
+ HISTORY,
#ifdef DCPOMATIC_VARIANT_SWAROOP
PLAYER_BACKGROUND_IMAGE,
#endif
diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc
index cc6e294ff..c20c3cbd8 100644
--- a/src/tools/dcpomatic_player.cc
+++ b/src/tools/dcpomatic_player.cc
@@ -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,