+ auto config = Config::instance();
+ switch (reason) {
+ case Config::BAD_SIGNER_UTF8_STRINGS:
+ {
+ if (config->nagged(Config::NAG_BAD_SIGNER_CHAIN_UTF8)) {
+ return false;
+ }
+ auto d = new RecreateChainDialog (
+ _frame, _("Recreate signing certificates"),
+ _("The certificate chain that DCP-o-matic uses for signing DCPs and KDMs contains a small error\n"
+ "which will prevent DCPs from being validated correctly on some systems. Do you want to re-create\n"
+ "the certificate chain for signing DCPs and KDMs?"),
+ _("Do nothing"),
+ Config::NAG_BAD_SIGNER_CHAIN_UTF8
+ );
+ int const r = d->ShowModal ();
+ d->Destroy ();
+ return r == wxID_OK;
+ }
+ case Config::BAD_SIGNER_VALIDITY_TOO_LONG:
+ {
+ if (config->nagged(Config::NAG_BAD_SIGNER_CHAIN_VALIDITY)) {
+ return false;
+ }
+ auto d = new RecreateChainDialog (
+ _frame, _("Recreate signing certificates"),
+ _("The certificate chain that DCP-o-matic uses for signing DCPs and KDMs has a validity period\n"
+ "that is too long. This will cause problems playing back DCPs on some systems.\n"
+ "Do you want to re-create the certificate chain for signing DCPs and KDMs?"),
+ _("Do nothing"),
+ Config::NAG_BAD_SIGNER_CHAIN_VALIDITY
+ );
+ int const r = d->ShowModal ();
+ d->Destroy ();
+ return r == wxID_OK;
+ }
+ case Config::BAD_SIGNER_INCONSISTENT:
+ {
+ auto d = new RecreateChainDialog (
+ _frame, _("Recreate signing certificates"),
+ _("The certificate chain that DCP-o-matic uses for signing DCPs and KDMs is inconsistent and\n"
+ "cannot be used. DCP-o-matic cannot start unless you re-create it. Do you want to re-create\n"
+ "the certificate chain for signing DCPs and KDMs?"),
+ _("Close DCP-o-matic")
+ );
+ int const r = d->ShowModal ();
+ d->Destroy ();
+ if (r != wxID_OK) {
+ exit (EXIT_FAILURE);
+ }
+ return true;
+ }
+ case Config::BAD_DECRYPTION_INCONSISTENT:
+ {
+ auto d = new RecreateChainDialog (
+ _frame, _("Recreate KDM decryption chain"),
+ _("The certificate chain that DCP-o-matic uses for decrypting KDMs is inconsistent and\n"
+ "cannot be used. DCP-o-matic cannot start unless you re-create it. Do you want to re-create\n"
+ "the certificate chain for decrypting KDMs? You may want to say \"No\" here and back up your\n"
+ "configuration before continuing."),
+ _("Close DCP-o-matic")
+ );
+ int const r = d->ShowModal ();
+ d->Destroy ();
+ if (r != wxID_OK) {
+ exit (EXIT_FAILURE);
+ }
+ return true;
+ }
+ default:
+ DCPOMATIC_ASSERT (false);
+ }