diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-04-16 22:19:39 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-04-21 22:07:15 +0200 |
| commit | b87e2660d0776f3d1380532ff0d2f3a28ed9d764 (patch) | |
| tree | ebddcef5b9a22b4e4e7475e20abf484f8aabd671 /src/wx | |
| parent | 748b182f27eedb006cb8493e12a389fa1c5883e7 (diff) | |
Extract all uses of DCP-o-matic name to allow branding.
Diffstat (limited to 'src/wx')
| -rw-r--r-- | src/wx/about_dialog.cc | 5 | ||||
| -rw-r--r-- | src/wx/audio_dialog.cc | 5 | ||||
| -rw-r--r-- | src/wx/config_dialog.cc | 5 | ||||
| -rw-r--r-- | src/wx/content_panel.cc | 13 | ||||
| -rw-r--r-- | src/wx/content_view.cc | 3 | ||||
| -rw-r--r-- | src/wx/disk_warning_dialog.cc | 7 | ||||
| -rw-r--r-- | src/wx/dkdm_dialog.cc | 9 | ||||
| -rw-r--r-- | src/wx/full_config_dialog.cc | 43 | ||||
| -rw-r--r-- | src/wx/job_view.cc | 3 | ||||
| -rw-r--r-- | src/wx/kdm_dialog.cc | 9 | ||||
| -rw-r--r-- | src/wx/player_config_dialog.cc | 5 | ||||
| -rw-r--r-- | src/wx/playlist_controls.cc | 5 | ||||
| -rw-r--r-- | src/wx/playlist_editor_config_dialog.cc | 7 | ||||
| -rw-r--r-- | src/wx/screens_panel.cc | 19 | ||||
| -rw-r--r-- | src/wx/system_information_dialog.cc | 5 | ||||
| -rw-r--r-- | src/wx/try_unmount_dialog.cc | 8 | ||||
| -rw-r--r-- | src/wx/update_dialog.cc | 5 | ||||
| -rw-r--r-- | src/wx/wscript | 3 | ||||
| -rw-r--r-- | src/wx/wx_util.cc | 7 | ||||
| -rw-r--r-- | src/wx/wx_variant.cc | 140 | ||||
| -rw-r--r-- | src/wx/wx_variant.h | 52 |
21 files changed, 312 insertions, 46 deletions
diff --git a/src/wx/about_dialog.cc b/src/wx/about_dialog.cc index 8b1f8a038..28bee89b9 100644 --- a/src/wx/about_dialog.cc +++ b/src/wx/about_dialog.cc @@ -26,6 +26,7 @@ #include "about_dialog.h" #include "static_text.h" #include "wx_util.h" +#include "wx_variant.h" #include "lib/compose.hpp" #include "lib/version.h" #include <dcp/warnings.h> @@ -38,7 +39,7 @@ using std::vector; AboutDialog::AboutDialog (wxWindow* parent) - : wxDialog (parent, wxID_ANY, _("About DCP-o-matic")) + : wxDialog(parent, wxID_ANY, variant::wx::insert_dcpomatic(_("About %s"))) { auto overall_sizer = new wxBoxSizer (wxVERTICAL); auto sizer = new wxBoxSizer (wxVERTICAL); @@ -53,7 +54,7 @@ AboutDialog::AboutDialog (wxWindow* parent) wxFont version_font (*wxNORMAL_FONT); version_font.SetWeight (wxFONTWEIGHT_BOLD); - auto t = new StaticText (this, _("DCP-o-matic")); + auto t = new StaticText(this, variant::wx::dcpomatic()); t->SetFont (title_font); sizer->Add (t, wxSizerFlags().Centre().Border(wxALL, 16)); diff --git a/src/wx/audio_dialog.cc b/src/wx/audio_dialog.cc index 714bf78e4..1f7f3ad03 100644 --- a/src/wx/audio_dialog.cc +++ b/src/wx/audio_dialog.cc @@ -24,6 +24,7 @@ #include "check_box.h" #include "static_text.h" #include "wx_util.h" +#include "wx_variant.h" #include "lib/analyse_audio_job.h" #include "lib/audio_analysis.h" #include "lib/audio_content.h" @@ -166,9 +167,9 @@ AudioDialog::AudioDialog (wxWindow* parent, shared_ptr<Film> film, FilmViewer& v _film_content_connection = film->ContentChange.connect(boost::bind(&AudioDialog::content_change, this, _1, _3)); DCPOMATIC_ASSERT (film->directory()); if (content) { - SetTitle(wxString::Format(_("DCP-o-matic audio - %s"), std_to_wx(content->path(0).string()))); + SetTitle(wxString::Format(_("%s audio - %s"), variant::wx::dcpomatic(), std_to_wx(content->path(0).string()))); } else { - SetTitle(wxString::Format(_("DCP-o-matic audio - %s"), std_to_wx(film->directory().get().string()))); + SetTitle(wxString::Format(_("%s audio - %s"), variant::wx::dcpomatic(), std_to_wx(film->directory().get().string()))); } if (content) { diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index b4adc855e..04bb26c2e 100644 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@ -25,6 +25,7 @@ #include "dcpomatic_button.h" #include "nag_dialog.h" #include "static_text.h" +#include "wx_variant.h" #include "lib/constants.h" #include <dcp/file.h> #include <dcp/filesystem.h> @@ -148,7 +149,7 @@ GeneralPage::add_language_controls (wxGridBagSizer* table, int& r) ++r; auto restart = add_label_to_sizer ( - table, _panel, _("(restart DCP-o-matic to see language changes)"), false, wxGBPosition (r, 0), wxGBSpan (1, 2) + table, _panel, variant::wx::insert_dcpomatic(_("(restart %s to see language changes)")), false, wxGBPosition (r, 0), wxGBSpan (1, 2) ); wxFont font = restart->GetFont(); font.SetStyle (wxFONTSTYLE_ITALIC); @@ -792,7 +793,7 @@ KeysPage::import_decryption_chain_and_key () if (new_chain->chain_valid() && new_chain->private_key_valid()) { Config::instance()->set_decryption_chain(new_chain); } else { - error_dialog(_panel, _("Invalid DCP-o-matic export file")); + error_dialog(_panel, variant::wx::insert_dcpomatic(_("Invalid %s export file"))); } } diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index ed9c15c83..07a632b4a 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -31,6 +31,7 @@ #include "timing_panel.h" #include "video_panel.h" #include "wx_util.h" +#include "wx_variant.h" #include "lib/audio_content.h" #include "lib/case_insensitive_sorter.h" #include "lib/compose.hpp" @@ -673,10 +674,14 @@ ContentPanel::add_dcp(boost::filesystem::path dcp) } catch (ProjectFolderError &) { error_dialog ( _parent, - _( - "This looks like a DCP-o-matic project folder, which cannot be added to a different project. " - "Choose the DCP folder inside the DCP-o-matic project folder if that's what you want to import." - ) + wxString::Format( + _( + "This looks like a %s project folder, which cannot be added to a different project. " + "Choose the DCP folder inside the %s project folder if that's what you want to import." + ), + variant::wx::dcpomatic(), + variant::wx::dcpomatic() + ) ); } catch (exception& e) { error_dialog(_parent, e.what()); diff --git a/src/wx/content_view.cc b/src/wx/content_view.cc index b9fe7ce00..b2d6f86d1 100644 --- a/src/wx/content_view.cc +++ b/src/wx/content_view.cc @@ -21,6 +21,7 @@ #include "content_view.h" #include "wx_util.h" +#include "wx_variant.h" #include "lib/config.h" #include "lib/content_factory.h" #include "lib/cross.h" @@ -86,7 +87,7 @@ ContentView::update () dir = home_directory (); } - wxProgressDialog progress (_("DCP-o-matic"), _("Reading content directory")); + wxProgressDialog progress(variant::wx::dcpomatic(), _("Reading content directory")); auto jm = JobManager::instance (); list<shared_ptr<ExamineContentJob>> jobs; diff --git a/src/wx/disk_warning_dialog.cc b/src/wx/disk_warning_dialog.cc index 531b7f4f9..9af4a2aca 100644 --- a/src/wx/disk_warning_dialog.cc +++ b/src/wx/disk_warning_dialog.cc @@ -18,9 +18,12 @@ */ + #include "disk_warning_dialog.h" #include "static_text.h" #include "wx_util.h" +#include "wx_variant.h" + DiskWarningDialog::DiskWarningDialog () : wxDialog(nullptr, wxID_ANY, _("Important notice")) @@ -45,10 +48,10 @@ DiskWarningDialog::DiskWarningDialog () auto const confirmation = _("I am sure"); text->SetLabelMarkup(wxString::Format( - _("The <b>DCP-o-matic Disk Writer</b> is\n\n<span weight=\"bold\" size=\"20480\" foreground=\"red\">BETA-GRADE TEST SOFTWARE</span>\n\n" + _("The <b>%s</b> is\n\n<span weight=\"bold\" size=\"20480\" foreground=\"red\">BETA-GRADE TEST SOFTWARE</span>\n\n" "and may\n\n<span weight=\"bold\" size=\"20480\" foreground=\"red\">DESTROY DATA!</span>\n\n" "If you are sure you want to continue please type\n\n<tt>%s</tt>\n\ninto the box below, then click OK."), - confirmation)); + variant::wx::dcpomatic_disk_writer(), confirmation)); } bool diff --git a/src/wx/dkdm_dialog.cc b/src/wx/dkdm_dialog.cc index 82c2e3598..a36a9ceae 100644 --- a/src/wx/dkdm_dialog.cc +++ b/src/wx/dkdm_dialog.cc @@ -28,6 +28,7 @@ #include "recipients_panel.h" #include "static_text.h" #include "wx_util.h" +#include "wx_variant.h" #include "lib/config.h" #include "lib/film.h" #include "lib/job_manager.h" @@ -170,7 +171,13 @@ DKDMDialog::make_clicked () if (e.starts_too_early()) { error_dialog (this, _("The KDM start period is before (or close to) the start of the signing certificate's validity period. Use a later start time for this KDM.")); } else { - error_dialog (this, _("The KDM end period is after (or close to) the end of the signing certificates' validity period. Either use an earlier end time for this KDM or re-create your signing certificates in the DCP-o-matic preferences window.")); + error_dialog( + this, + variant::wx::insert_dcpomatic( + _("The KDM end period is after (or close to) the end of the signing certificates' validity period. " + "Either use an earlier end time for this KDM or re-create your signing certificates in the %s preferences window.") + ) + ); } return; } catch (runtime_error& e) { diff --git a/src/wx/full_config_dialog.cc b/src/wx/full_config_dialog.cc index e3ea91224..193392f29 100644 --- a/src/wx/full_config_dialog.cc +++ b/src/wx/full_config_dialog.cc @@ -49,6 +49,7 @@ #include "grok/gpu_config_panel.h" #endif #include "wx_util.h" +#include "wx_variant.h" #include "lib/config.h" #include "lib/cross.h" #include "lib/dcp_content_type.h" @@ -107,12 +108,12 @@ private: int r = 0; add_language_controls (table, r); - add_label_to_sizer (table, _panel, _("Number of threads DCP-o-matic should use"), true, wxGBPosition (r, 0)); + add_label_to_sizer(table, _panel, variant::wx::insert_dcpomatic(_("Number of threads %s should use")), true, wxGBPosition(r, 0)); _master_encoding_threads = new wxSpinCtrl (_panel); table->Add (_master_encoding_threads, wxGBPosition (r, 1)); ++r; - add_label_to_sizer (table, _panel, _("Number of threads DCP-o-matic encode server should use"), true, wxGBPosition (r, 0)); + add_label_to_sizer(table, _panel, variant::wx::insert_dcpomatic_encode_server(_("Number of threads %s should use")), true, wxGBPosition(r, 0)); _server_encoding_threads = new wxSpinCtrl (_panel); table->Add (_server_encoding_threads, wxGBPosition (r, 1)); ++r; @@ -986,8 +987,8 @@ private: Email email( wx_to_std(dialog.from()), { wx_to_std(dialog.to()) }, - wx_to_std(_("DCP-o-matic test email")), - wx_to_std(_("This is a test email from DCP-o-matic.")) + wx_to_std(variant::wx::insert_dcpomatic(_("%s test email"))), + wx_to_std(variant::wx::insert_dcpomatic(_("This is a test email from %s."))) ); auto config = Config::instance(); try { @@ -1407,32 +1408,50 @@ private: add_label_to_sizer (table, _panel, _("Issuer"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL); _issuer = new wxTextCtrl (_panel, wxID_ANY); - _issuer->SetToolTip (_("This will be written to the DCP's XML files as the <Issuer>. If it is blank, a default value mentioning DCP-o-matic will be used.")); + _issuer->SetToolTip( + variant::wx::insert_dcpomatic( + _("This will be written to the DCP's XML files as the <Issuer>. If it is blank, a default value mentioning %s will be used.") + )); table->Add (_issuer, 1, wxALL | wxEXPAND); add_label_to_sizer (table, _panel, _("Creator"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL); _creator = new wxTextCtrl (_panel, wxID_ANY); - _creator->SetToolTip (_("This will be written to the DCP's XML files as the <Creator>. If it is blank, a default value mentioning DCP-o-matic will be used.")); + _creator->SetToolTip( + variant::wx::insert_dcpomatic( + _("This will be written to the DCP's XML files as the <Creator>. If it is blank, a default value mentioning %s will be used.") + )); table->Add (_creator, 1, wxALL | wxEXPAND); add_label_to_sizer (table, _panel, _("Company name"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL); _company_name = new wxTextCtrl (_panel, wxID_ANY); - _company_name->SetToolTip (_("This will be written to the DCP's MXF files as the 'company name'. If it is blank, a default value mentioning libdcp (an internal DCP-o-matic library) will be used.")); + _company_name->SetToolTip( + variant::wx::insert_dcpomatic( + _("This will be written to the DCP's MXF files as the 'company name'. If it is blank, a default value mentioning libdcp (an internal %s library) will be used.") + )); table->Add (_company_name, 1, wxALL | wxEXPAND); add_label_to_sizer (table, _panel, _("Product name"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL); _product_name = new wxTextCtrl (_panel, wxID_ANY); - _product_name->SetToolTip (_("This will be written to the DCP's MXF files as the 'product name'. If it is blank, a default value mentioning libdcp (an internal DCP-o-matic library) will be used.")); + _product_name->SetToolTip( + variant::wx::insert_dcpomatic( + _("This will be written to the DCP's MXF files as the 'product name'. If it is blank, a default value mentioning libdcp (an internal %s library) will be used.") + )); table->Add (_product_name, 1, wxALL | wxEXPAND); add_label_to_sizer (table, _panel, _("Product version"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL); _product_version = new wxTextCtrl (_panel, wxID_ANY); - _product_version->SetToolTip (_("This will be written to the DCP's MXF files as the 'product version'. If it is blank, a default value mentioning libdcp (an internal DCP-o-matic library) will be used.")); + _product_version->SetToolTip( + variant::wx::insert_dcpomatic( + _("This will be written to the DCP's MXF files as the 'product version'. If it is blank, a default value mentioning libdcp (an internal %s library) will be used.") + )); table->Add (_product_version, 1, wxALL | wxEXPAND); add_label_to_sizer (table, _panel, _("JPEG2000 comment"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL); _j2k_comment = new wxTextCtrl (_panel, wxID_ANY); - _j2k_comment->SetToolTip (_("This will be written to the DCP's JPEG2000 data as a comment. If it is blank, a default value mentioning libdcp (an internal DCP-o-matic library) will be used.")); + _j2k_comment->SetToolTip( + variant::wx::insert_dcpomatic( + _("This will be written to the DCP's JPEG2000 data as a comment. If it is blank, a default value mentioning libdcp (an internal %s library) will be used.") + )); table->Add (_j2k_comment, 1, wxALL | wxEXPAND); _panel->GetSizer()->Add (table, 0, wxEXPAND | wxALL, _border); @@ -1540,7 +1559,7 @@ private: _allow_any_container = new CheckBox(_panel, _("Allow full-frame and non-standard container ratios")); table->Add(_allow_any_container, 1, wxEXPAND | wxLEFT, DCPOMATIC_SIZER_GAP); - auto restart = new StaticText(_panel, _("(restart DCP-o-matic to see all ratios)")); + auto restart = new StaticText(_panel, variant::wx::insert_dcpomatic(_("(restart %s to see all ratios)"))); auto font = restart->GetFont(); font.SetStyle(wxFONTSTYLE_ITALIC); font.SetPointSize(font.GetPointSize() - 1); @@ -1674,7 +1693,7 @@ private: _video_display_mode = new wxChoice (_panel, wxID_ANY); table->Add (_video_display_mode); - auto restart = add_label_to_sizer (table, _panel, _("(restart DCP-o-matic to change display mode)"), false); + auto restart = add_label_to_sizer(table, _panel, variant::wx::insert_dcpomatic(_("(restart %s to change display mode)")), false); auto font = restart->GetFont(); font.SetStyle (wxFONTSTYLE_ITALIC); font.SetPointSize (font.GetPointSize() - 1); diff --git a/src/wx/job_view.cc b/src/wx/job_view.cc index efe17f4de..d5b6c4632 100644 --- a/src/wx/job_view.cc +++ b/src/wx/job_view.cc @@ -25,6 +25,7 @@ #include "message_dialog.h" #include "static_text.h" #include "wx_util.h" +#include "wx_variant.h" #include "lib/analyse_audio_job.h" #include "lib/compose.hpp" #include "lib/config.h" @@ -165,7 +166,7 @@ JobView::finished () if (_job->enable_notify() && _notify->GetValue()) { if (Config::instance()->notification(Config::MESSAGE_BOX)) { - wxMessageBox (std_to_wx(_job->name() + ": " + _job->status()), _("DCP-o-matic"), wxICON_INFORMATION); + wxMessageBox(std_to_wx(_job->name() + ": " + _job->status()), variant::wx::dcpomatic(), wxICON_INFORMATION); } if (Config::instance()->notification(Config::EMAIL)) { string body = Config::instance()->notification_email(); diff --git a/src/wx/kdm_dialog.cc b/src/wx/kdm_dialog.cc index 5ab13b4ce..e9d186264 100644 --- a/src/wx/kdm_dialog.cc +++ b/src/wx/kdm_dialog.cc @@ -29,6 +29,7 @@ #include "screens_panel.h" #include "static_text.h" #include "wx_util.h" +#include "wx_variant.h" #include "lib/cinema.h" #include "lib/config.h" #include "lib/film.h" @@ -219,7 +220,13 @@ KDMDialog::make_clicked () if (e.starts_too_early()) { error_dialog (this, _("The KDM start period is before (or close to) the start of the signing certificate's validity period. Use a later start time for this KDM.")); } else { - error_dialog (this, _("The KDM end period is after (or close to) the end of the signing certificates' validity period. Either use an earlier end time for this KDM or re-create your signing certificates in the DCP-o-matic preferences window.")); + error_dialog( + this, + variant::wx::insert_dcpomatic( + _("The KDM end period is after (or close to) the end of the signing certificates' validity " + "period. Either use an earlier end time for this KDM or re-create your signing certificates " + "in the %s preferences window.")) + ); } return; } catch (runtime_error& e) { diff --git a/src/wx/player_config_dialog.cc b/src/wx/player_config_dialog.cc index 58874e50b..d7bba4dcc 100644 --- a/src/wx/player_config_dialog.cc +++ b/src/wx/player_config_dialog.cc @@ -37,6 +37,7 @@ #include "server_dialog.h" #include "static_text.h" #include "wx_util.h" +#include "wx_variant.h" #include "lib/config.h" #include "lib/cross.h" #include "lib/dcp_content_type.h" @@ -114,7 +115,7 @@ private: table->Add (_video_display_mode, wxGBPosition(r, 1)); ++r; - wxStaticText* restart = add_label_to_sizer (table, _panel, _("(restart DCP-o-matic to change display mode)"), false, wxGBPosition(r, 0)); + wxStaticText* restart = add_label_to_sizer(table, _panel, variant::wx::insert_dcpomatic_player(_("(restart %s to change display mode)")), false, wxGBPosition(r, 0)); wxFont font = restart->GetFont(); font.SetStyle (wxFONTSTYLE_ITALIC); font.SetPointSize (font.GetPointSize() - 1); @@ -353,7 +354,7 @@ private: wxPreferencesEditor* create_player_config_dialog () { - auto e = new wxPreferencesEditor (_("DCP-o-matic Player Preferences")); + auto e = new wxPreferencesEditor(variant::wx::insert_dcpomatic_player(_("%s Preferences"))); #ifdef DCPOMATIC_OSX /* Width that we force some of the config panels to be on OSX so that diff --git a/src/wx/playlist_controls.cc b/src/wx/playlist_controls.cc index 3a1bba362..f51bcc4e2 100644 --- a/src/wx/playlist_controls.cc +++ b/src/wx/playlist_controls.cc @@ -25,6 +25,7 @@ #include "playlist_controls.h" #include "static_text.h" #include "wx_util.h" +#include "wx_variant.h" #include "lib/compose.hpp" #include "lib/constants.h" #include "lib/cross.h" @@ -331,7 +332,7 @@ PlaylistControls::spl_selection_changed () void PlaylistControls::select_playlist (int selected, int position) { - wxProgressDialog dialog (_("DCP-o-matic"), "Loading playlist and KDMs"); + wxProgressDialog dialog(variant::wx::dcpomatic(), "Loading playlist and KDMs"); for (auto const& i: _playlists[selected].get()) { dialog.Pulse (); @@ -403,7 +404,7 @@ PlaylistControls::update_current_content () { DCPOMATIC_ASSERT (_selected_playlist); - wxProgressDialog dialog (_("DCP-o-matic"), "Loading content"); + wxProgressDialog dialog(variant::wx::dcpomatic(), "Loading content"); setup_sensitivity (); dialog.Pulse (); diff --git a/src/wx/playlist_editor_config_dialog.cc b/src/wx/playlist_editor_config_dialog.cc index d5c4106ea..67bedc05e 100644 --- a/src/wx/playlist_editor_config_dialog.cc +++ b/src/wx/playlist_editor_config_dialog.cc @@ -18,8 +18,11 @@ */ -#include "playlist_editor_config_dialog.h" + #include "config_dialog.h" +#include "playlist_editor_config_dialog.h" +#include "wx_variant.h" + /** @file src/playlist_editor_config_dialog.cc * @brief A dialogue to edit DCP-o-matic Playlist Editor configuration. @@ -28,7 +31,7 @@ wxPreferencesEditor* create_playlist_editor_config_dialog () { - auto e = new wxPreferencesEditor (_("DCP-o-matic Playlist Editor Preferences")); + auto e = new wxPreferencesEditor(variant::wx::insert_dcpomatic_playlist_editor(_("%s Preferences"))); #ifdef DCPOMATIC_OSX /* Width that we force some of the config panels to be on OSX so that diff --git a/src/wx/screens_panel.cc b/src/wx/screens_panel.cc index 62f8688a9..52545e5f6 100644 --- a/src/wx/screens_panel.cc +++ b/src/wx/screens_panel.cc @@ -25,6 +25,7 @@ #include "screen_dialog.h" #include "screens_panel.h" #include "wx_util.h" +#include "wx_variant.h" #include "lib/cinema.h" #include "lib/config.h" #include "lib/screen.h" @@ -261,7 +262,14 @@ ScreensPanel::add_cinema_clicked () dcp::ScopeGuard sg = [this]() { _ignore_cinemas_changed = false; }; Config::instance()->add_cinema(cinema); } catch (FileError& e) { - error_dialog(GetParent(), _("Could not write cinema details to the cinemas.xml file. Check that the location of cinemas.xml is valid in DCP-o-matic's preferences."), std_to_wx(e.what())); + error_dialog( + GetParent(), + variant::wx::insert_dcpomatic( + _("Could not write cinema details to the cinemas.xml file. Check that the location of " + "cinemas.xml is valid in %s's preferences.") + ), + std_to_wx(e.what()) + ); return; } @@ -718,7 +726,14 @@ ScreensPanel::notify_cinemas_changed() try { Config::instance()->changed(Config::CINEMAS); } catch (FileError& e) { - error_dialog(GetParent(), _("Could not write cinema details to the cinemas.xml file. Check that the location of cinemas.xml is valid in DCP-o-matic's preferences."), std_to_wx(e.what())); + error_dialog( + GetParent(), + variant::wx::insert_dcpomatic( + _("Could not write cinema details to the cinemas.xml file. Check that the location of " + "cinemas.xml is valid in %s's preferences.") + ), + std_to_wx(e.what()) + ); return false; } diff --git a/src/wx/system_information_dialog.cc b/src/wx/system_information_dialog.cc index fbae2e010..26138900a 100644 --- a/src/wx/system_information_dialog.cc +++ b/src/wx/system_information_dialog.cc @@ -23,6 +23,7 @@ #include "gl_video_view.h" #include "system_information_dialog.h" #include "wx_util.h" +#include "wx_variant.h" #ifdef DCPOMATIC_OSX @@ -48,7 +49,7 @@ SystemInformationDialog::SystemInformationDialog(wxWindow* parent, FilmViewer co if (!gl) { add (_("OpenGL version"), true); - add (_("unknown (OpenGL not enabled in DCP-o-matic)"), false); + add(variant::wx::insert_dcpomatic(_("unknown (OpenGL not enabled in %s)")), false); } else { auto information = gl->information(); auto add_string = [this, &information](GLenum name, wxString label) { @@ -79,7 +80,7 @@ SystemInformationDialog::SystemInformationDialog(wxWindow* parent, FilmViewer co : TableDialog (parent, _("System information"), 2, 1, false) { add (_("OpenGL version"), true); - add (_("OpenGL renderer not supported by this DCP-o-matic version"), false); + add(variant::wx::insert_dcpomatic(_("OpenGL renderer not supported by this %s version")), false); } #endif diff --git a/src/wx/try_unmount_dialog.cc b/src/wx/try_unmount_dialog.cc index ddfaec5c0..37d6e75fa 100644 --- a/src/wx/try_unmount_dialog.cc +++ b/src/wx/try_unmount_dialog.cc @@ -22,6 +22,7 @@ #include "static_text.h" #include "try_unmount_dialog.h" #include "wx_util.h" +#include "wx_variant.h" #include <dcp/warnings.h> LIBDCP_DISABLE_WARNINGS #include <wx/wx.h> @@ -32,14 +33,17 @@ static int constexpr width = 300; TryUnmountDialog::TryUnmountDialog (wxWindow* parent, wxString description) - : wxDialog (parent, wxID_ANY, _("DCP-o-matic Disk Writer")) + : wxDialog(parent, wxID_ANY, variant::wx::dcpomatic_disk_writer()) { auto sizer = new wxBoxSizer (wxVERTICAL); auto text = new StaticText (this, wxEmptyString, wxDefaultPosition, wxSize(width, -1)); sizer->Add (text, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER); text->SetLabelMarkup ( - wxString::Format(_("The drive <b>%s</b> is mounted.\n\nIt must be unmounted before DCP-o-matic can write to it.\n\nShould DCP-o-matic try to unmount it now?"), description) + wxString::Format( + _("The drive <b>%s</b> is mounted.\n\nIt must be unmounted before %s can write to it.\n\nShould DCP-o-matic try to unmount it now?"), + description, variant::wx::dcpomatic() + ) ); text->Wrap(width); diff --git a/src/wx/update_dialog.cc b/src/wx/update_dialog.cc index 0a7319704..7c687aa60 100644 --- a/src/wx/update_dialog.cc +++ b/src/wx/update_dialog.cc @@ -22,6 +22,7 @@ #include "static_text.h" #include "update_dialog.h" #include "wx_util.h" +#include "wx_variant.h" #include <dcp/warnings.h> LIBDCP_DISABLE_WARNINGS #include <wx/hyperlink.h> @@ -40,9 +41,9 @@ UpdateDialog::UpdateDialog (wxWindow* parent, optional<string> stable, optional< wxStaticText* message; if ((stable || test) && !(stable && test)) { - message = new StaticText (this, _("A new version of DCP-o-matic is available.")); + message = new StaticText(this, variant::wx::insert_dcpomatic(_("A new version of %s is available."))); } else { - message = new StaticText (this, _("New versions of DCP-o-matic are available.")); + message = new StaticText(this, variant::wx::insert_dcpomatic(_("New versions of %s are available."))); } overall_sizer->Add (message, 0, wxTOP | wxLEFT | wxRIGHT, DCPOMATIC_DIALOG_BORDER); diff --git a/src/wx/wscript b/src/wx/wscript index eecc314a0..b37d26d6d 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -186,8 +186,9 @@ sources = """ video_view.cc video_waveform_dialog.cc video_waveform_plot.cc - wx_util.cc wx_signal_manager.cc + wx_util.cc + wx_variant.cc """ def configure(conf): diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index 58bb4d5ea..49a3ca5c3 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -31,6 +31,7 @@ #include "static_text.h" #include "wx_ptr.h" #include "wx_util.h" +#include "wx_variant.h" #include "lib/config.h" #include "lib/cross.h" #include "lib/job.h" @@ -161,7 +162,7 @@ add_label_to_sizer (wxGridBagSizer* s, wxStaticText* t, bool, wxGBPosition pos, void error_dialog (wxWindow* parent, wxString m, optional<wxString> e) { - auto d = make_wx<wxMessageDialog>(parent, m, _("DCP-o-matic"), wxOK | wxICON_ERROR); + auto d = make_wx<wxMessageDialog>(parent, m, variant::wx::dcpomatic(), wxOK | wxICON_ERROR); if (e) { wxString em = *e; em[0] = wxToupper (em[0]); @@ -178,7 +179,7 @@ error_dialog (wxWindow* parent, wxString m, optional<wxString> e) void message_dialog (wxWindow* parent, wxString m) { - auto d = make_wx<wxMessageDialog>(parent, m, _("DCP-o-matic"), wxOK | wxICON_INFORMATION); + auto d = make_wx<wxMessageDialog>(parent, m, variant::wx::dcpomatic(), wxOK | wxICON_INFORMATION); d->ShowModal (); } @@ -187,7 +188,7 @@ message_dialog (wxWindow* parent, wxString m) bool confirm_dialog (wxWindow* parent, wxString m) { - auto d = make_wx<wxMessageDialog>(parent, m, _("DCP-o-matic"), wxYES_NO | wxICON_QUESTION); + auto d = make_wx<wxMessageDialog>(parent, m, variant::wx::dcpomatic(), wxYES_NO | wxICON_QUESTION); return d->ShowModal() == wxID_YES; } diff --git a/src/wx/wx_variant.cc b/src/wx/wx_variant.cc new file mode 100644 index 000000000..690e3a330 --- /dev/null +++ b/src/wx/wx_variant.cc @@ -0,0 +1,140 @@ +/* + Copyright (C) 2024 Carl Hetherington <cth@carlh.net> + + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + DCP-o-matic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>. + +*/ + + +#include "wx_util.h" +#include "wx_variant.h" +#include "lib/variant.h" + + + +wxString +variant::wx::dcpomatic() +{ + return std_to_wx(variant::dcpomatic()); +} + +wxString +variant::wx::dcpomatic_batch_converter() +{ + return std_to_wx(variant::dcpomatic_batch_converter()); +} + +wxString +variant::wx::dcpomatic_combiner() +{ + return std_to_wx(variant::dcpomatic_combiner()); +} + +wxString +variant::wx::dcpomatic_disk_writer() +{ + return std_to_wx(variant::dcpomatic_disk_writer()); +} + +wxString +variant::wx::dcpomatic_editor() +{ + return std_to_wx(variant::dcpomatic_editor()); +} + +wxString +variant::wx::dcpomatic_encode_server() +{ + return std_to_wx(variant::dcpomatic_encode_server()); +} + +wxString +variant::wx::dcpomatic_kdm_creator() +{ + return std_to_wx(variant::dcpomatic_kdm_creator()); +} + +wxString +variant::wx::dcpomatic_player() +{ + return std_to_wx(variant::dcpomatic_player()); +} + +wxString +variant::wx::dcpomatic_playlist_editor() +{ + return std_to_wx(variant::dcpomatic_playlist_editor()); +} + +wxString +variant::wx::dcpomatic_verifier() +{ + return std_to_wx(variant::dcpomatic_verifier()); +} + +wxString +variant::wx::insert_dcpomatic(wxString const& s) +{ + return wxString::Format(s, dcpomatic()); +} + +wxString +variant::wx::insert_dcpomatic_batch_converter(wxString const& s) +{ + return wxString::Format(s, dcpomatic_batch_converter()); +} + +wxString +variant::wx::insert_dcpomatic_disk_writer(wxString const& s) +{ + return wxString::Format(s, dcpomatic_disk_writer()); +} + +wxString +variant::wx::insert_dcpomatic_editor(wxString const& s) +{ + return wxString::Format(s, dcpomatic_editor()); +} + +wxString +variant::wx::insert_dcpomatic_encode_server(wxString const& s) +{ + return wxString::Format(s, dcpomatic_encode_server()); +} + +wxString +variant::wx::insert_dcpomatic_kdm_creator(wxString const& s) +{ + return wxString::Format(s, dcpomatic_kdm_creator()); +} + +wxString +variant::wx::insert_dcpomatic_player(wxString const& s) +{ + return wxString::Format(s, dcpomatic_player()); +} + +wxString +variant::wx::insert_dcpomatic_playlist_editor(wxString const& s) +{ + return wxString::Format(s, dcpomatic_playlist_editor()); +} + +wxString +variant::wx::insert_dcpomatic_verifier(wxString const& s) +{ + return wxString::Format(s, dcpomatic_verifier()); +} diff --git a/src/wx/wx_variant.h b/src/wx/wx_variant.h new file mode 100644 index 000000000..0121c5b11 --- /dev/null +++ b/src/wx/wx_variant.h @@ -0,0 +1,52 @@ +/* + Copyright (C) 2024 Carl Hetherington <cth@carlh.net> + + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + DCP-o-matic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>. + +*/ + + +#include <wx/wx.h> + + +namespace variant { +namespace wx { + + +wxString dcpomatic(); +wxString dcpomatic_batch_converter(); +wxString dcpomatic_combiner(); +wxString dcpomatic_disk_writer(); +wxString dcpomatic_editor(); +wxString dcpomatic_encode_server(); +wxString dcpomatic_kdm_creator(); +wxString dcpomatic_player(); +wxString dcpomatic_playlist_editor(); +wxString dcpomatic_verifier(); + +wxString insert_dcpomatic(wxString const& s); +wxString insert_dcpomatic_batch_converter(wxString const& s); +wxString insert_dcpomatic_disk_writer(wxString const& s); +wxString insert_dcpomatic_editor(wxString const& s); +wxString insert_dcpomatic_encode_server(wxString const& s); +wxString insert_dcpomatic_kdm_creator(wxString const& s); +wxString insert_dcpomatic_player(wxString const& s); +wxString insert_dcpomatic_playlist_editor(wxString const& s); +wxString insert_dcpomatic_verifier(wxString const& s); + + +} +} |
