diff options
Diffstat (limited to 'src/tools/dcpomatic_editor.cc')
| -rw-r--r-- | src/tools/dcpomatic_editor.cc | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/src/tools/dcpomatic_editor.cc b/src/tools/dcpomatic_editor.cc index 14ff6da7f..3ca314355 100644 --- a/src/tools/dcpomatic_editor.cc +++ b/src/tools/dcpomatic_editor.cc @@ -24,16 +24,19 @@ #include "wx/id.h" #include "wx/wx_signal_manager.h" #include "wx/wx_util.h" +#include "wx/wx_variant.h" #include "lib/constants.h" #include "lib/cross.h" #include "lib/dcpomatic_log.h" #include "lib/null_log.h" +#include "lib/util.h" +#include "lib/variant.h" #include <dcp/cpl.h> #include <dcp/dcp.h> #include <dcp/reel.h> #include <dcp/reel_picture_asset.h> #include <dcp/reel_sound_asset.h> -#include <dcp/reel_subtitle_asset.h> +#include <dcp/reel_text_asset.h> #include <dcp/warnings.h> LIBDCP_DISABLE_WARNINGS #include <wx/cmdline.h> @@ -106,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)); @@ -218,7 +221,7 @@ public: add_label_to_sizer(sizer, this, _("Reels"), true, wxGBPosition(r, 0)); _reels = new EditableList<shared_ptr<dcp::Reel>, ReelEditor>( this, - { EditableListColumn("Name", 600, true) }, + { EditableListColumn(_("Name"), 600, true) }, [this]() { return _cpl->reels(); }, [this](vector<shared_ptr<dcp::Reel>> reels) { _cpl->set(reels); @@ -290,14 +293,14 @@ class DOMFrame : public wxFrame { public: DOMFrame () - : wxFrame(nullptr, -1, _("DCP-o-matic Editor")) + : wxFrame(nullptr, -1, variant::wx::dcpomatic_editor()) , _main_sizer(new wxBoxSizer(wxVERTICAL)) { dcpomatic_log = make_shared<NullLog>(); #if defined(DCPOMATIC_WINDOWS) maybe_open_console(); - std::cout << "DCP-o-matic Editor is starting." << "\n"; + std::cout << variant::dcpomatic_editor() << " is starting." << "\n"; #endif auto bar = new wxMenuBar; @@ -339,7 +342,7 @@ public: _notebook->DeleteAllPages(); for (auto cpl: _dcp->cpls()) { - _notebook->AddPage(new CPLPanel(_notebook, cpl), wx_to_std(cpl->annotation_text().get_value_or(cpl->id()))); + _notebook->AddPage(new CPLPanel(_notebook, cpl), std_to_wx(cpl->annotation_text().get_value_or(cpl->id()))); } } @@ -360,7 +363,7 @@ private: auto help = new wxMenu; #ifdef __WXOSX__ - help->Append (wxID_ABOUT, _("About DCP-o-matic")); + help->Append(wxID_ABOUT, variant::wx::insert_dcpomatic_editor(_("About %s"))); #else help->Append (wxID_ABOUT, _("About")); #endif @@ -444,7 +447,7 @@ private: splash = maybe_show_splash (); - SetAppName (_("DCP-o-matic Editor")); + SetAppName(variant::wx::dcpomatic_editor()); if (!wxApp::OnInit()) { return false; @@ -495,7 +498,7 @@ private: if (splash) { splash->Destroy (); } - error_dialog (0, _("DCP-o-matic Editor could not start."), std_to_wx(e.what())); + error_dialog(nullptr, variant::wx::insert_dcpomatic_editor(_("%s could not start.")), std_to_wx(e.what())); } return true; @@ -504,7 +507,7 @@ private: void OnInitCmdLine (wxCmdLineParser& parser) override { parser.SetDesc (command_line_description); - parser.SetSwitchChars (wxT ("-")); + parser.SetSwitchChars(char_to_wx("-")); } bool OnCmdLineParsed (wxCmdLineParser& parser) override @@ -524,21 +527,23 @@ private: error_dialog ( 0, wxString::Format ( - _("An exception occurred: %s (%s)\n\n") + REPORT_PROBLEM, - std_to_wx (e.what()), - std_to_wx (e.file().string().c_str ()) + _("An exception occurred: %s (%s)\n\n%s"), + std_to_wx(e.what()), + std_to_wx(e.file().string().c_str()), + wx::report_problem() ) ); } catch (exception& e) { error_dialog ( 0, wxString::Format ( - _("An exception occurred: %s.\n\n") + REPORT_PROBLEM, - std_to_wx (e.what ()) + _("An exception occurred: %s\n\n%s"), + std_to_wx(e.what()), + wx::report_problem() ) ); } catch (...) { - error_dialog (0, _("An unknown exception occurred.") + " " + REPORT_PROBLEM); + error_dialog(nullptr, wxString::Format(_("An unknown exception occurred. %s"), wx::report_problem())); } } |
