diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-04-26 11:53:40 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-04-26 11:53:40 +0200 |
| commit | 74e944d9ba137386efff089f9906e64d255836c9 (patch) | |
| tree | e4b15b1d1164c069b6df036f4f4c0316c665a7e1 /src | |
| parent | 17ef19940f152ceeb2e1ad696dd5e7ac5917d8cd (diff) | |
Allow customisation of error report email address.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/constants.h | 1 | ||||
| -rw-r--r-- | src/lib/job.cc | 8 | ||||
| -rw-r--r-- | src/lib/util.cc | 7 | ||||
| -rw-r--r-- | src/lib/util.h | 1 | ||||
| -rw-r--r-- | src/lib/variant.cc | 8 | ||||
| -rw-r--r-- | src/lib/variant.h | 2 | ||||
| -rw-r--r-- | src/tools/dcpomatic.cc | 23 | ||||
| -rw-r--r-- | src/tools/dcpomatic_combiner.cc | 14 | ||||
| -rw-r--r-- | src/tools/dcpomatic_disk.cc | 14 | ||||
| -rw-r--r-- | src/tools/dcpomatic_editor.cc | 14 | ||||
| -rw-r--r-- | src/tools/dcpomatic_kdm.cc | 18 | ||||
| -rw-r--r-- | src/tools/dcpomatic_player.cc | 14 | ||||
| -rw-r--r-- | src/tools/dcpomatic_playlist.cc | 20 | ||||
| -rw-r--r-- | src/tools/dcpomatic_verifier.cc | 17 | ||||
| -rw-r--r-- | src/wx/wx_util.cc | 6 | ||||
| -rw-r--r-- | src/wx/wx_util.h | 4 | ||||
| -rw-r--r-- | src/wx/wx_variant.cc | 7 | ||||
| -rw-r--r-- | src/wx/wx_variant.h | 2 |
18 files changed, 117 insertions, 63 deletions
diff --git a/src/lib/constants.h b/src/lib/constants.h index bfe144420..cfa156778 100644 --- a/src/lib/constants.h +++ b/src/lib/constants.h @@ -29,7 +29,6 @@ #define DCPOMATIC_HELLO "I mean really, Ray, it's used." /** Number of films to keep in history */ #define HISTORY_SIZE 10 -#define REPORT_PROBLEM _("Please report this problem by using Help -> Report a problem or via email to carl@dcpomatic.com") #define TEXT_FONT_ID "font" /** Largest KDM size (in bytes) that will be accepted */ #define MAX_KDM_SIZE (256 * 1024) diff --git a/src/lib/job.cc b/src/lib/job.cc index 94c23aac6..ee6ad4e70 100644 --- a/src/lib/job.cc +++ b/src/lib/job.cc @@ -167,7 +167,7 @@ Job::run_wrapper () if (!done) { set_error ( e.what (), - string (_("It is not known what caused this error.")) + " " + REPORT_PROBLEM + String::compose(_("It is not known what caused this error. %1"), report_problem()) ); } @@ -202,7 +202,7 @@ Job::run_wrapper () } else { set_error ( e.what (), - string (_("It is not known what caused this error.")) + " " + REPORT_PROBLEM + String::compose(_("It is not known what caused this error. %1"), report_problem()) ); } @@ -262,7 +262,7 @@ Job::run_wrapper () set_error ( e.what (), - string (_("It is not known what caused this error.")) + " " + REPORT_PROBLEM + String::compose(_("It is not known what caused this error. %1"), report_problem()) ); set_progress (1); @@ -272,7 +272,7 @@ Job::run_wrapper () set_error ( _("Unknown error"), - string (_("It is not known what caused this error.")) + " " + REPORT_PROBLEM + String::compose(_("It is not known what caused this error. %1"), report_problem()) ); set_progress (1); diff --git a/src/lib/util.cc b/src/lib/util.cc index b727d7b68..2f5c1ce49 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -1178,3 +1178,10 @@ screen_names_to_string(vector<string> names) return result.substr(0, result.length() - 2); } + +string +report_problem() +{ + return String::compose(_("Please report this problem by using Help -> Report a problem or via email to %1"), variant::report_problem_email()); +} + diff --git a/src/lib/util.h b/src/lib/util.h index 4f64369d3..eac855bef 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -116,4 +116,5 @@ number_attribute(cxml::ConstNodePtr node, std::string name1, std::string name2) extern std::string screen_names_to_string(std::vector<std::string> names); +extern std::string report_problem(); #endif diff --git a/src/lib/variant.cc b/src/lib/variant.cc index 4434993b1..829a7d6e6 100644 --- a/src/lib/variant.cc +++ b/src/lib/variant.cc @@ -36,6 +36,8 @@ static char const* _dcpomatic_playlist_editor = "DCP-o-matic Playlist Editor"; static char const* _dcpomatic_combiner = "DCP-o-matic Combiner"; static char const* _dcpomatic_batch_converter = "DCP-o-matic Batch Converter"; +static char const* _report_problem_email = "carl@dcpomatic.com"; + static bool const _show_splash = true; static bool const _show_tagline = true; static bool const _show_dcpomatic_website = true; @@ -155,3 +157,9 @@ variant::show_dcpomatic_website() return _show_dcpomatic_website; } +std::string +variant::report_problem_email() +{ + return _report_problem_email; +} + diff --git a/src/lib/variant.h b/src/lib/variant.h index f0482ca01..9bcbb234e 100644 --- a/src/lib/variant.h +++ b/src/lib/variant.h @@ -44,6 +44,8 @@ std::string dcpomatic_app(); std::string dcpomatic_batch_converter_app(); std::string dcpomatic_player_app(); +std::string report_problem_email(); + bool show_splash(); bool show_tagline(); bool show_dcpomatic_website(); diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index de4ddebc2..a1b2cf750 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -1865,31 +1865,34 @@ private: error_dialog ( nullptr, wxString::Format( - _("An exception occurred: %s (%s)\n\n") + REPORT_PROBLEM, - std_to_wx (e.what()), - std_to_wx (e.file().string().c_str()) + _("An exception occurred: %s (%s)\n\n%s"), + std_to_wx(e.what()), + std_to_wx(e.file().string().c_str()), + wx::report_problem() ) ); } catch (boost::filesystem::filesystem_error& e) { error_dialog ( nullptr, wxString::Format( - _("An exception occurred: %s (%s) (%s)\n\n") + REPORT_PROBLEM, - std_to_wx (e.what()), - std_to_wx (e.path1().string()), - std_to_wx (e.path2().string()) + _("An exception occurred: %s (%s) (%s)\n\n%s"), + std_to_wx(e.what()), + std_to_wx(e.path1().string()), + std_to_wx(e.path2().string()), + wx::report_problem() ) ); } catch (exception& e) { error_dialog ( nullptr, wxString::Format( - _("An exception occurred: %s.\n\n") + REPORT_PROBLEM, - std_to_wx (e.what ()) + _("An exception occurred: %s.\n\n%s"), + std_to_wx(e.what()), + wx::report_problem() ) ); } catch (...) { - error_dialog (0, _("An unknown exception occurred.") + " " + REPORT_PROBLEM); + error_dialog(nullptr, _("An unknown exception occurred.") + " " + wx::report_problem()); } } diff --git a/src/tools/dcpomatic_combiner.cc b/src/tools/dcpomatic_combiner.cc index a28e063e5..26ca0022b 100644 --- a/src/tools/dcpomatic_combiner.cc +++ b/src/tools/dcpomatic_combiner.cc @@ -297,21 +297,23 @@ public: error_dialog ( 0, wxString::Format( - _("An exception occurred: %s (%s)\n\n") + REPORT_PROBLEM, - std_to_wx (e.what()), - std_to_wx (e.file().string().c_str ()) + _("An exception occurred: %s (%s)\n\n%s"), + std_to_wx(e.what()), + std_to_wx(e.file().string().c_str()), + wx::report_problem() ) ); } catch (exception& e) { error_dialog ( 0, wxString::Format( - _("An exception occurred: %s.\n\n") + REPORT_PROBLEM, - std_to_wx (e.what ()) + _("An exception occurred: %s\n\n%s"), + std_to_wx(e.what()), + wx::report_problem() ) ); } catch (...) { - error_dialog (nullptr, _("An unknown exception occurred.") + " " + REPORT_PROBLEM); + error_dialog(nullptr, _("An unknown exception occurred.") + " " + wx::report_problem()); } } diff --git a/src/tools/dcpomatic_disk.cc b/src/tools/dcpomatic_disk.cc index cd07f935d..a20a062e3 100644 --- a/src/tools/dcpomatic_disk.cc +++ b/src/tools/dcpomatic_disk.cc @@ -569,21 +569,23 @@ public: error_dialog ( 0, wxString::Format ( - _("An exception occurred: %s (%s)\n\n") + REPORT_PROBLEM, - std_to_wx (e.what()), - std_to_wx (e.file().string().c_str ()) + _("An exception occurred: %s (%s)\n\n%s"), + std_to_wx(e.what()), + std_to_wx(e.file().string().c_str()), + wx::report_problem() ) ); } catch (exception& e) { error_dialog ( 0, wxString::Format ( - _("An exception occurred: %s.\n\n") + REPORT_PROBLEM, - std_to_wx (e.what ()) + _("An exception occurred: %s.\n\n%s"), + std_to_wx(e.what()), + wx::report_problem() ) ); } catch (...) { - error_dialog (0, _("An unknown exception occurred.") + " " + REPORT_PROBLEM); + error_dialog(nullptr, _("An unknown exception occurred.") + " " + wx::report_problem()); } } diff --git a/src/tools/dcpomatic_editor.cc b/src/tools/dcpomatic_editor.cc index fc04ce017..47c7bac14 100644 --- a/src/tools/dcpomatic_editor.cc +++ b/src/tools/dcpomatic_editor.cc @@ -527,21 +527,23 @@ private: error_dialog ( 0, wxString::Format ( - _("An exception occurred: %s (%s)\n\n") + REPORT_PROBLEM, - std_to_wx (e.what()), - std_to_wx (e.file().string().c_str ()) + _("An exception occurred: %s (%s)\n\n%s"), + std_to_wx(e.what()), + std_to_wx(e.file().string().c_str()), + wx::report_problem() ) ); } catch (exception& e) { error_dialog ( 0, wxString::Format ( - _("An exception occurred: %s.\n\n") + REPORT_PROBLEM, - std_to_wx (e.what ()) + _("An exception occurred: %s\n\n%s"), + std_to_wx(e.what()), + wx::report_problem() ) ); } catch (...) { - error_dialog (0, _("An unknown exception occurred.") + " " + REPORT_PROBLEM); + error_dialog(nullptr, _("An unknown exception occurred.") + " " + wx::report_problem()); } } diff --git a/src/tools/dcpomatic_kdm.cc b/src/tools/dcpomatic_kdm.cc index 7838e145d..b333f5327 100644 --- a/src/tools/dcpomatic_kdm.cc +++ b/src/tools/dcpomatic_kdm.cc @@ -920,23 +920,25 @@ private: throw; } catch (FileError& e) { error_dialog ( - 0, + nullptr, wxString::Format ( - _("An exception occurred: %s (%s)\n\n") + REPORT_PROBLEM, - std_to_wx (e.what()), - std_to_wx (e.file().string().c_str ()) + _("An exception occurred: %s (%s)\n\n%s"), + std_to_wx(e.what()), + std_to_wx(e.file().string().c_str()), + wx::report_problem() ) ); } catch (exception& e) { error_dialog ( nullptr, wxString::Format ( - _("An exception occurred: %s.\n\n") + " " + REPORT_PROBLEM, - std_to_wx(e.what()) + _("An exception occurred: %s.\n\n%s"), + std_to_wx(e.what()), + wx::report_problem() ) ); } catch (...) { - error_dialog (0, _("An unknown exception occurred.") + " " + REPORT_PROBLEM); + error_dialog(nullptr, _("An unknown exception occurred.") + " " + wx::report_problem()); } /* This will terminate the program */ @@ -945,7 +947,7 @@ private: void OnUnhandledException () override { - error_dialog (nullptr, _("An unknown exception occurred.") + " " + REPORT_PROBLEM); + error_dialog(nullptr, _("An unknown exception occurred.") + " " + wx::report_problem()); } void idle () diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc index dec07d4a8..b877f10cd 100644 --- a/src/tools/dcpomatic_player.cc +++ b/src/tools/dcpomatic_player.cc @@ -1329,21 +1329,23 @@ private: error_dialog ( 0, wxString::Format ( - _("An exception occurred: %s (%s)\n\n") + REPORT_PROBLEM, - std_to_wx (e.what()), - std_to_wx (e.file().string().c_str ()) + _("An exception occurred: %s (%s)\n\n%s"), + std_to_wx(e.what()), + std_to_wx(e.file().string().c_str()), + wx::report_problem() ) ); } catch (exception& e) { error_dialog ( 0, wxString::Format ( - _("An exception occurred: %s.\n\n") + REPORT_PROBLEM, - std_to_wx (e.what ()) + _("An exception occurred: %s\n\n%s"), + std_to_wx(e.what()), + wx::report_problem() ) ); } catch (...) { - error_dialog (0, _("An unknown exception occurred.") + " " + REPORT_PROBLEM); + error_dialog(nullptr, _("An unknown exception occurred.") + " " + wx::report_problem()); } } diff --git a/src/tools/dcpomatic_playlist.cc b/src/tools/dcpomatic_playlist.cc index 56cf07413..a50fab37d 100644 --- a/src/tools/dcpomatic_playlist.cc +++ b/src/tools/dcpomatic_playlist.cc @@ -697,21 +697,23 @@ private: error_dialog ( 0, wxString::Format ( - _("An exception occurred: %s (%s)\n\n") + REPORT_PROBLEM, - std_to_wx (e.what()), - std_to_wx (e.file().string().c_str ()) + _("An exception occurred: %s (%s)\n\n%s") + wx::report_problem(), + std_to_wx(e.what()), + std_to_wx(e.file().string().c_str()), + wx::report_problem() ) ); } catch (exception& e) { error_dialog ( - 0, - wxString::Format ( - _("An exception occurred: %s.\n\n") + " " + REPORT_PROBLEM, - std_to_wx (e.what ()) + nullptr, + wxString::Format( + _("An exception occurred: %s\n\n%s"), + std_to_wx(e.what()), + wx::report_problem() ) ); } catch (...) { - error_dialog (0, _("An unknown exception occurred.") + " " + REPORT_PROBLEM); + error_dialog(nullptr, _("An unknown exception occurred.") + " " + wx::report_problem()); } /* This will terminate the program */ @@ -720,7 +722,7 @@ private: void OnUnhandledException () override { - error_dialog (0, _("An unknown exception occurred.") + " " + REPORT_PROBLEM); + error_dialog(nullptr, _("An unknown exception occurred.") + " " + wx::report_problem()); } void idle () diff --git a/src/tools/dcpomatic_verifier.cc b/src/tools/dcpomatic_verifier.cc index 273403a4e..834ebefa1 100644 --- a/src/tools/dcpomatic_verifier.cc +++ b/src/tools/dcpomatic_verifier.cc @@ -201,31 +201,34 @@ private: error_dialog( nullptr, wxString::Format( - _("An exception occurred: %s (%s)\n\n") + REPORT_PROBLEM, + _("An exception occurred: %s (%s)\n\n%s"), std_to_wx(e.what()), - std_to_wx(e.file().string().c_str()) + std_to_wx(e.file().string().c_str()), + wx::report_problem() ) ); } catch (boost::filesystem::filesystem_error& e) { error_dialog( nullptr, wxString::Format( - _("An exception occurred: %s (%s) (%s)\n\n") + REPORT_PROBLEM, + _("An exception occurred: %s (%s) (%s)\n\n%s"), std_to_wx(e.what()), std_to_wx(e.path1().string()), - std_to_wx(e.path2().string()) + std_to_wx(e.path2().string()), + wx::report_problem() ) ); } catch (exception& e) { error_dialog( nullptr, wxString::Format( - _("An exception occurred: %s.\n\n") + REPORT_PROBLEM, - std_to_wx(e.what()) + _("An exception occurred: %s.\n\n%s"), + std_to_wx(e.what()), + wx::report_problem() ) ); } catch (...) { - error_dialog(nullptr, _("An unknown exception occurred.") + " " + REPORT_PROBLEM); + error_dialog(nullptr, _("An unknown exception occurred.") + " " + wx::report_problem()); } } diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index e85b74cc8..9a8d90162 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -831,3 +831,9 @@ report_config_load_failure(wxWindow* parent, Config::LoadFailure what) } } + +wxString +wx::report_problem() +{ + return std_to_wx(::report_problem()); +} diff --git a/src/wx/wx_util.h b/src/wx/wx_util.h index 89e3fe5a5..db1b3ae0c 100644 --- a/src/wx/wx_util.h +++ b/src/wx/wx_util.h @@ -146,6 +146,10 @@ struct Offset extern int get_offsets (std::vector<Offset>& offsets); +namespace wx { + extern wxString report_problem(); +} + extern void checked_set (FilePickerCtrl* widget, boost::filesystem::path value); extern void checked_set (wxDirPickerCtrl* widget, boost::filesystem::path value); diff --git a/src/wx/wx_variant.cc b/src/wx/wx_variant.cc index 690e3a330..96b00bba4 100644 --- a/src/wx/wx_variant.cc +++ b/src/wx/wx_variant.cc @@ -138,3 +138,10 @@ variant::wx::insert_dcpomatic_verifier(wxString const& s) { return wxString::Format(s, dcpomatic_verifier()); } + +wxString +variant::wx::report_problem_email() +{ + return std_to_wx(variant::report_problem_email()); +} + diff --git a/src/wx/wx_variant.h b/src/wx/wx_variant.h index 0121c5b11..bf2bcaee0 100644 --- a/src/wx/wx_variant.h +++ b/src/wx/wx_variant.h @@ -47,6 +47,8 @@ wxString insert_dcpomatic_player(wxString const& s); wxString insert_dcpomatic_playlist_editor(wxString const& s); wxString insert_dcpomatic_verifier(wxString const& s); +wxString report_problem_email(); + } } |
