diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-01-12 22:30:43 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-01-12 22:30:43 +0000 |
| commit | f1dbcec7552052856369631e77c5eb160badd619 (patch) | |
| tree | 6fa9d8f36fe525fc32e8e88e8ae703d756fc1b43 /src/wx | |
| parent | 49281333410c321e616c5d3cfd4308e21d0c9cb4 (diff) | |
Separate readable error from technical detail in some places.
Diffstat (limited to 'src/wx')
| -rw-r--r-- | src/wx/config_dialog.cc | 6 | ||||
| -rw-r--r-- | src/wx/content_menu.cc | 2 | ||||
| -rw-r--r-- | src/wx/download_certificate_panel.cc | 2 | ||||
| -rw-r--r-- | src/wx/film_viewer.cc | 2 | ||||
| -rw-r--r-- | src/wx/job_view.cc | 2 | ||||
| -rw-r--r-- | src/wx/kdm_output_panel.cc | 2 | ||||
| -rw-r--r-- | src/wx/screen_dialog.cc | 2 | ||||
| -rw-r--r-- | src/wx/wx_util.cc | 6 | ||||
| -rw-r--r-- | src/wx/wx_util.h | 2 |
9 files changed, 15 insertions, 11 deletions
diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index fb80963f4..4b8e44f92 100644 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@ -455,7 +455,7 @@ CertificateChainEditor::add_certificate () 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; } @@ -481,7 +481,7 @@ CertificateChainEditor::add_certificate () 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())); } } @@ -675,7 +675,7 @@ CertificateChainEditor::import_private_key () _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())); } } diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc index 68443c0cf..2a9183134 100644 --- a/src/wx/content_menu.cc +++ b/src/wx/content_menu.cc @@ -377,7 +377,7 @@ ContentMenu::kdm () 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; } diff --git a/src/wx/download_certificate_panel.cc b/src/wx/download_certificate_panel.cc index 6c01b0d3f..4052e44a6 100644 --- a/src/wx/download_certificate_panel.cc +++ b/src/wx/download_certificate_panel.cc @@ -53,7 +53,7 @@ DownloadCertificatePanel::load (boost::filesystem::path file) 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())); } } diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index 3b6ea5b39..ebd929ff9 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -770,7 +770,7 @@ FilmViewer::config_changed (Config::Property p) #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 (); diff --git a/src/wx/job_view.cc b/src/wx/job_view.cc index 4aa2e3c2b..a36d6de8a 100644 --- a/src/wx/job_view.cc +++ b/src/wx/job_view.cc @@ -125,7 +125,7 @@ JobView::details_clicked (wxCommandEvent &) { 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 diff --git a/src/wx/kdm_output_panel.cc b/src/wx/kdm_output_panel.cc index 0b99ee465..1a4a209ca 100644 --- a/src/wx/kdm_output_panel.cc +++ b/src/wx/kdm_output_panel.cc @@ -287,7 +287,7 @@ KDMOutputPanel::make ( } 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.")); } diff --git a/src/wx/screen_dialog.cc b/src/wx/screen_dialog.cc index 8bf2d0e41..e6c2b6dd8 100644 --- a/src/wx/screen_dialog.cc +++ b/src/wx/screen_dialog.cc @@ -155,7 +155,7 @@ ScreenDialog::load_recipient (boost::filesystem::path file) 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())); } } diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index d732e03d3..e017f404d 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -85,11 +85,15 @@ add_label_to_sizer (wxGridBagSizer* s, wxWindow* p, wxString t, bool, wxGBPositi /** 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 (); } diff --git a/src/wx/wx_util.h b/src/wx/wx_util.h index dbd8e117a..e36a35e1e 100644 --- a/src/wx/wx_util.h +++ b/src/wx/wx_util.h @@ -69,7 +69,7 @@ class wxSplashScreen; */ #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); |
