#include "isdcf_metadata.h"
#include "types.h"
+#include "state.h"
#include "edid.h"
#include <dcp/name_format.h>
#include <dcp/certificate_chain.h>
/** @class Config
* @brief A singleton class holding configuration.
*/
-class Config : public boost::noncopyable
+class Config : public State
{
public:
/** @return number of threads which a master DoM should use for J2K encoding on the local machine */
return _only_servers_encode;
}
- Protocol tms_protocol () const {
+ FileTransferProtocol tms_protocol () const {
return _tms_protocol;
}
return _mail_port;
}
+ EmailProtocol mail_protocol () const {
+ return _mail_protocol;
+ }
+
std::string mail_user () const {
return _mail_user;
}
/* Not really a nag but it's the same idea */
NAG_INITIAL_SETUP,
NAG_IMPORT_DECRYPTION_CHAIN,
+ NAG_DELETE_DKDM,
NAG_COUNT
};
maybe_set (_only_servers_encode, o);
}
- void set_tms_protocol (Protocol p) {
+ void set_tms_protocol (FileTransferProtocol p) {
maybe_set (_tms_protocol, p);
}
maybe_set (_mail_port, p);
}
+ void set_mail_protocol (EmailProtocol p) {
+ maybe_set (_mail_protocol, p);
+ }
+
void set_mail_user (std::string u) {
maybe_set (_mail_user, u);
}
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;
- /** Emitted if there is a bad certificate in the signer chain. Handler can call
- * true to ask Config to re-create the chain.
+ /** Emitted if there is a something wrong the contents of our config. Handler can call
+ * true to ask Config to solve the problem (by discarding and recreating the bad thing)
*/
- static boost::signals2::signal<bool (void)> BadSignerChain;
+ enum BadReason {
+ BAD_SIGNER_UTF8_STRINGS, ///< signer chain contains UTF-8 strings (not PRINTABLESTRING)
+ BAD_SIGNER_INCONSISTENT, ///< signer chain is somehow inconsistent
+ BAD_DECRYPTION_INCONSISTENT, ///< KDM decryption chain is somehow inconsistent
+ };
+
+ static boost::signals2::signal<bool (BadReason)> Bad;
void write () const;
void write_config () const;
static void restore_defaults ();
static bool have_existing (std::string);
static boost::filesystem::path config_file ();
- static boost::filesystem::path path (std::string file, bool create_directories = true);
-
- /** If set, this overrides the standard path (in home, Library, AppData or wherever) for config.xml and cinemas.xml */
- static boost::optional<boost::filesystem::path> override_path;
private:
Config ();
/** J2K encoding servers that should definitely be used */
std::vector<std::string> _servers;
bool _only_servers_encode;
- Protocol _tms_protocol;
+ FileTransferProtocol _tms_protocol;
/** The IP address of a TMS that we can copy DCPs to */
std::string _tms_ip;
/** The path on a TMS that we should write DCPs to */
std::list<boost::shared_ptr<Cinema> > _cinemas;
std::string _mail_server;
int _mail_port;
+ EmailProtocol _mail_protocol;
std::string _mail_user;
std::string _mail_password;
std::string _kdm_subject;