diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-08-09 02:02:20 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-09-03 17:02:24 +0200 |
| commit | 5527bdb269e355ca95aa91fe3907bfef0ef17ff4 (patch) | |
| tree | 5dd2fc2e81cf193c9712606f43f1e13e1a6e46bf /src/tools | |
| parent | a27964bd1794bb6a843873a0eaf3faa2c5cc317a (diff) | |
Remove some implicit conversions between wxString and std::string.
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/dcpomatic.cc | 6 | ||||
| -rw-r--r-- | src/tools/dcpomatic_combiner.cc | 6 | ||||
| -rw-r--r-- | src/tools/dcpomatic_disk.cc | 6 | ||||
| -rw-r--r-- | src/tools/dcpomatic_editor.cc | 4 | ||||
| -rw-r--r-- | src/tools/dcpomatic_kdm.cc | 6 | ||||
| -rw-r--r-- | src/tools/dcpomatic_player.cc | 16 | ||||
| -rw-r--r-- | src/tools/dcpomatic_playlist.cc | 4 | ||||
| -rw-r--r-- | src/tools/dcpomatic_server.cc | 4 | ||||
| -rw-r--r-- | src/tools/dcpomatic_verifier.cc | 4 |
9 files changed, 28 insertions, 28 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 5e56a2672..a2e44280c 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -575,7 +575,7 @@ private: } } wxString message = _("Could not create folder to store film."); - message += " "; + message += char_to_wx(" "); if (!found_bad_chars.empty()) { message += wxString::Format (_("Try removing the %s characters from your folder name."), std_to_wx(found_bad_chars).data()); } else { @@ -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())); } } |
