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/tools | |
| parent | 49281333410c321e616c5d3cfd4308e21d0c9cb4 (diff) | |
Separate readable error from technical detail in some places.
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/dcpomatic.cc | 14 | ||||
| -rw-r--r-- | src/tools/dcpomatic_batch.cc | 11 | ||||
| -rw-r--r-- | src/tools/dcpomatic_kdm.cc | 10 | ||||
| -rw-r--r-- | src/tools/dcpomatic_player.cc | 6 |
4 files changed, 18 insertions, 23 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index b731828f4..15babbb61 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -386,7 +386,7 @@ public: 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) @@ -627,9 +627,9 @@ private: _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())); } } @@ -800,14 +800,14 @@ private: 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")); } } } @@ -1285,7 +1285,7 @@ private: 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())); } } @@ -1316,7 +1316,7 @@ private: } 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; } diff --git a/src/tools/dcpomatic_batch.cc b/src/tools/dcpomatic_batch.cc index 7a4f50622..827229e8f 100644 --- a/src/tools/dcpomatic_batch.cc +++ b/src/tools/dcpomatic_batch.cc @@ -137,7 +137,7 @@ public: } 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())); } } @@ -337,12 +337,9 @@ class App : public wxApp 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()) ); } } diff --git a/src/tools/dcpomatic_kdm.cc b/src/tools/dcpomatic_kdm.cc index b82cec2ad..866d09c70 100644 --- a/src/tools/dcpomatic_kdm.cc +++ b/src/tools/dcpomatic_kdm.cc @@ -356,7 +356,7 @@ private: } 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.")); } @@ -423,10 +423,8 @@ private: } 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) { @@ -603,7 +601,7 @@ private: } 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; } diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc index 0464ce96e..a75f6b9f4 100644 --- a/src/tools/dcpomatic_player.cc +++ b/src/tools/dcpomatic_player.cc @@ -291,7 +291,7 @@ private: 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; } @@ -482,7 +482,7 @@ private: 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())); } } @@ -496,7 +496,7 @@ private: } 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; } |
