diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-08-19 23:57:24 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-08-19 23:57:24 +0100 |
| commit | 8f3743d18026b59b1ecd8e8f4d12cc59273eb1ed (patch) | |
| tree | 9a3a07b554898e2089e1ba897f64fdefcb14db64 /src/lib | |
| parent | 26cd966b7ae60673dd597eafa75860a5b5eb74c6 (diff) | |
Cope nicely if the user has a configured default container ratio which is now disallowed.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/config.cc | 12 | ||||
| -rw-r--r-- | src/lib/config.h | 2 | ||||
| -rw-r--r-- | src/lib/ratio.h | 4 |
3 files changed, 15 insertions, 3 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc index f7456e269..f595b960a 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -64,6 +64,7 @@ using dcp::raw_convert; Config* Config::_instance = 0; boost::signals2::signal<void ()> Config::FailedToLoad; +boost::signals2::signal<void (string)> Config::Warning; /** Construct default configuration */ Config::Config () @@ -225,6 +226,11 @@ try _default_container = Ratio::from_id (c.get ()); } + if (_default_container && !_default_container->used_for_container()) { + Warning (_("Your default container is not valid and has been changed to Flat (1.85:1)")); + _default_container = Ratio::from_id ("185"); + } + c = f.optional_string_child ("DefaultScaleTo"); if (c) { _default_scale_to = Ratio::from_id (c.get ()); @@ -475,9 +481,9 @@ Config::write_config () const root->add_child("Language")->add_child_text (_language.get()); } if (_default_container) { - /* [XML:opt] DefaultContainer ID of default container to use when creating new films (<code>119</code>, <code>133</code>, - <code>138</code>, <code>143</code>, <code>166</code>, <code>178</code>, <code>185</code>, <code>235</code>, - <code>239</code> or <code>full-frame</code>). + /* [XML:opt] DefaultContainer ID of default container + * to use when creating new films (<code>185</code>,<code>239</code> or + * <code>full-frame</code>). */ root->add_child("DefaultContainer")->add_child_text (_default_container->id ()); } diff --git a/src/lib/config.h b/src/lib/config.h index b850e99a7..0a81dee51 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -625,6 +625,8 @@ public: a listener can do about it: this is just for information. */ static boost::signals2::signal<void ()> FailedToLoad; + /** Emitted if read() issued a warning which the user might want to know about */ + static boost::signals2::signal<void (std::string)> Warning; void write () const; void write_config () const; diff --git a/src/lib/ratio.h b/src/lib/ratio.h index 42f29458a..a6f2bbd73 100644 --- a/src/lib/ratio.h +++ b/src/lib/ratio.h @@ -46,6 +46,10 @@ public: std::string container_nickname () const; + bool used_for_container () const { + return static_cast<bool> (_container_nickname); + } + std::string isdcf_name () const { return _isdcf_name; } |
