catch (std::exception& e) {
wxString p = std_to_wx (file.string ());
wxCharBuffer b = p.ToUTF8 ();
- error_dialog (this, wxString::Format (_("Could not open film at %s (%s)"), p.data(), std_to_wx (e.what()).data()));
+ error_dialog (this, wxString::Format (_("Could not open film at %s"), p.data()), std_to_wx (e.what()));
}
void set_film (shared_ptr<Film> film)
_film->write_metadata ();
_film->make_dcp ();
} catch (BadSettingError& e) {
- error_dialog (this, wxString::Format (_("Bad setting for %s (%s)"), std_to_wx(e.setting()).data(), std_to_wx(e.what()).data()));
+ error_dialog (this, wxString::Format (_("Bad setting for %s."), std_to_wx(e.setting()).data()), std_to_wx(e.what()));
} catch (std::exception& e) {
- error_dialog (this, wxString::Format (_("Could not make DCP: %s."), std_to_wx(e.what()).data()));
+ error_dialog (this, wxString::Format (_("Could not make DCP.")), std_to_wx(e.what()));
}
}
if (WEXITSTATUS (r) == 0) {
r = system (String::compose("nautilus \"%1\"", _film->directory()->string()).c_str());
if (WEXITSTATUS (r)) {
- error_dialog (this, _("Could not show DCP (could not run nautilus)"));
+ error_dialog (this, _("Could not show DCP."), _("Could not run nautilus"));
}
} else {
int r = system ("which konqueror");
if (WEXITSTATUS (r) == 0) {
r = system (String::compose ("konqueror \"%1\"", _film->directory()->string()).c_str());
if (WEXITSTATUS (r)) {
- error_dialog (this, _("Could not show DCP (could not run konqueror)"));
+ error_dialog (this, _("Could not show DCP"), _("Could not run konqueror"));
}
}
}
try {
_frame->load_film (_film_to_load);
} catch (exception& e) {
- error_dialog (0, std_to_wx (String::compose (wx_to_std (_("Could not load film %1 (%2)")), _film_to_load, e.what())));
+ error_dialog (0, std_to_wx (String::compose (wx_to_std (_("Could not load film %1 (%2)")), _film_to_load)), std_to_wx(e.what()));
}
}
}
catch (exception& e)
{
- error_dialog (0, wxString::Format ("DCP-o-matic could not start: %s", e.what ()));
+ error_dialog (0, wxString::Format ("DCP-o-matic could not start."), std_to_wx(e.what()));
return true;
}
} catch (std::exception& e) {
wxString p = std_to_wx (path.string ());
wxCharBuffer b = p.ToUTF8 ();
- error_dialog (this, wxString::Format (_("Could not open film at %s (%s)"), p.data(), std_to_wx (e.what()).data()));
+ error_dialog (this, wxString::Format (_("Could not open film at %s"), p.data()), std_to_wx(e.what()));
}
}
film->make_dcp ();
} catch (exception& e) {
error_dialog (
- 0, std_to_wx (
- String::compose (
- wx_to_std (_("Could not load film %1 (%2)")), i.string(),
- e.what()
- )
- )
+ 0,
+ std_to_wx (String::compose (wx_to_std (_("Could not load film %1")), i.string())),
+ std_to_wx(e.what())
);
}
}
} catch (dcp::NotEncryptedError& e) {
error_dialog (this, _("CPL's content is not encrypted."));
} catch (exception& e) {
- error_dialog (this, e.what ());
+ error_dialog (this, std_to_wx(e.what()));
} catch (...) {
error_dialog (this, _("An unknown exception occurred."));
}
} catch (dcp::KDMFormatError& e) {
error_dialog (
this,
- wxString::Format (
- _("Could not read file as a KDM. Perhaps it is badly formatted, or not a KDM at all.\n\n%s"),
- std_to_wx(e.what()).data()
- )
+ _("Could not read file as a KDM. Perhaps it is badly formatted, or not a KDM at all."),
+ std_to_wx(e.what())
);
return;
} catch (dcp::KDMDecryptionError) {
}
catch (exception& e)
{
- error_dialog (0, wxString::Format ("DCP-o-matic could not start: %s", e.what ()));
+ error_dialog (0, _("DCP-o-matic could not start"), std_to_wx(e.what()));
return true;
}
dcp->add_kdm (dcp::EncryptedKDM (dcp::file_to_string (wx_to_std (d->GetPath ()), MAX_KDM_SIZE)));
dcp->examine (shared_ptr<Job>());
} catch (exception& e) {
- error_dialog (this, wxString::Format (_("Could not load KDM (%s)"), std_to_wx(e.what())));
+ error_dialog (this, wxString::Format (_("Could not load KDM.")), std_to_wx(e.what()));
d->Destroy ();
return;
}
try {
_frame->load_dcp (_dcp_to_load);
} catch (exception& e) {
- error_dialog (0, std_to_wx (String::compose (wx_to_std (_("Could not load DCP %1 (%2)")), _dcp_to_load, e.what())));
+ error_dialog (0, std_to_wx (String::compose (wx_to_std (_("Could not load DCP %1.")), _dcp_to_load)), std_to_wx(e.what()));
}
}
}
catch (exception& e)
{
- error_dialog (0, wxString::Format ("DCP-o-matic Player could not start: %s", std_to_wx(e.what())));
+ error_dialog (0, _("DCP-o-matic Player could not start."), std_to_wx(e.what()));
return true;
}
try {
extra = c.read_string (dcp::file_to_string (wx_to_std (d->GetPath ())));
} catch (boost::filesystem::filesystem_error& e) {
- error_dialog (this, wxString::Format (_("Could not import certificate (%s)"), d->GetPath().data()));
+ error_dialog (this, _("Could not import certificate (%s)"), d->GetPath());
d->Destroy ();
return;
}
update_certificate_list ();
}
} catch (dcp::MiscError& e) {
- error_dialog (this, wxString::Format (_("Could not read certificate file (%s)"), e.what ()));
+ error_dialog (this, _("Could not read certificate file."), std_to_wx(e.what()));
}
}
_set (chain);
update_private_key ();
} catch (dcp::MiscError& e) {
- error_dialog (this, wxString::Format (_("Could not read certificate file (%s)"), e.what ()));
+ error_dialog (this, _("Could not read certificate file."), std_to_wx(e.what()));
}
}
try {
dcp->add_kdm (dcp::EncryptedKDM (dcp::file_to_string (wx_to_std (d->GetPath ()), MAX_KDM_SIZE)));
} catch (exception& e) {
- error_dialog (_parent, wxString::Format (_("Could not load KDM (%s)"), e.what ()));
+ error_dialog (_parent, wxString::Format (_("Could not load KDM.")), std_to_wx(e.what()));
d->Destroy ();
return;
}
try {
_certificate = dcp::Certificate (dcp::file_to_string (file));
} catch (dcp::MiscError& e) {
- error_dialog (this, wxString::Format (_("Could not read certificate file (%s)"), std_to_wx(e.what()).data()));
+ error_dialog (this, _("Could not read certificate file."), std_to_wx(e.what()));
}
}
#endif
error_dialog (
this,
- wxString::Format (_("Could not set up audio output (%s). There will be no audio during the preview."), e.what())
+ _("Could not set up audio output. There will be no audio during the preview."), std_to_wx(e.what())
);
}
recreate_butler ();
{
string s = _job->error_summary();
s[0] = toupper (s[0]);
- error_dialog (_parent, std_to_wx (String::compose ("%1.\n\n%2", s, _job->error_details())));
+ error_dialog (_parent, std_to_wx(s), std_to_wx(_job->error_details()));
}
void
} catch (dcp::NotEncryptedError& e) {
error_dialog (this, _("CPL's content is not encrypted."));
} catch (exception& e) {
- error_dialog (this, e.what ());
+ error_dialog (this, std_to_wx(e.what()));
} catch (...) {
error_dialog (this, _("An unknown exception occurred."));
}
dcp::CertificateChain c (dcp::file_to_string (file));
set_recipient (c.leaf ());
} catch (dcp::MiscError& e) {
- error_dialog (this, wxString::Format (_("Could not read certificate file (%s)"), std_to_wx(e.what()).data()));
+ error_dialog (this, wxString::Format (_("Could not read certificate file.")), std_to_wx(e.what()));
}
}
/** Pop up an error dialogue box.
* @param parent Parent.
* @param m Message.
+ * @param e Extended message.
*/
void
-error_dialog (wxWindow* parent, wxString m)
+error_dialog (wxWindow* parent, wxString m, optional<wxString> e)
{
wxMessageDialog* d = new wxMessageDialog (parent, m, _("DCP-o-matic"), wxOK | wxICON_ERROR);
+ if (e) {
+ d->SetExtendedMessage (*e);
+ }
d->ShowModal ();
d->Destroy ();
}
*/
#define S_(x) context_translation(x)
-extern void error_dialog (wxWindow *, wxString);
+extern void error_dialog (wxWindow *, wxString, boost::optional<wxString> e = boost::optional<wxString>());
extern void message_dialog (wxWindow *, wxString);
extern bool confirm_dialog (wxWindow *, wxString);
extern wxStaticText* add_label_to_sizer (wxSizer *, wxWindow *, wxString, bool left, int prop = 0);