summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-08-09 02:02:20 +0200
committerCarl Hetherington <cth@carlh.net>2024-08-17 12:59:25 +0200
commit203ee8d5dcb58a3acb79780afb95c5251d8e4311 (patch)
treec29be253617a3884570b50cd6f074e00fc5163dc
parent199f9e9026861d1a104f2b24371ddbb94f0e8169 (diff)
Remove some implicit conversions between wxString and std::string.
-rw-r--r--src/tools/dcpomatic.cc4
-rw-r--r--src/tools/dcpomatic_combiner.cc6
-rw-r--r--src/tools/dcpomatic_disk.cc6
-rw-r--r--src/tools/dcpomatic_editor.cc4
-rw-r--r--src/tools/dcpomatic_kdm.cc6
-rw-r--r--src/tools/dcpomatic_player.cc16
-rw-r--r--src/tools/dcpomatic_playlist.cc4
-rw-r--r--src/tools/dcpomatic_server.cc4
-rw-r--r--src/tools/dcpomatic_verifier.cc4
-rw-r--r--src/wx/about_dialog.cc2
-rw-r--r--src/wx/audio_dialog.cc2
-rw-r--r--src/wx/audio_mapping_view.cc6
-rw-r--r--src/wx/closed_captions_dialog.cc4
-rw-r--r--src/wx/config_dialog.cc18
-rw-r--r--src/wx/confirm_kdm_email_dialog.cc2
-rw-r--r--src/wx/content_menu.cc4
-rw-r--r--src/wx/content_panel.cc6
-rw-r--r--src/wx/content_timeline_audio_view.cc8
-rw-r--r--src/wx/content_view.cc4
-rw-r--r--src/wx/custom_scale_dialog.cc10
-rw-r--r--src/wx/dcp_panel.cc22
-rw-r--r--src/wx/dcpomatic_choice.cc2
-rw-r--r--src/wx/dkdm_output_panel.cc2
-rw-r--r--src/wx/export_subtitles_dialog.cc2
-rw-r--r--src/wx/export_video_file_dialog.cc8
-rw-r--r--src/wx/film_name_location_dialog.cc11
-rw-r--r--src/wx/fonts_dialog.cc10
-rw-r--r--src/wx/full_config_dialog.cc6
-rw-r--r--src/wx/full_language_tag_dialog.cc13
-rw-r--r--src/wx/gl_video_view.cc2
-rw-r--r--src/wx/hints_dialog.cc2
-rw-r--r--src/wx/html_dialog.cc6
-rw-r--r--src/wx/image_sequence_dialog.cc7
-rw-r--r--src/wx/kdm_choice.cc9
-rw-r--r--src/wx/kdm_cpl_panel.cc8
-rw-r--r--src/wx/kdm_output_panel.cc2
-rw-r--r--src/wx/language_subtag_panel.cc7
-rw-r--r--src/wx/language_tag_dialog.cc4
-rw-r--r--src/wx/markers_panel.cc4
-rw-r--r--src/wx/metadata_dialog.cc6
-rw-r--r--src/wx/name_format_editor.cc6
-rw-r--r--src/wx/player_config_dialog.cc2
-rw-r--r--src/wx/player_information.cc2
-rw-r--r--src/wx/qube_certificate_panel.cc2
-rw-r--r--src/wx/recipients_panel.cc2
-rw-r--r--src/wx/report_problem_dialog.cc2
-rw-r--r--src/wx/self_dkdm_dialog.cc2
-rw-r--r--src/wx/simple_video_view.cc2
-rw-r--r--src/wx/subtag_list_ctrl.cc9
-rw-r--r--src/wx/subtitle_appearance_dialog.cc4
-rw-r--r--src/wx/text_panel.cc2
-rw-r--r--src/wx/time_picker.cc4
-rw-r--r--src/wx/timer_display.cc2
-rw-r--r--src/wx/update_dialog.cc4
-rw-r--r--src/wx/verify_dcp_result_panel.cc32
-rw-r--r--src/wx/video_waveform_dialog.cc12
-rw-r--r--src/wx/wscript2
-rw-r--r--src/wx/wx_util.cc2
58 files changed, 176 insertions, 170 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc
index 5e56a2672..cfe66bf52 100644
--- a/src/tools/dcpomatic.cc
+++ b/src/tools/dcpomatic.cc
@@ -1015,7 +1015,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."));
}
@@ -1845,7 +1845,7 @@ private:
)
);
} catch (...) {
- error_dialog(nullptr, _("An unknown exception occurred.") + " " + wx::report_problem());
+ error_dialog(nullptr, wxString::Format(_("An unknown exception occurred. %s"), wx::report_problem()));
}
}
diff --git a/src/tools/dcpomatic_combiner.cc b/src/tools/dcpomatic_combiner.cc
index 26ca0022b..49ada2580 100644
--- a/src/tools/dcpomatic_combiner.cc
+++ b/src/tools/dcpomatic_combiner.cc
@@ -171,7 +171,7 @@ private:
} else if (is_regular_file(output)) {
error_dialog (
this,
- String::compose (wx_to_std(_("%1 already exists as a file, so you cannot use it for a DCP.")), output.string())
+ wxString::Format(_("%s already exists as a file, so you cannot use it for a DCP."), std_to_wx(output.string()))
);
return;
}
@@ -192,7 +192,7 @@ private:
} else {
auto m = std_to_wx(last->error_summary());
if (!last->error_details().empty()) {
- m += wxString::Format(" (%s)", std_to_wx(last->error_details()));
+ m += wxString::Format(char_to_wx(" (%s)"), std_to_wx(last->error_details()));
}
error_dialog (this, m);
}
@@ -313,7 +313,7 @@ public:
)
);
} catch (...) {
- error_dialog(nullptr, _("An unknown exception occurred.") + " " + wx::report_problem());
+ error_dialog(nullptr, wxString::Format(_("An unknown exception occurred. %s"), wx::report_problem()));
}
}
diff --git a/src/tools/dcpomatic_disk.cc b/src/tools/dcpomatic_disk.cc
index a20a062e3..235677461 100644
--- a/src/tools/dcpomatic_disk.cc
+++ b/src/tools/dcpomatic_disk.cc
@@ -347,7 +347,7 @@ private:
auto const& drive = _drives[_drive->GetSelection()];
if (drive.mounted()) {
- auto d = make_wx<TryUnmountDialog>(this, drive.description());
+ auto d = make_wx<TryUnmountDialog>(this, std_to_wx(drive.description()));
int const r = d->ShowModal ();
if (r != wxID_OK) {
return;
@@ -371,7 +371,7 @@ private:
wxString::Format(
_("The drive %s could not be unmounted.\nClose any application that is using it, then try again. (%s)"),
std_to_wx(drive.description()),
- reply->error_message()
+ std_to_wx(reply->error_message())
)
);
m->ShowModal ();
@@ -585,7 +585,7 @@ public:
)
);
} catch (...) {
- error_dialog(nullptr, _("An unknown exception occurred.") + " " + wx::report_problem());
+ error_dialog(nullptr, wxString::Format(_("An unknown exception occurred. %s"), wx::report_problem()));
}
}
diff --git a/src/tools/dcpomatic_editor.cc b/src/tools/dcpomatic_editor.cc
index 5293608c9..960d658ee 100644
--- a/src/tools/dcpomatic_editor.cc
+++ b/src/tools/dcpomatic_editor.cc
@@ -109,7 +109,7 @@ public:
_duration->SetRange(0, 259200);
_duration->SetValue(asset->duration().get_value_or(0));
- intrinsic_duration->SetValue(wxString::Format("%ld", asset->intrinsic_duration()));
+ intrinsic_duration->SetValue(wxString::Format(char_to_wx("%ld"), asset->intrinsic_duration()));
_annotation_text->Bind(wxEVT_TEXT, boost::bind(&AssetPanel::annotation_text_changed, this));
_entry_point->Bind(wxEVT_SPINCTRL, boost::bind(&AssetPanel::entry_point_changed, this));
@@ -543,7 +543,7 @@ private:
)
);
} catch (...) {
- error_dialog(nullptr, _("An unknown exception occurred.") + " " + wx::report_problem());
+ error_dialog(nullptr, wxString::Format(_("An unknown exception occurred. %s"), wx::report_problem()));
}
}
diff --git a/src/tools/dcpomatic_kdm.cc b/src/tools/dcpomatic_kdm.cc
index af16f57aa..909c4e281 100644
--- a/src/tools/dcpomatic_kdm.cc
+++ b/src/tools/dcpomatic_kdm.cc
@@ -698,7 +698,7 @@ private:
if (!base->parent()) {
/* This is the root group */
- _dkdm_id[_dkdm->AddRoot("root")] = base;
+ _dkdm_id[_dkdm->AddRoot(char_to_wx("root"))] = base;
} else {
/* Add base to the view */
wxTreeItemId added;
@@ -944,7 +944,7 @@ private:
)
);
} catch (...) {
- error_dialog(nullptr, _("An unknown exception occurred.") + " " + wx::report_problem());
+ error_dialog(nullptr, wxString::Format(_("An unknown exception occurred. %s"), wx::report_problem()));
}
/* This will terminate the program */
@@ -953,7 +953,7 @@ private:
void OnUnhandledException () override
{
- error_dialog(nullptr, _("An unknown exception occurred.") + " " + wx::report_problem());
+ error_dialog(nullptr, wxString::Format(_("An unknown exception occurred. %s"), wx::report_problem()));
}
void idle ()
diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc
index 681426529..1226f3042 100644
--- a/src/tools/dcpomatic_player.cc
+++ b/src/tools/dcpomatic_player.cc
@@ -528,7 +528,7 @@ public:
for (auto i: dcp::find_and_resolve_cpls(first->directories(), true)) {
auto j = _cpl_menu->AppendRadioItem(
id,
- wxString::Format("%s (%s)", std_to_wx(i->annotation_text().get_value_or("")).data(), std_to_wx(i->id()).data())
+ wxString::Format(char_to_wx("%s (%s)"), std_to_wx(i->annotation_text().get_value_or("")).data(), std_to_wx(i->id()).data())
);
j->Check(!first->cpl() || i->id() == *first->cpl());
++id;
@@ -771,7 +771,7 @@ private:
void file_save_frame ()
{
- wxFileDialog dialog (this, _("Save frame to file"), "", "", "PNG files (*.png)|*.png|JPEG files (*.jpg;*.jpeg)|*.jpg;*.jpeg", wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
+ wxFileDialog dialog (this, _("Save frame to file"), {}, {}, char_to_wx("PNG files (*.png)|*.png|JPEG files (*.jpg;*.jpeg)|*.jpg;*.jpeg"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
if (dialog.ShowModal() == wxID_CANCEL) {
return;
}
@@ -813,7 +813,7 @@ private:
try {
load_dcp (history[n]);
} catch (exception& e) {
- error_dialog (0, std_to_wx(String::compose(wx_to_std(_("Could not load DCP %1.")), history[n])), std_to_wx(e.what()));
+ error_dialog(nullptr, wxString::Format(_("Could not load DCP %s."), std_to_wx(history[n].string()))), std_to_wx(e.what());
}
}
}
@@ -1310,7 +1310,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.")), _dcp_to_load)), std_to_wx(e.what()));
+ error_dialog(nullptr, wxString::Format(_("Could not load DCP %s"), std_to_wx(_dcp_to_load)), std_to_wx(e.what()));
}
}
@@ -1318,7 +1318,7 @@ private:
try {
_frame->load_stress_script (*_stress);
} catch (exception& e) {
- error_dialog (0, wxString::Format("Could not load stress test file %s", std_to_wx(*_stress)));
+ error_dialog(nullptr, wxString::Format(_("Could not load stress test file %s"), std_to_wx(*_stress)));
}
}
@@ -1352,11 +1352,11 @@ private:
}
wxString config;
- if (parser.Found("c", &config)) {
+ if (parser.Found(char_to_wx("c"), &config)) {
Config::override_path = wx_to_std (config);
}
wxString stress;
- if (parser.Found("s", &stress)) {
+ if (parser.Found(char_to_wx("s"), &stress)) {
_stress = wx_to_std (stress);
}
@@ -1387,7 +1387,7 @@ private:
)
);
} catch (...) {
- error_dialog(nullptr, _("An unknown exception occurred.") + " " + wx::report_problem());
+ error_dialog(nullptr, wxString::Format(_("An unknown exception occurred. %s"), wx::report_problem()));
}
}
diff --git a/src/tools/dcpomatic_playlist.cc b/src/tools/dcpomatic_playlist.cc
index a50fab37d..5900467ef 100644
--- a/src/tools/dcpomatic_playlist.cc
+++ b/src/tools/dcpomatic_playlist.cc
@@ -713,7 +713,7 @@ private:
)
);
} catch (...) {
- error_dialog(nullptr, _("An unknown exception occurred.") + " " + wx::report_problem());
+ error_dialog(nullptr, wxString::Format(_("An unknown exception occurred. %s"), wx::report_problem()));
}
/* This will terminate the program */
@@ -722,7 +722,7 @@ private:
void OnUnhandledException () override
{
- error_dialog(nullptr, _("An unknown exception occurred.") + " " + wx::report_problem());
+ error_dialog(nullptr, wxString::Format(_("An unknown exception occurred. %s"), wx::report_problem()));
}
void idle ()
diff --git a/src/tools/dcpomatic_server.cc b/src/tools/dcpomatic_server.cc
index 5aad282fd..ef232a2a2 100644
--- a/src/tools/dcpomatic_server.cc
+++ b/src/tools/dcpomatic_server.cc
@@ -202,7 +202,7 @@ public:
private:
void appended (string s)
{
- (*_text) << s << "\n";
+ (*_text) << std_to_wx(s) << char_to_wx("\n");
}
void removed (int n)
@@ -212,7 +212,7 @@ private:
void update_state ()
{
- _fps->SetLabel (wxString::Format ("%.1f", server_log->fps()));
+ _fps->SetLabel(wxString::Format(char_to_wx("%.1f"), server_log->fps()));
}
wxTextCtrl* _text;
diff --git a/src/tools/dcpomatic_verifier.cc b/src/tools/dcpomatic_verifier.cc
index 834ebefa1..44285ca49 100644
--- a/src/tools/dcpomatic_verifier.cc
+++ b/src/tools/dcpomatic_verifier.cc
@@ -187,7 +187,7 @@ private:
}
catch (exception& e)
{
- error_dialog(nullptr, variant::wx::insert_dcpomatic_verifier("%s could not start."), std_to_wx(e.what()));
+ error_dialog(nullptr, variant::wx::insert_dcpomatic_verifier(char_to_wx("%s could not start.")), std_to_wx(e.what()));
}
return true;
@@ -228,7 +228,7 @@ private:
)
);
} catch (...) {
- error_dialog(nullptr, _("An unknown exception occurred.") + " " + wx::report_problem());
+ error_dialog(nullptr, wxString::Format(_("An unknown exception occurred. %s"), wx::report_problem()));
}
}
diff --git a/src/wx/about_dialog.cc b/src/wx/about_dialog.cc
index 0c3905097..6870d3f64 100644
--- a/src/wx/about_dialog.cc
+++ b/src/wx/about_dialog.cc
@@ -167,7 +167,7 @@ AboutDialog::AboutDialog (wxWindow* parent)
add_section (_("Translated by"), translated_by);
wxArrayString patrons;
- patrons.Add ("Lightbender Post");
+ patrons.Add(char_to_wx("Lightbender Post"));
add_section (_("Patrons"), patrons);
wxArrayString subscribers;
diff --git a/src/wx/audio_dialog.cc b/src/wx/audio_dialog.cc
index 1f7f3ad03..80a8b8c71 100644
--- a/src/wx/audio_dialog.cc
+++ b/src/wx/audio_dialog.cc
@@ -470,5 +470,5 @@ AudioDialog::set_cursor (optional<DCPTime> time, optional<float> db)
auto film = _film.lock();
DCPOMATIC_ASSERT (film);
- _cursor->SetLabel (wxString::Format (_("Cursor: %.1fdB at %s"), *db, time->timecode(film->video_frame_rate())));
+ _cursor->SetLabel(wxString::Format(_("Cursor: %.1fdB at %s"), *db, std_to_wx(time->timecode(film->video_frame_rate()))));
}
diff --git a/src/wx/audio_mapping_view.cc b/src/wx/audio_mapping_view.cc
index 4898f1ade..2c743ac7e 100644
--- a/src/wx/audio_mapping_view.cc
+++ b/src/wx/audio_mapping_view.cc
@@ -519,7 +519,7 @@ AudioMappingView::input_channel_name_with_group (NamedChannel const& n) const
}
if (group && !group->IsEmpty()) {
- return wxString::Format ("%s/%s", group->data(), std_to_wx(n.name).data());
+ return wxString::Format(char_to_wx("%s/%s"), group->data(), std_to_wx(n.name).data());
}
return std_to_wx(n.name);
@@ -562,14 +562,14 @@ AudioMappingView::motion (wxMouseEvent& ev)
);
}
- SetToolTip (s + " " + _("Right click to change gain."));
+ SetToolTip(s + char_to_wx(" ") + _("Right click to change gain."));
}
} else {
auto group = mouse_event_to_input_group_name (ev);
if (group) {
SetToolTip (std_to_wx(*group));
} else {
- SetToolTip ("");
+ SetToolTip({});
}
}
diff --git a/src/wx/closed_captions_dialog.cc b/src/wx/closed_captions_dialog.cc
index 9142500e0..c8a04993c 100644
--- a/src/wx/closed_captions_dialog.cc
+++ b/src/wx/closed_captions_dialog.cc
@@ -164,7 +164,7 @@ ClosedCaptionsDialog::update ()
if (_current && _current->period.to < time) {
/* Current one has finished; clear out */
for (int j = 0; j < MAX_CLOSED_CAPTION_LINES; ++j) {
- _lines[j] = "";
+ _lines[j] = wxString{};
}
Refresh ();
_current = optional<TextRingBuffers::Data>();
@@ -198,7 +198,7 @@ ClosedCaptionsDialog::update ()
auto to_show = _current->text.string;
for (int j = 0; j < MAX_CLOSED_CAPTION_LINES; ++j) {
- _lines[j] = "";
+ _lines[j] = wxString{};
}
std::sort(to_show.begin(), to_show.end(), ClosedCaptionSorter());
diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc
index e832dd168..653f868c8 100644
--- a/src/wx/config_dialog.cc
+++ b/src/wx/config_dialog.cc
@@ -448,11 +448,11 @@ CertificateChainEditor::export_certificate ()
wxString default_name;
if (i == 0) {
- default_name = "root.pem";
+ default_name = char_to_wx("root.pem");
} else if (i == static_cast<int>(all.size() - 1)) {
- default_name = "leaf.pem";
+ default_name = char_to_wx("leaf.pem");
} else {
- default_name = "intermediate.pem";
+ default_name = char_to_wx("intermediate.pem");
}
auto d = make_wx<wxFileDialog>(
@@ -814,12 +814,12 @@ void
KeysPage::export_decryption_certificate ()
{
auto config = Config::instance();
- wxString default_name = "dcpomatic";
+ wxString default_name = char_to_wx("dcpomatic");
if (!config->dcp_creator().empty()) {
- default_name += "_" + std_to_wx(careful_string_filter(config->dcp_creator()));
+ default_name += char_to_wx("_") + std_to_wx(careful_string_filter(config->dcp_creator()));
}
if (!config->dcp_issuer().empty()) {
- default_name += "_" + std_to_wx(careful_string_filter(config->dcp_issuer()));
+ default_name += char_to_wx("_") + std_to_wx(careful_string_filter(config->dcp_issuer()));
}
default_name += wxT("_kdm_decryption_cert.pem");
@@ -1037,17 +1037,17 @@ LocationsPage::setup ()
_panel->GetSizer()->Add (table, 1, wxALL | wxEXPAND, _border);
add_label_to_sizer (table, _panel, _("Content directory"), true, wxGBPosition (r, 0));
- _content_directory = new wxDirPickerCtrl (_panel, wxID_ANY, wxEmptyString, wxDirSelectorPromptStr, wxDefaultPosition, wxSize (300, -1));
+ _content_directory = new wxDirPickerCtrl (_panel, wxID_ANY, wxEmptyString, char_to_wx(wxDirSelectorPromptStr), wxDefaultPosition, wxSize (300, -1));
table->Add (_content_directory, wxGBPosition (r, 1));
++r;
add_label_to_sizer (table, _panel, _("Playlist directory"), true, wxGBPosition (r, 0));
- _playlist_directory = new wxDirPickerCtrl (_panel, wxID_ANY, wxEmptyString, wxDirSelectorPromptStr, wxDefaultPosition, wxSize (300, -1));
+ _playlist_directory = new wxDirPickerCtrl (_panel, wxID_ANY, wxEmptyString, char_to_wx(wxDirSelectorPromptStr), wxDefaultPosition, wxSize (300, -1));
table->Add (_playlist_directory, wxGBPosition (r, 1));
++r;
add_label_to_sizer (table, _panel, _("KDM directory"), true, wxGBPosition (r, 0));
- _kdm_directory = new wxDirPickerCtrl (_panel, wxID_ANY, wxEmptyString, wxDirSelectorPromptStr, wxDefaultPosition, wxSize (300, -1));
+ _kdm_directory = new wxDirPickerCtrl (_panel, wxID_ANY, wxEmptyString, char_to_wx(wxDirSelectorPromptStr), wxDefaultPosition, wxSize (300, -1));
table->Add (_kdm_directory, wxGBPosition (r, 1));
++r;
diff --git a/src/wx/confirm_kdm_email_dialog.cc b/src/wx/confirm_kdm_email_dialog.cc
index 665086557..4fe3a39fc 100644
--- a/src/wx/confirm_kdm_email_dialog.cc
+++ b/src/wx/confirm_kdm_email_dialog.cc
@@ -35,7 +35,7 @@ ConfirmKDMEmailDialog::ConfirmKDMEmailDialog (wxWindow* parent, list<string> ema
{
wxString message = _("Are you sure you want to send emails to the following addresses?\n\n");
for (auto i: emails) {
- message += "\t" + std_to_wx (i) + "\n";
+ message += wxString::Format(char_to_wx("\t%s\n"), std_to_wx(i));
}
_sizer->Add (new StaticText (this, message), 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc
index fdf43ba7c..ddc155952 100644
--- a/src/wx/content_menu.cc
+++ b/src/wx/content_menu.cc
@@ -177,7 +177,7 @@ ContentMenu::popup (weak_ptr<Film> film, ContentList c, TimelineContentViewList
auto item = _cpl_menu->AppendRadioItem (
id++,
wxString::Format (
- "%s (%s)",
+ char_to_wx("%s (%s)"),
std_to_wx(i->annotation_text().get_value_or("")).data(),
std_to_wx(i->id()).data()
)
@@ -427,7 +427,7 @@ ContentMenu::kdm ()
error_dialog (_parent, std_to_wx(e.summary()), std_to_wx(e.detail()));
return;
} catch (exception& e) {
- error_dialog (_parent, e.what());
+ error_dialog(_parent, std_to_wx(e.what()));
return;
}
diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc
index 5624e8797..a3a924457 100644
--- a/src/wx/content_panel.cc
+++ b/src/wx/content_panel.cc
@@ -640,7 +640,7 @@ ContentPanel::add_folder(boost::filesystem::path folder)
try {
content = content_factory(folder);
} catch (exception& e) {
- error_dialog (_parent, e.what());
+ error_dialog(_parent, std_to_wx(e.what()));
return;
}
@@ -693,7 +693,7 @@ ContentPanel::add_dcp(boost::filesystem::path dcp)
)
);
} catch (exception& e) {
- error_dialog(_parent, e.what());
+ error_dialog(_parent, std_to_wx(e.what()));
}
}
@@ -963,7 +963,7 @@ ContentPanel::add_files (vector<boost::filesystem::path> paths)
}
}
} catch (exception& e) {
- error_dialog (_parent, e.what());
+ error_dialog(_parent, std_to_wx(e.what()));
}
}
diff --git a/src/wx/content_timeline_audio_view.cc b/src/wx/content_timeline_audio_view.cc
index cff0b5ed5..61960378e 100644
--- a/src/wx/content_timeline_audio_view.cc
+++ b/src/wx/content_timeline_audio_view.cc
@@ -62,9 +62,9 @@ ContentTimelineAudioView::label () const
DCPOMATIC_ASSERT (ac);
if (ac->gain() > 0.01) {
- s += wxString::Format (" +%.1fdB", ac->gain());
+ s += wxString::Format(char_to_wx(" +%.1fdB"), ac->gain());
} else if (ac->gain() < -0.01) {
- s += wxString::Format (" %.1fdB", ac->gain());
+ s += wxString::Format(char_to_wx(" %.1fdB"), ac->gain());
}
if (ac->delay() > 0) {
@@ -75,9 +75,9 @@ ContentTimelineAudioView::label () const
auto mapped = ac->mapping().mapped_output_channels();
if (!mapped.empty ()) {
- s += wxString::FromUTF8(" → ");
+ s += char_to_wx(" → ");
for (auto i: mapped) {
- s += std_to_wx(short_audio_channel_name(i)) + ", ";
+ s += std_to_wx(short_audio_channel_name(i)) + char_to_wx(", ");
}
s = s.Left(s.Length() - 2);
}
diff --git a/src/wx/content_view.cc b/src/wx/content_view.cc
index b2d6f86d1..4f20bdd02 100644
--- a/src/wx/content_view.cc
+++ b/src/wx/content_view.cc
@@ -132,7 +132,7 @@ ContentView::update ()
/* Add content from successful jobs and report errors */
for (auto i: jobs) {
if (i->finished_in_error()) {
- error_dialog(this, std_to_wx(i->error_summary()) + ".\n", std_to_wx(i->error_details()));
+ error_dialog(this, std_to_wx(i->error_summary()) + char_to_wx(".\n"), std_to_wx(i->error_details()));
} else {
add (i->content());
_content.push_back (i->content());
@@ -151,7 +151,7 @@ ContentView::add (shared_ptr<Content> content)
it.SetColumn(0);
auto length = content->approximate_length ();
auto const hmsf = length.split (24);
- it.SetText(wxString::Format("%02d:%02d:%02d", hmsf.h, hmsf.m, hmsf.s));
+ it.SetText(wxString::Format(char_to_wx("%02d:%02d:%02d"), hmsf.h, hmsf.m, hmsf.s));
InsertItem(it);
auto dcp = dynamic_pointer_cast<DCPContent>(content);
diff --git a/src/wx/custom_scale_dialog.cc b/src/wx/custom_scale_dialog.cc
index e750b9baa..9f825785e 100644
--- a/src/wx/custom_scale_dialog.cc
+++ b/src/wx/custom_scale_dialog.cc
@@ -64,19 +64,19 @@ CustomScaleDialog::CustomScaleDialog (wxWindow* parent, dcp::Size initial, dcp::
if (custom_ratio) {
_ratio_to_fit->SetValue (true);
_size->SetValue (false);
- _ratio->SetValue (wxString::Format("%.2f", *custom_ratio));
+ _ratio->SetValue(wxString::Format(char_to_wx("%.2f"), *custom_ratio));
_width->SetValue (initial.width);
_height->SetValue (initial.height);
} else if (custom_size) {
_ratio_to_fit->SetValue (false);
_size->SetValue (true);
- _ratio->SetValue (wxString::Format("%.2f", initial.ratio()));
+ _ratio->SetValue(wxString::Format(char_to_wx("%.2f"), initial.ratio()));
_width->SetValue (custom_size->width);
_height->SetValue (custom_size->height);
} else {
_ratio_to_fit->SetValue (true);
_size->SetValue (false);
- _ratio->SetValue (wxString::Format("%.2f", initial.ratio()));
+ _ratio->SetValue(wxString::Format(char_to_wx("%.2f"), initial.ratio()));
_width->SetValue (initial.width);
_height->SetValue (initial.height);
}
@@ -99,7 +99,7 @@ void
CustomScaleDialog::update_size_from_ratio ()
{
dcp::Size const s = fit_ratio_within (raw_convert<float>(wx_to_std(_ratio->GetValue())), _film_container);
- _size_from_ratio->SetLabelMarkup (wxString::Format("<i>%dx%d</i>", s.width, s.height));
+ _size_from_ratio->SetLabelMarkup(wxString::Format(char_to_wx("<i>%dx%d</i>"), s.width, s.height));
}
@@ -107,7 +107,7 @@ void
CustomScaleDialog::update_ratio_from_size ()
{
float const ratio = _height->GetValue() > 0 ? (float(_width->GetValue()) / _height->GetValue()) : 2;
- _ratio_from_size->SetLabelMarkup (wxString::Format("<i>%.2f:1</i>", ratio));
+ _ratio_from_size->SetLabelMarkup(wxString::Format(char_to_wx("<i>%.2f:1</i>"), ratio));
}
diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc
index 4d2ee12b9..0cff1e62b 100644
--- a/src/wx/dcp_panel.cc
+++ b/src/wx/dcp_panel.cc
@@ -146,12 +146,12 @@ DCPPanel::DCPPanel(wxNotebook* n, shared_ptr<Film> film, FilmViewer& viewer)
void
DCPPanel::add_standards()
{
- _standard->add_entry(_("SMPTE"), N_("smpte"));
+ _standard->add_entry(_("SMPTE"), string{"smpte"});
if (Config::instance()->allow_smpte_bv20() || (_film && _film->limit_to_smpte_bv20())) {
- _standard->add_entry(_("SMPTE (Bv2.0 only)"), N_("smpte-bv20"));
+ _standard->add_entry(_("SMPTE (Bv2.0 only)"), string{"smpte-bv20"});
}
- _standard->add_entry(_("Interop"), N_("interop"));
- _standard->add_entry(_("MPEG2 Interop"), N_("mpeg2-interop"));
+ _standard->add_entry(_("Interop"), string{"interop"});
+ _standard->add_entry(_("MPEG2 Interop"), string{"mpeg2-interop"});
_sizer->Layout();
}
@@ -186,19 +186,19 @@ DCPPanel::standard_changed ()
return;
}
- if (*data == N_("interop")) {
+ if (*data == char_to_wx("interop")) {
_film->set_interop(true);
_film->set_limit_to_smpte_bv20(false);
_film->set_video_encoding(VideoEncoding::JPEG2000);
- } else if (*data == N_("smpte")) {
+ } else if (*data == char_to_wx("smpte")) {
_film->set_interop(false);
_film->set_limit_to_smpte_bv20(false);
_film->set_video_encoding(VideoEncoding::JPEG2000);
- } else if (*data == N_("smpte-bv20")) {
+ } else if (*data == char_to_wx("smpte-bv20")) {
_film->set_interop(false);
_film->set_limit_to_smpte_bv20(true);
_film->set_video_encoding(VideoEncoding::JPEG2000);
- } else if (*data == N_("mpeg2-interop")) {
+ } else if (*data == char_to_wx("mpeg2-interop")) {
_film->set_interop(true);
_film->set_video_encoding(VideoEncoding::MPEG2);
}
@@ -259,7 +259,7 @@ DCPPanel::name_changed ()
return;
}
- _film->set_name (string(_name->GetValue().mb_str()));
+ _film->set_name(wx_to_std(_name->GetValue()));
}
@@ -557,7 +557,7 @@ DCPPanel::setup_container ()
checked_set(_container, iter - ratios.begin());
auto const size = fit_ratio_within(_film->container()->ratio(), _film->full_frame ());
- checked_set(_container_size, wxString::Format("%dx%d", size.width, size.height));
+ checked_set(_container_size, wxString::Format(char_to_wx("%dx%d"), size.width, size.height));
setup_dcp_name ();
@@ -1037,7 +1037,7 @@ DCPPanel::show_audio_clicked ()
void
DCPPanel::add_audio_processors ()
{
- _audio_processor->add_entry(_("None"), new wxStringClientData(N_("none")));
+ _audio_processor->add_entry(_("None"), string{"none"});
for (auto ap: AudioProcessor::visible()) {
_audio_processor->add_entry(std_to_wx(ap->name()), new wxStringClientData(std_to_wx(ap->id())));
}
diff --git a/src/wx/dcpomatic_choice.cc b/src/wx/dcpomatic_choice.cc
index f2e215439..ab7823901 100644
--- a/src/wx/dcpomatic_choice.cc
+++ b/src/wx/dcpomatic_choice.cc
@@ -34,7 +34,7 @@ Choice::Choice(wxWindow* parent)
* too small on KDE. This added empty string will be removed in the first
* call to add().
*/
- Append("");
+ Append(wxString{});
set(0);
}
diff --git a/src/wx/dkdm_output_panel.cc b/src/wx/dkdm_output_panel.cc
index 952a7d904..e78da98da 100644
--- a/src/wx/dkdm_output_panel.cc
+++ b/src/wx/dkdm_output_panel.cc
@@ -78,7 +78,7 @@ DKDMOutputPanel::DKDMOutputPanel (wxWindow* parent)
#ifdef DCPOMATIC_USE_OWN_PICKER
_folder = new DirPickerCtrl (this);
#else
- _folder = new wxDirPickerCtrl (this, wxID_ANY, wxEmptyString, wxDirSelectorPromptStr, wxDefaultPosition, wxSize (300, -1));
+ _folder = new wxDirPickerCtrl (this, wxID_ANY, wxEmptyString, char_to_wx(wxDirSelectorPromptStr), wxDefaultPosition, wxSize (300, -1));
#endif
boost::optional<boost::filesystem::path> path = Config::instance()->default_kdm_directory ();
diff --git a/src/wx/export_subtitles_dialog.cc b/src/wx/export_subtitles_dialog.cc
index 9baa1396e..312d82882 100644
--- a/src/wx/export_subtitles_dialog.cc
+++ b/src/wx/export_subtitles_dialog.cc
@@ -99,7 +99,7 @@ ExportSubtitlesDialog::path () const
if (_file->IsEnabled()) {
if (auto path = _file->path()) {
wxFileName fn(std_to_wx(path->string()));
- fn.SetExt(_interop ? "xml" : "mxf");
+ fn.SetExt(char_to_wx(_interop ? "xml" : "mxf"));
return wx_to_std(fn.GetFullPath());
}
}
diff --git a/src/wx/export_video_file_dialog.cc b/src/wx/export_video_file_dialog.cc
index 6e32a8514..226381bef 100644
--- a/src/wx/export_video_file_dialog.cc
+++ b/src/wx/export_video_file_dialog.cc
@@ -54,10 +54,10 @@ wxString format_filters[] = {
};
wxString format_extensions[] = {
- "mov",
- "mov",
- "mov",
- "mp4",
+ char_to_wx("mov"),
+ char_to_wx("mov"),
+ char_to_wx("mov"),
+ char_to_wx("mp4")
};
ExportFormat formats[] = {
diff --git a/src/wx/film_name_location_dialog.cc b/src/wx/film_name_location_dialog.cc
index b988d6251..2933c1b31 100644
--- a/src/wx/film_name_location_dialog.cc
+++ b/src/wx/film_name_location_dialog.cc
@@ -55,7 +55,7 @@ FilmNameLocationDialog::FilmNameLocationDialog (wxWindow* parent, wxString title
_folder = new DirPickerCtrl (this);
_folder->Changed.connect (bind(&FilmNameLocationDialog::folder_changed, this));
#else
- _folder = new wxDirPickerCtrl (this, wxID_ANY, wxEmptyString, wxDirSelectorPromptStr, wxDefaultPosition, wxSize (300, -1));
+ _folder = new wxDirPickerCtrl(this, wxID_ANY, wxEmptyString, char_to_wx(wxDirSelectorPromptStr), wxDefaultPosition, wxSize (300, -1));
_folder->Bind (wxEVT_DIRPICKER_CHANGED, bind(&FilmNameLocationDialog::folder_changed, this));
#endif
@@ -143,10 +143,9 @@ FilmNameLocationDialog::check_path ()
if (boost::filesystem::is_directory(path()) && !boost::filesystem::is_empty(path())) {
if (!confirm_dialog (
this,
- std_to_wx (
- String::compose(wx_to_std(_("The directory %1 already exists and is not empty. "
- "Are you sure you want to use it?")),
- path().string().c_str())
+ wxString::Format(
+ _("The directory %s already exists and is not empty. Are you sure you want to use it?"),
+ std_to_wx(path().string())
)
)) {
return false;
@@ -154,7 +153,7 @@ FilmNameLocationDialog::check_path ()
} else if (boost::filesystem::is_regular_file(path())) {
error_dialog (
this,
- String::compose (wx_to_std(_("%1 already exists as a file, so you cannot use it for a film.")), path().c_str())
+ wxString::Format(_("%s already exists as a file, so you cannot use it for a film."), std_to_wx(path().string()))
);
return false;
}
diff --git a/src/wx/fonts_dialog.cc b/src/wx/fonts_dialog.cc
index 2fecdc086..b54841c68 100644
--- a/src/wx/fonts_dialog.cc
+++ b/src/wx/fonts_dialog.cc
@@ -120,7 +120,7 @@ FontsDialog::setup ()
_fonts->SetItem(n, 0, id);
_fonts->SetItemData(n, i->id().empty());
if (i->file()) {
- _fonts->SetItem(n, 1, i->file()->filename().string());
+ _fonts->SetItem(n, 1, std_to_wx(i->file()->filename().string()));
}
++n;
}
@@ -172,16 +172,16 @@ FontsDialog::set_from_file_clicked ()
/* The wxFD_CHANGE_DIR here prevents a `could not set working directory' error 123 on Windows when using
non-Latin filenames or paths.
*/
- wxString default_dir = "";
+ wxString default_dir;
#ifdef DCPOMATIC_LINUX
if (dcp::filesystem::exists("/usr/share/fonts/truetype")) {
- default_dir = "/usr/share/fonts/truetype";
+ default_dir = char_to_wx("/usr/share/fonts/truetype");
} else {
- default_dir = "/usr/share/fonts";
+ default_dir = char_to_wx("/usr/share/fonts");
}
#endif
#ifdef DCPOMATIC_OSX
- default_dir = "/System/Library/Fonts";
+ default_dir = char_to_wx("/System/Library/Fonts");
#endif
auto d = make_wx<wxFileDialog>(this, _("Choose a font file"), default_dir, wxT(""), wxT("*.ttf;*.otf;*.ttc"), wxFD_CHANGE_DIR);
diff --git a/src/wx/full_config_dialog.cc b/src/wx/full_config_dialog.cc
index 7f95d9bb4..ec7e9758a 100644
--- a/src/wx/full_config_dialog.cc
+++ b/src/wx/full_config_dialog.cc
@@ -118,12 +118,12 @@ private:
++r;
add_label_to_sizer (table, _panel, _("Configuration file"), true, wxGBPosition (r, 0));
- _config_file = new FilePickerCtrl(_panel, _("Select configuration file"), "*.xml", true, false, "ConfigFilePath");
+ _config_file = new FilePickerCtrl(_panel, _("Select configuration file"), char_to_wx("*.xml"), true, false, "ConfigFilePath");
table->Add (_config_file, wxGBPosition (r, 1));
++r;
add_label_to_sizer (table, _panel, _("Cinema and screen database file"), true, wxGBPosition (r, 0));
- _cinemas_file = new FilePickerCtrl(_panel, _("Select cinema and screen database file"), "*.xml", true, false, "CinemaDatabasePath");
+ _cinemas_file = new FilePickerCtrl(_panel, _("Select cinema and screen database file"), char_to_wx("*.xml"), true, false, "CinemaDatabasePath");
table->Add (_cinemas_file, wxGBPosition (r, 1));
auto export_cinemas = new Button (_panel, _("Export..."));
table->Add (export_cinemas, wxGBPosition (r, 2));
@@ -333,7 +333,7 @@ private:
_enable_audio_language = new CheckBox(_panel, _("Default audio language"));
table->Add(_enable_audio_language, 1, wxEXPAND | wxALIGN_CENTRE_VERTICAL);
- _audio_language = new LanguageTagWidget(_panel, _("Default audio language to use for new DCPs"), Config::instance()->default_audio_language(), wxString("cmnr-Hant-"));
+ _audio_language = new LanguageTagWidget(_panel, _("Default audio language to use for new DCPs"), Config::instance()->default_audio_language(), char_to_wx("cmnr-Hant-"));
table->Add(_audio_language->sizer());
add_label_to_sizer (table, _panel, _("Default KDM directory"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL);
diff --git a/src/wx/full_language_tag_dialog.cc b/src/wx/full_language_tag_dialog.cc
index 5f0aca1e5..2360214f2 100644
--- a/src/wx/full_language_tag_dialog.cc
+++ b/src/wx/full_language_tag_dialog.cc
@@ -22,6 +22,7 @@
#include "full_language_tag_dialog.h"
#include "language_subtag_panel.h"
#include "subtag_list_ctrl.h"
+#include "wx_util.h"
#include "lib/dcpomatic_assert.h"
#include <dcp/language_tag.h>
#include <dcp/warnings.h>
@@ -55,8 +56,8 @@ FullLanguageTagDialog::FullLanguageTagDialog (wxWindow* parent, dcp::LanguageTag
: wxDialog (parent, wxID_ANY, _("Language Tag"), wxDefaultPosition, wxSize(-1, 500))
{
_current_tag_list = new wxListCtrl (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_SINGLE_SEL | wxLC_NO_HEADER);
- _current_tag_list->AppendColumn ("", wxLIST_FORMAT_LEFT, 200);
- _current_tag_list->AppendColumn ("", wxLIST_FORMAT_LEFT, 400);
+ _current_tag_list->AppendColumn({}, wxLIST_FORMAT_LEFT, 200);
+ _current_tag_list->AppendColumn({}, wxLIST_FORMAT_LEFT, 400);
auto button_sizer = new wxBoxSizer (wxVERTICAL);
_add_script = new wxButton(this, wxID_ANY, "Add script");
@@ -212,11 +213,11 @@ FullLanguageTagDialog::add_to_current_tag (dcp::LanguageTag::SubtagType type, op
wxListItem it;
it.SetId (_current_tag_list->GetItemCount());
it.SetColumn (0);
- it.SetText (subtag_type_name(type));
+ it.SetText(std_to_wx(subtag_type_name(type)));
_current_tag_list->InsertItem (it);
it.SetColumn (1);
if (subtag) {
- it.SetText (subtag->description);
+ it.SetText(std_to_wx(subtag->description));
} else {
it.SetText ("Select...");
}
@@ -251,8 +252,8 @@ FullLanguageTagDialog::chosen_subtag_changed (optional<dcp::LanguageTag::SubtagD
auto selected = _current_tag_list->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
if (selected >= 0) {
_current_tag_subtags[selected].subtag = *selection;
- _current_tag_list->SetItem (selected, 0, subtag_type_name(_current_tag_subtags[selected].type));
- _current_tag_list->SetItem (selected, 1, selection->description);
+ _current_tag_list->SetItem(selected, 0, std_to_wx(subtag_type_name(_current_tag_subtags[selected].type)));
+ _current_tag_list->SetItem(selected, 1, std_to_wx(selection->description));
}
setup_sensitivity ();
diff --git a/src/wx/gl_video_view.cc b/src/wx/gl_video_view.cc
index c96fd02a0..81156c67c 100644
--- a/src/wx/gl_video_view.cc
+++ b/src/wx/gl_video_view.cc
@@ -134,7 +134,7 @@ GLVideoView::check_for_butler_errors ()
try {
_viewer->butler()->rethrow ();
} catch (DecodeError& e) {
- error_dialog (get(), e.what());
+ error_dialog(get(), std_to_wx(e.what()));
} catch (dcp::ReadError& e) {
error_dialog (get(), wxString::Format(_("Could not read DCP: %s"), std_to_wx(e.what())));
}
diff --git a/src/wx/hints_dialog.cc b/src/wx/hints_dialog.cc
index 72a57740e..f22141621 100644
--- a/src/wx/hints_dialog.cc
+++ b/src/wx/hints_dialog.cc
@@ -146,7 +146,7 @@ HintsDialog::update ()
_text->WriteText (_("There are no hints yet: project check in progress."));
}
} else {
- _text->BeginStandardBullet (N_("standard/circle"), 1, 50);
+ _text->BeginStandardBullet(char_to_wx("standard/circle"), 1, 50);
for (auto i: _current) {
_text->WriteText (std_to_wx (i));
_text->Newline ();
diff --git a/src/wx/html_dialog.cc b/src/wx/html_dialog.cc
index 44b51bbe0..c139db72b 100644
--- a/src/wx/html_dialog.cc
+++ b/src/wx/html_dialog.cc
@@ -44,14 +44,14 @@ HTMLDialog::HTMLDialog (wxWindow* parent, wxString title, wxString html, bool ok
/* Add some resources that are used by HTML passed into this dialog */
wxMemoryFSHandler::AddFile(
- "me.jpg",
+ char_to_wx("me.jpg"),
wxBitmap(bitmap_path("me.jpg"), wxBITMAP_TYPE_JPEG), wxBITMAP_TYPE_JPEG
);
auto h = new wxHtmlWindow (this);
if (gui_is_dark()) {
- h->SetPage(wxString::Format("<body text=\"white\">%s</body>", html));
+ h->SetPage(wxString::Format(char_to_wx("<body text=\"white\">%s</body>"), html));
h->SetHTMLBackgroundColour(wxColour(50, 50, 50));
} else {
h->SetPage(html);
@@ -81,7 +81,7 @@ HTMLDialog::HTMLDialog (wxWindow* parent, wxString title, wxString html, bool ok
HTMLDialog::~HTMLDialog()
{
- wxMemoryFSHandler::RemoveFile("me.jpg");
+ wxMemoryFSHandler::RemoveFile(char_to_wx("me.jpg"));
}
diff --git a/src/wx/image_sequence_dialog.cc b/src/wx/image_sequence_dialog.cc
index 0484b900e..6d1d00c49 100644
--- a/src/wx/image_sequence_dialog.cc
+++ b/src/wx/image_sequence_dialog.cc
@@ -18,17 +18,20 @@
*/
-#include "wx_util.h"
+
#include "image_sequence_dialog.h"
+#include "wx_util.h"
#include <dcp/locale_convert.h>
+
using dcp::locale_convert;
+
ImageSequenceDialog::ImageSequenceDialog (wxWindow* parent)
: TableDialog (parent, _("Add image sequence"), 2, 1, true)
{
add (_("Frame rate"), true);
- _frame_rate = add (new wxTextCtrl (this, wxID_ANY, N_("24")));
+ _frame_rate = add(new wxTextCtrl(this, wxID_ANY, char_to_wx("24")));
layout ();
}
diff --git a/src/wx/kdm_choice.cc b/src/wx/kdm_choice.cc
index c8685e22c..113ad51b5 100644
--- a/src/wx/kdm_choice.cc
+++ b/src/wx/kdm_choice.cc
@@ -20,15 +20,16 @@
#include "kdm_choice.h"
+#include "wx_util.h"
KDMChoice::KDMChoice (wxWindow* parent)
: wxChoice (parent, wxID_ANY)
{
- Append("Modified Transitional 1", reinterpret_cast<void*>(dcp::Formulation::MODIFIED_TRANSITIONAL_1));
- Append("DCI Any", reinterpret_cast<void*>(dcp::Formulation::DCI_ANY));
- Append("DCI Specific", reinterpret_cast<void*>(dcp::Formulation::DCI_SPECIFIC));
- Append("Multiple Modified Transitional 1", reinterpret_cast<void*>(dcp::Formulation::MULTIPLE_MODIFIED_TRANSITIONAL_1));
+ Append(char_to_wx("Modified Transitional 1"), reinterpret_cast<void*>(dcp::Formulation::MODIFIED_TRANSITIONAL_1));
+ Append(char_to_wx("DCI Any"), reinterpret_cast<void*>(dcp::Formulation::DCI_ANY));
+ Append(char_to_wx("DCI Specific"), reinterpret_cast<void*>(dcp::Formulation::DCI_SPECIFIC));
+ Append(char_to_wx("Multiple Modified Transitional 1"), reinterpret_cast<void*>(dcp::Formulation::MULTIPLE_MODIFIED_TRANSITIONAL_1));
}
diff --git a/src/wx/kdm_cpl_panel.cc b/src/wx/kdm_cpl_panel.cc
index 523d0c369..e07df105d 100644
--- a/src/wx/kdm_cpl_panel.cc
+++ b/src/wx/kdm_cpl_panel.cc
@@ -52,13 +52,13 @@ KDMCPLPanel::KDMCPLPanel (wxWindow* parent, vector<CPLSummary> cpls)
/* CPL details */
auto table = new wxFlexGridSizer(2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
add_label_to_sizer (table, this, _("DCP directory"), true);
- _dcp_directory = new StaticText (this, "");
+ _dcp_directory = new StaticText(this, {});
table->Add (_dcp_directory);
add_label_to_sizer (table, this, _("CPL ID"), true);
- _cpl_id = new StaticText (this, "");
+ _cpl_id = new StaticText(this, {});
table->Add (_cpl_id);
add_label_to_sizer (table, this, _("CPL annotation text"), true);
- _cpl_annotation_text = new StaticText (this, "");
+ _cpl_annotation_text = new StaticText(this, {});
table->Add (_cpl_annotation_text);
vertical->Add (table, 0, wxEXPAND | wxTOP, DCPOMATIC_SIZER_GAP + 2);
@@ -104,7 +104,7 @@ KDMCPLPanel::update_cpl_summary ()
void
KDMCPLPanel::cpl_browse_clicked ()
{
- auto d = make_wx<wxFileDialog>(this, _("Select CPL XML file"), wxEmptyString, wxEmptyString, "*.xml");
+ auto d = make_wx<wxFileDialog>(this, _("Select CPL XML file"), wxEmptyString, wxEmptyString, char_to_wx("*.xml"));
if (d->ShowModal() == wxID_CANCEL) {
return;
}
diff --git a/src/wx/kdm_output_panel.cc b/src/wx/kdm_output_panel.cc
index b4d94838b..78186e4cb 100644
--- a/src/wx/kdm_output_panel.cc
+++ b/src/wx/kdm_output_panel.cc
@@ -117,7 +117,7 @@ KDMOutputPanel::KDMOutputPanel (wxWindow* parent)
#ifdef DCPOMATIC_USE_OWN_PICKER
_folder = new DirPickerCtrl (this);
#else
- _folder = new wxDirPickerCtrl (this, wxID_ANY, wxEmptyString, wxDirSelectorPromptStr, wxDefaultPosition, wxSize (300, -1));
+ _folder = new wxDirPickerCtrl (this, wxID_ANY, wxEmptyString, char_to_wx(wxDirSelectorPromptStr), wxDefaultPosition, wxSize (300, -1));
#endif
auto path = Config::instance()->default_kdm_directory();
diff --git a/src/wx/language_subtag_panel.cc b/src/wx/language_subtag_panel.cc
index 6d35da04e..4e47ddbe6 100644
--- a/src/wx/language_subtag_panel.cc
+++ b/src/wx/language_subtag_panel.cc
@@ -20,6 +20,7 @@
#include "language_subtag_panel.h"
+#include "wx_util.h"
#include <dcp/warnings.h>
LIBDCP_DISABLE_WARNINGS
#include <wx/srchctrl.h>
@@ -58,7 +59,7 @@ void
LanguageSubtagPanel::set(dcp::LanguageTag::SubtagType type, string search, optional<dcp::LanguageTag::SubtagData> subtag)
{
_list->set(type, search, subtag);
- _search->SetValue(wxString(search));
+ _search->SetValue(std_to_wx(search));
}
@@ -77,11 +78,11 @@ void
LanguageSubtagPanel::search_changed()
{
auto search = _search->GetValue();
- _list->set_search(search.ToStdString());
+ _list->set_search(wx_to_std(search));
if (search.Length() > 0 && _list->GetItemCount() > 0) {
_list->EnsureVisible (0);
}
- SearchChanged(_search->GetValue().ToStdString());
+ SearchChanged(wx_to_std(_search->GetValue()));
}
diff --git a/src/wx/language_tag_dialog.cc b/src/wx/language_tag_dialog.cc
index b472edab0..c898d3edb 100644
--- a/src/wx/language_tag_dialog.cc
+++ b/src/wx/language_tag_dialog.cc
@@ -38,8 +38,8 @@ LanguageTagDialog::LanguageTagDialog (wxWindow* parent, dcp::LanguageTag tag)
: wxDialog (parent, wxID_ANY, _("Language Tag"))
{
_list = new wxListCtrl (this, wxID_ANY, wxDefaultPosition, wxSize(600, 700), wxLC_REPORT | wxLC_SINGLE_SEL | wxLC_NO_HEADER);
- _list->AppendColumn ("", wxLIST_FORMAT_LEFT, 400);
- _list->AppendColumn ("", wxLIST_FORMAT_LEFT, 150);
+ _list->AppendColumn({}, wxLIST_FORMAT_LEFT, 400);
+ _list->AppendColumn({}, wxLIST_FORMAT_LEFT, 150);
auto add = new wxButton (this, wxID_ANY, _("Add language..."));
auto overall_sizer = new wxBoxSizer (wxVERTICAL);
diff --git a/src/wx/markers_panel.cc b/src/wx/markers_panel.cc
index baf221f3e..3ce9cd5a5 100644
--- a/src/wx/markers_panel.cc
+++ b/src/wx/markers_panel.cc
@@ -246,8 +246,8 @@ MarkersPanel::mouse_right_down (wxMouseEvent& ev)
{
wxMenu menu;
if (_over) {
- menu.Append (ID_move_marker_to_current_position, wxString::Format(_("Move %s marker to current position"), wx_to_std(dcp::marker_to_string(*_over))));
- menu.Append (ID_remove_marker, wxString::Format(_("Remove %s marker"), wx_to_std(dcp::marker_to_string(*_over))));
+ menu.Append (ID_move_marker_to_current_position, wxString::Format(_("Move %s marker to current position"), std_to_wx(dcp::marker_to_string(*_over))));
+ menu.Append (ID_remove_marker, wxString::Format(_("Remove %s marker"), std_to_wx(dcp::marker_to_string(*_over))));
}
auto add_marker = new wxMenu ();
diff --git a/src/wx/metadata_dialog.cc b/src/wx/metadata_dialog.cc
index 1d0758175..8691d2f02 100644
--- a/src/wx/metadata_dialog.cc
+++ b/src/wx/metadata_dialog.cc
@@ -204,9 +204,9 @@ MetadataDialog::setup_standard (wxPanel* panel, wxSizer* sizer)
{
add_label_to_sizer(sizer, panel, _("Territory type"), true, 0, wxALIGN_CENTER_VERTICAL);
_territory_type = new Choice(panel);
- _territory_type->add_entry(_("Specific"), wx_to_std(territory_type_to_string(TerritoryType::SPECIFIC)));
- _territory_type->add_entry(_("International texted"), wx_to_std(territory_type_to_string(TerritoryType::INTERNATIONAL_TEXTED)));
- _territory_type->add_entry(_("International textless"), wx_to_std(territory_type_to_string(TerritoryType::INTERNATIONAL_TEXTLESS)));
+ _territory_type->add_entry(_("Specific"), std_to_wx(territory_type_to_string(TerritoryType::SPECIFIC)));
+ _territory_type->add_entry(_("International texted"), std_to_wx(territory_type_to_string(TerritoryType::INTERNATIONAL_TEXTED)));
+ _territory_type->add_entry(_("International textless"), std_to_wx(territory_type_to_string(TerritoryType::INTERNATIONAL_TEXTLESS)));
sizer->Add(_territory_type);
_enable_release_territory = new CheckBox(panel, _("Release territory"));
diff --git a/src/wx/name_format_editor.cc b/src/wx/name_format_editor.cc
index 67e2517be..8f325efaf 100644
--- a/src/wx/name_format_editor.cc
+++ b/src/wx/name_format_editor.cc
@@ -30,9 +30,9 @@ using std::string;
NameFormatEditor::NameFormatEditor (wxWindow* parent, dcp::NameFormat name, dcp::NameFormat::Map titles, dcp::NameFormat::Map examples, string suffix)
: _panel (new wxPanel(parent))
- , _example (new StaticText(_panel, ""))
+ , _example(new StaticText(_panel, {}))
, _sizer (new wxBoxSizer(wxVERTICAL))
- , _specification (new wxTextCtrl(_panel, wxID_ANY, ""))
+ , _specification(new wxTextCtrl(_panel, wxID_ANY, {}))
, _name (name)
, _examples (examples)
, _suffix (suffix)
@@ -83,7 +83,7 @@ NameFormatEditor::update_example ()
wxString wrapped;
for (size_t i = 0; i < example.Length(); ++i) {
if (i > 0 && (i % 40) == 0) {
- wrapped += "\n";
+ wrapped += char_to_wx("\n");
}
wrapped += example[i];
}
diff --git a/src/wx/player_config_dialog.cc b/src/wx/player_config_dialog.cc
index d9dcee6d2..304abc9b4 100644
--- a/src/wx/player_config_dialog.cc
+++ b/src/wx/player_config_dialog.cc
@@ -133,7 +133,7 @@ private:
++r;
add_label_to_sizer (table, _panel, _("Debug log file"), true, wxGBPosition (r, 0));
- _debug_log_file = new FilePickerCtrl(_panel, _("Select debug log file"), "*", false, true, "DebugLogPath");
+ _debug_log_file = new FilePickerCtrl(_panel, _("Select debug log file"), char_to_wx("*"), false, true, "DebugLogPath");
table->Add (_debug_log_file, wxGBPosition(r, 1));
++r;
diff --git a/src/wx/player_information.cc b/src/wx/player_information.cc
index 395dbc367..c045d0498 100644
--- a/src/wx/player_information.cc
+++ b/src/wx/player_information.cc
@@ -136,7 +136,7 @@ PlayerInformation::triggered_update ()
checked_set(_dcp[r], std_to_wx(dcp->name()));
wxString tooltip;
for (auto directory: dcp->directories()) {
- tooltip += std_to_wx(directory.string()) + "\n";
+ tooltip += std_to_wx(directory.string() + "\n");
}
if (!tooltip.empty()) {
_dcp[r]->SetToolTip(tooltip.substr(0, tooltip.length() - 1));
diff --git a/src/wx/qube_certificate_panel.cc b/src/wx/qube_certificate_panel.cc
index b40a9ecf6..a9da29fdf 100644
--- a/src/wx/qube_certificate_panel.cc
+++ b/src/wx/qube_certificate_panel.cc
@@ -89,5 +89,5 @@ QubeCertificatePanel::do_download ()
wxString
QubeCertificatePanel::name () const
{
- return _("Qube") + " " + std_to_wx(_type);
+ return wxString::Format(_("Qube %s"), std_to_wx(_type));
}
diff --git a/src/wx/recipients_panel.cc b/src/wx/recipients_panel.cc
index 9596c3cfd..33b715260 100644
--- a/src/wx/recipients_panel.cc
+++ b/src/wx/recipients_panel.cc
@@ -222,7 +222,7 @@ RecipientsPanel::selection_changed ()
void
RecipientsPanel::add_recipients ()
{
- _root = _targets->AddRoot ("Foo");
+ _root = _targets->AddRoot(char_to_wx("Foo"));
DKDMRecipientList recipients;
for (auto const& recipient: recipients.dkdm_recipients()) {
diff --git a/src/wx/report_problem_dialog.cc b/src/wx/report_problem_dialog.cc
index 4d8df87ef..701f9dc21 100644
--- a/src/wx/report_problem_dialog.cc
+++ b/src/wx/report_problem_dialog.cc
@@ -117,7 +117,7 @@ ReportProblemDialog::report ()
return;
}
- if (_email->GetValue() == "carl@dcpomatic.com" || _email->GetValue() == "cth@carlh.net") {
+ if (_email->GetValue() == char_to_wx("carl@dcpomatic.com") || _email->GetValue() == char_to_wx("cth@carlh.net")) {
error_dialog (this, wxString::Format(_("Enter your email address for the contact, not %s"), _email->GetValue().data()));
return;
}
diff --git a/src/wx/self_dkdm_dialog.cc b/src/wx/self_dkdm_dialog.cc
index 4702557e7..d6a399f7d 100644
--- a/src/wx/self_dkdm_dialog.cc
+++ b/src/wx/self_dkdm_dialog.cc
@@ -88,7 +88,7 @@ SelfDKDMDialog::SelfDKDMDialog (wxWindow* parent, std::shared_ptr<const Film> fi
#ifdef DCPOMATIC_USE_OWN_PICKER
_folder = new DirPickerCtrl (this);
#else
- _folder = new wxDirPickerCtrl (this, wxID_ANY, wxEmptyString, wxDirSelectorPromptStr, wxDefaultPosition, wxSize (300, -1));
+ _folder = new wxDirPickerCtrl (this, wxID_ANY, wxEmptyString, char_to_wx(wxDirSelectorPromptStr), wxDefaultPosition, wxSize (300, -1));
#endif
_folder->SetPath (wxStandardPaths::Get().GetDocumentsDir());
diff --git a/src/wx/simple_video_view.cc b/src/wx/simple_video_view.cc
index cbfd7d4ac..84c837757 100644
--- a/src/wx/simple_video_view.cc
+++ b/src/wx/simple_video_view.cc
@@ -205,7 +205,7 @@ SimpleVideoView::display_next_frame (bool non_blocking)
try {
_viewer->butler()->rethrow ();
} catch (DecodeError& e) {
- error_dialog (get(), e.what());
+ error_dialog(get(), std_to_wx(e.what()));
}
return SUCCESS;
diff --git a/src/wx/subtag_list_ctrl.cc b/src/wx/subtag_list_ctrl.cc
index 777824441..185e28583 100644
--- a/src/wx/subtag_list_ctrl.cc
+++ b/src/wx/subtag_list_ctrl.cc
@@ -20,6 +20,7 @@
#include "subtag_list_ctrl.h"
+#include "wx_util.h"
#include "lib/dcpomatic_assert.h"
LIBDCP_DISABLE_WARNINGS
#include <wx/wx.h>
@@ -34,8 +35,8 @@ using boost::optional;
SubtagListCtrl::SubtagListCtrl(wxWindow* parent)
: wxListCtrl(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_SINGLE_SEL | wxLC_NO_HEADER | wxLC_VIRTUAL)
{
- AppendColumn("", wxLIST_FORMAT_LEFT, 80);
- AppendColumn("", wxLIST_FORMAT_LEFT, 400);
+ AppendColumn(char_to_wx(""), wxLIST_FORMAT_LEFT, 80);
+ AppendColumn(char_to_wx(""), wxLIST_FORMAT_LEFT, 400);
}
@@ -102,9 +103,9 @@ wxString
SubtagListCtrl::OnGetItemText(long item, long column) const
{
if (column == 0) {
- return _matching_subtags[item].subtag;
+ return std_to_wx(_matching_subtags[item].subtag);
} else {
- return _matching_subtags[item].description;
+ return std_to_wx(_matching_subtags[item].description);
}
}
diff --git a/src/wx/subtitle_appearance_dialog.cc b/src/wx/subtitle_appearance_dialog.cc
index d88f74725..44e7b88d8 100644
--- a/src/wx/subtitle_appearance_dialog.cc
+++ b/src/wx/subtitle_appearance_dialog.cc
@@ -111,10 +111,10 @@ SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr
_colour_table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
_colour_table->AddGrowableCol (1, 1);
- wxStaticText* t = new StaticText (_colours_panel, "");
+ wxStaticText* t = new StaticText(_colours_panel, {});
t->SetLabelMarkup (_("<b>Original colour</b>"));
_colour_table->Add (t, 1, wxEXPAND);
- t = new StaticText (_colours_panel, "", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE_HORIZONTAL);
+ t = new StaticText (_colours_panel, {}, wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE_HORIZONTAL);
t->SetLabelMarkup (_("<b>New colour</b>"));
_colour_table->Add (t, 1, wxALIGN_CENTER);
diff --git a/src/wx/text_panel.cc b/src/wx/text_panel.cc
index 4b6e900db..b23ce2141 100644
--- a/src/wx/text_panel.cc
+++ b/src/wx/text_panel.cc
@@ -166,7 +166,7 @@ TextPanel::setup_visibility ()
_language_label = create_label (this, _("Language"), true);
add_label_to_sizer (_grid, _language_label, true, wxGBPosition(_ccap_track_or_language_row, 0));
_language_sizer = new wxBoxSizer (wxHORIZONTAL);
- _language = new LanguageTagWidget (this, _("Language of these subtitles"), boost::none, wxString("en-US-"));
+ _language = new LanguageTagWidget(this, _("Language of these subtitles"), boost::none, char_to_wx("en-US-"));
_language->Changed.connect (boost::bind(&TextPanel::language_changed, this));
_language_sizer->Add (_language->sizer(), 1, wxRIGHT, DCPOMATIC_SIZER_GAP);
_language_type = new wxChoice (this, wxID_ANY);
diff --git a/src/wx/time_picker.cc b/src/wx/time_picker.cc
index 2bc3556fd..8016f79f5 100644
--- a/src/wx/time_picker.cc
+++ b/src/wx/time_picker.cc
@@ -115,8 +115,8 @@ TimePickerText::TimePickerText (wxWindow* parent, wxDateTime time)
_minutes->MoveAfterInTabOrder (_hours);
- _hours->SetValue (wxString::Format("%d", time.GetHour()));
- _minutes->SetValue (wxString::Format("%d", time.GetMinute()));
+ _hours->SetValue(wxString::Format(char_to_wx("%d"), time.GetHour()));
+ _minutes->SetValue(wxString::Format(char_to_wx("%d"), time.GetMinute()));
_hours->Bind (wxEVT_TEXT, (bind(&TimePickerText::changed, this)));
_minutes->Bind (wxEVT_TEXT, (bind(&TimePickerText::changed, this)));
diff --git a/src/wx/timer_display.cc b/src/wx/timer_display.cc
index a559bb30f..4dd9adf42 100644
--- a/src/wx/timer_display.cc
+++ b/src/wx/timer_display.cc
@@ -46,7 +46,7 @@ TimerDisplay::TimerDisplay (wxWindow* parent, StateTimer const & timer, int gets
return a.second.total_time > b.second.total_time;
});
- add (wxString("get() calls"), true);
+ add(char_to_wx("get() calls"), true);
add (std_to_wx(dcp::locale_convert<string>(gets)), false);
add_spacer ();
add_spacer ();
diff --git a/src/wx/update_dialog.cc b/src/wx/update_dialog.cc
index 7c687aa60..0c8a55f8e 100644
--- a/src/wx/update_dialog.cc
+++ b/src/wx/update_dialog.cc
@@ -52,13 +52,13 @@ UpdateDialog::UpdateDialog (wxWindow* parent, optional<string> stable, optional<
if (stable) {
add_label_to_sizer (table, this, _("Stable version ") + std_to_wx(stable.get()), true, 0, wxALIGN_CENTER_VERTICAL);
- auto h = new wxHyperlinkCtrl (this, wxID_ANY, "dcpomatic.com/download", "https://dcpomatic.com/download");
+ auto h = new wxHyperlinkCtrl(this, wxID_ANY, char_to_wx("dcpomatic.com/download"), char_to_wx("https://dcpomatic.com/download"));
table->Add (h, 0, wxALIGN_CENTER_VERTICAL, DCPOMATIC_DIALOG_BORDER);
}
if (test) {
add_label_to_sizer (table, this, _("Test version ") + std_to_wx(test.get()), true, 0, wxALIGN_CENTER_VERTICAL);
- auto h = new wxHyperlinkCtrl (this, wxID_ANY, "dcpomatic.com/test-download", "https://dcpomatic.com/test-download");
+ auto h = new wxHyperlinkCtrl(this, wxID_ANY, char_to_wx("dcpomatic.com/test-download"), char_to_wx("https://dcpomatic.com/test-download"));
table->Add (h, 0, wxALIGN_CENTER_VERTICAL, DCPOMATIC_DIALOG_BORDER);
}
diff --git a/src/wx/verify_dcp_result_panel.cc b/src/wx/verify_dcp_result_panel.cc
index aaa4b2fc9..672bca8e3 100644
--- a/src/wx/verify_dcp_result_panel.cc
+++ b/src/wx/verify_dcp_result_panel.cc
@@ -105,49 +105,49 @@ VerifyDCPResultPanel::fill(shared_ptr<VerifyDCPJob> job)
auto substitute = [](wxString message, dcp::VerificationNote const& note) {
if (note.reference_hash()) {
- message.Replace("%reference_hash", std_to_wx(note.reference_hash().get()));
+ message.Replace(char_to_wx("%reference_hash"), std_to_wx(note.reference_hash().get()));
}
if (note.calculated_hash()) {
- message.Replace("%calculated_hash", std_to_wx(note.calculated_hash().get()));
+ message.Replace(char_to_wx("%calculated_hash"), std_to_wx(note.calculated_hash().get()));
}
if (note.frame()) {
- message.Replace("%frame", std_to_wx(dcp::raw_convert<string>(note.frame().get())));
+ message.Replace(char_to_wx("%frame"), std_to_wx(dcp::raw_convert<string>(note.frame().get())));
message.Replace(
- "%timecode",
+ char_to_wx("%timecode"),
std_to_wx(
dcp::Time(note.frame().get(), note.frame_rate().get(), note.frame_rate().get()).as_string(dcp::Standard::SMPTE)
));
}
if (note.note()) {
- message.Replace("%n", std_to_wx(note.note().get()));
+ message.Replace(char_to_wx("%n"), std_to_wx(note.note().get()));
}
if (note.file()) {
- message.Replace("%f", std_to_wx(note.file()->filename().string()));
+ message.Replace(char_to_wx("%f"), std_to_wx(note.file()->filename().string()));
}
if (note.line()) {
- message.Replace("%l", std_to_wx(dcp::raw_convert<string>(note.line().get())));
+ message.Replace(char_to_wx("%l"), std_to_wx(dcp::raw_convert<string>(note.line().get())));
}
if (note.component()) {
- message.Replace("%component", std_to_wx(dcp::raw_convert<string>(note.component().get())));
+ message.Replace(char_to_wx("%component"), std_to_wx(dcp::raw_convert<string>(note.component().get())));
}
if (note.size()) {
- message.Replace("%size", std_to_wx(dcp::raw_convert<string>(note.size().get())));
+ message.Replace(char_to_wx("%size"), std_to_wx(dcp::raw_convert<string>(note.size().get())));
}
if (note.id()) {
- message.Replace("%id", std_to_wx(note.id().get()));
+ message.Replace(char_to_wx("%id"), std_to_wx(note.id().get()));
}
if (note.other_id()) {
- message.Replace("%other_id", std_to_wx(note.other_id().get()));
+ message.Replace(char_to_wx("%other_id"), std_to_wx(note.other_id().get()));
}
if (note.cpl_id()) {
- message.Replace("%cpl", std_to_wx(note.cpl_id().get()));
+ message.Replace(char_to_wx("%cpl"), std_to_wx(note.cpl_id().get()));
}
return message;
};
auto add_bullet = [this](dcp::VerificationNote::Type type, wxString message) {
- _pages[type]->BeginStandardBullet(N_("standard/diamond"), 1, 50);
+ _pages[type]->BeginStandardBullet(char_to_wx("standard/diamond"), 1, 50);
_pages[type]->WriteText(message);
_pages[type]->Newline();
_pages[type]->EndStandardBullet();
@@ -606,7 +606,7 @@ VerifyDCPResultPanel::fill(shared_ptr<VerifyDCPJob> job)
summary_text = _("1 error, ");
} else {
/// TRANSLATORS: this will be used at the start of a string like "1 error, 2 Bv2.1 errors and 3 warnings."
- summary_text = wxString::Format("%d errors, ", counts[dcp::VerificationNote::Type::ERROR]);
+ summary_text = wxString::Format(_("%d errors, "), counts[dcp::VerificationNote::Type::ERROR]);
}
if (counts[dcp::VerificationNote::Type::BV21_ERROR] == 1) {
@@ -614,7 +614,7 @@ VerifyDCPResultPanel::fill(shared_ptr<VerifyDCPJob> job)
summary_text += _("1 Bv2.1 error, ");
} else {
/// TRANSLATORS: this will be used in the middle of a string like "1 error, 2 Bv2.1 errors and 3 warnings."
- summary_text += wxString::Format("%d Bv2.1 errors, ", counts[dcp::VerificationNote::Type::BV21_ERROR]);
+ summary_text += wxString::Format(_("%d Bv2.1 errors, "), counts[dcp::VerificationNote::Type::BV21_ERROR]);
}
if (counts[dcp::VerificationNote::Type::WARNING] == 1) {
@@ -622,7 +622,7 @@ VerifyDCPResultPanel::fill(shared_ptr<VerifyDCPJob> job)
summary_text += _("and 1 warning.");
} else {
/// TRANSLATORS: this will be used at the end of a string like "1 error, 2 Bv2.1 errors and 3 warnings."
- summary_text += wxString::Format("and %d warnings.", counts[dcp::VerificationNote::Type::WARNING]);
+ summary_text += wxString::Format(_("and %d warnings."), counts[dcp::VerificationNote::Type::WARNING]);
}
_summary->SetLabel(summary_text);
diff --git a/src/wx/video_waveform_dialog.cc b/src/wx/video_waveform_dialog.cc
index 73ccc82df..0e3c6cf8c 100644
--- a/src/wx/video_waveform_dialog.cc
+++ b/src/wx/video_waveform_dialog.cc
@@ -72,11 +72,11 @@ VideoWaveformDialog::VideoWaveformDialog(wxWindow* parent, weak_ptr<const Film>
wxBoxSizer* position = new wxBoxSizer (wxHORIZONTAL);
add_label_to_sizer (position, this, _("Image X position"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL);
- _x_position = new StaticText (this, "");
+ _x_position = new StaticText(this, {});
_x_position->SetMinSize (wxSize (64, -1));
position->Add (_x_position, 0, wxALL, DCPOMATIC_SIZER_X_GAP);
add_label_to_sizer (position, this, _("component value"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL);
- _value = new StaticText (this, "");
+ _value = new StaticText(this, {});
_value->SetMinSize (wxSize (64, -1));
position->Add (_value, 0, wxALL, DCPOMATIC_SIZER_X_GAP);
overall_sizer->Add (position, 0, wxEXPAND | wxALL, DCPOMATIC_SIZER_Y_GAP);
@@ -132,14 +132,14 @@ void
VideoWaveformDialog::mouse_moved (int x1, int x2, int y1, int y2)
{
if (x1 != x2) {
- _x_position->SetLabel (wxString::Format ("%d-%d", x1, x2));
+ _x_position->SetLabel(wxString::Format(char_to_wx("%d-%d"), x1, x2));
} else {
- _x_position->SetLabel (wxString::Format ("%d", x1));
+ _x_position->SetLabel(wxString::Format(char_to_wx("%d"), x1));
}
if (y1 != y2) {
- _value->SetLabel (wxString::Format ("%d-%d", y1, y2));
+ _value->SetLabel(wxString::Format(char_to_wx("%d-%d"), y1, y2));
} else {
- _value->SetLabel (wxString::Format ("%d", y1));
+ _value->SetLabel(wxString::Format(char_to_wx("%d"), y1));
}
}
diff --git a/src/wx/wscript b/src/wx/wscript
index 9471b9acd..6a0a9ced9 100644
--- a/src/wx/wscript
+++ b/src/wx/wscript
@@ -234,7 +234,7 @@ def configure(conf):
conf.env.append_value('CXXFLAGS', ['-DGL_GLEXT_PROTOTYPES', '-DGLX_GLXEXT_PROTOTYPES'])
if conf.env.TARGET_WINDOWS_64 or conf.env.TARGET_WINDOWS_32:
conf.env.append_value('CXXFLAGS', ['-DWGL_WGLEXT_PROTOTYPES'])
- conf.env.append_value('CXXFLAGS', ['-DwxNO_UNSAFE_WXSTRING_CONV'])
+ conf.env.append_value('CXXFLAGS', ['-DwxNO_UNSAFE_WXSTRING_CONV', '-DwxNO_IMPLICIT_WXSTRING_ENCODING'])
if conf.options.static_wxwidgets:
# wx-config returns its static libraries as full paths, without -l prefixes, which confuses
diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc
index f3d75a462..7f16760e0 100644
--- a/src/wx/wx_util.cc
+++ b/src/wx/wx_util.cc
@@ -499,7 +499,7 @@ dcpomatic_setup_i18n ()
#endif
#ifdef DCPOMATIC_LINUX
- locale->AddCatalogLookupPathPrefix (LINUX_LOCALE_PREFIX);
+ locale->AddCatalogLookupPathPrefix(std_to_wx(LINUX_LOCALE_PREFIX));
/* We have to include the wxWidgets .mo in our distribution,
so we rename it to avoid clashes with any other installation