Config* Config::_instance = 0;
int const Config::_current_version = 3;
-boost::signals2::signal<void ()> Config::FailedToLoad;
+boost::signals2::signal<void (string)> Config::FailedToLoad;
boost::signals2::signal<void (string)> Config::Warning;
boost::signals2::signal<bool (Config::BadReason)> Config::Bad;
read_cinemas (f);
}
}
+catch (exception& e) {
+ if (have_existing ("config.xml")) {
+ backup ();
+ /* We have a config file but it didn't load */
+ FailedToLoad (e.what());
+ }
+ set_defaults ();
+ /* Make a new set of signing certificates and key */
+ _signer_chain = create_certificate_chain ();
+ /* And similar for decryption of KDMs */
+ _decryption_chain = create_certificate_chain ();
+ write ();
+}
catch (...) {
if (have_existing ("config.xml")) {
backup ();
/* We have a config file but it didn't load */
- FailedToLoad ();
+ FailedToLoad ("unknown");
}
set_defaults ();
/* Make a new set of signing certificates and key */
/** Emitted if read() failed on an existing Config file. There is nothing
a listener can do about it: this is just for information.
*/
- static boost::signals2::signal<void ()> FailedToLoad;
+ static boost::signals2::signal<void (std::string)> FailedToLoad;
/** Emitted if read() issued a warning which the user might want to know about */
static boost::signals2::signal<void (std::string)> Warning;
/** Emitted if there is a something wrong the contents of our config. Handler can call
try {
wxInitAllImageHandlers ();
- Config::FailedToLoad.connect (boost::bind (&App::config_failed_to_load, this));
+ Config::FailedToLoad.connect (boost::bind (&App::config_failed_to_load, this, _1));
Config::Warning.connect (boost::bind (&App::config_warning, this, _1));
_splash = maybe_show_splash ();