From 5a0b2926fbc57ecdecc6c9a865c9683224be4ee6 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 7 Sep 2014 21:14:25 +0100 Subject: Fix some mangled fuzzy translations. --- src/wx/po/de_DE.po | 3 +-- src/wx/po/es_ES.po | 3 +-- src/wx/po/fr_FR.po | 3 +-- src/wx/po/it_IT.po | 3 +-- src/wx/po/nl_NL.po | 3 +-- src/wx/po/sv_SE.po | 3 +-- 6 files changed, 6 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/wx/po/de_DE.po b/src/wx/po/de_DE.po index 4d57a34bc..ac7ea532a 100644 --- a/src/wx/po/de_DE.po +++ b/src/wx/po/de_DE.po @@ -408,9 +408,8 @@ msgid "Default issuer" msgstr "Standard 'issuer' (DCI)" #: src/wx/config_dialog.cc:270 -#, fuzzy msgid "Default scale to" -msgstr "Standard 'creator' (DCI)" +msgstr "" #: src/wx/config_dialog.cc:229 msgid "Defaults" diff --git a/src/wx/po/es_ES.po b/src/wx/po/es_ES.po index bfa2d0b2f..37a884a52 100644 --- a/src/wx/po/es_ES.po +++ b/src/wx/po/es_ES.po @@ -412,9 +412,8 @@ msgid "Default issuer" msgstr "Emisor por defecto" #: src/wx/config_dialog.cc:270 -#, fuzzy msgid "Default scale to" -msgstr "Creador por defecto" +msgstr "" #: src/wx/config_dialog.cc:229 msgid "Defaults" diff --git a/src/wx/po/fr_FR.po b/src/wx/po/fr_FR.po index 5e1e2df5d..228236c98 100644 --- a/src/wx/po/fr_FR.po +++ b/src/wx/po/fr_FR.po @@ -409,9 +409,8 @@ msgid "Default issuer" msgstr "Labo par défaut" #: src/wx/config_dialog.cc:270 -#, fuzzy msgid "Default scale to" -msgstr "Créateur par défaut" +msgstr "" #: src/wx/config_dialog.cc:229 msgid "Defaults" diff --git a/src/wx/po/it_IT.po b/src/wx/po/it_IT.po index d2d191dff..4bebb30b1 100644 --- a/src/wx/po/it_IT.po +++ b/src/wx/po/it_IT.po @@ -418,9 +418,8 @@ msgid "Default issuer" msgstr "Predefiniti" #: src/wx/config_dialog.cc:270 -#, fuzzy msgid "Default scale to" -msgstr "Contenitore predefinito" +msgstr "" #: src/wx/config_dialog.cc:229 msgid "Defaults" diff --git a/src/wx/po/nl_NL.po b/src/wx/po/nl_NL.po index 3ed860548..e2383f996 100644 --- a/src/wx/po/nl_NL.po +++ b/src/wx/po/nl_NL.po @@ -418,9 +418,8 @@ msgid "Default issuer" msgstr "Standaard uitgever" #: src/wx/config_dialog.cc:270 -#, fuzzy msgid "Default scale to" -msgstr "Standaard maker" +msgstr "" #: src/wx/config_dialog.cc:229 msgid "Defaults" diff --git a/src/wx/po/sv_SE.po b/src/wx/po/sv_SE.po index e3606f1a5..00755705c 100644 --- a/src/wx/po/sv_SE.po +++ b/src/wx/po/sv_SE.po @@ -424,9 +424,8 @@ msgid "Default issuer" msgstr "Standardval" #: src/wx/config_dialog.cc:270 -#, fuzzy msgid "Default scale to" -msgstr "Förvald innehållstyp" +msgstr "" #: src/wx/config_dialog.cc:229 msgid "Defaults" -- cgit v1.2.3 From 4956be4e16570fa6b6985b11d4d689308343ffbb Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 7 Sep 2014 21:49:36 +0100 Subject: Use VideoContentScale rather than Ratio for the default scale to. --- ChangeLog | 7 +++++++ src/lib/config.cc | 8 +++----- src/lib/config.h | 7 ++++--- src/lib/video_content.cc | 17 ++++++++++++++++- src/lib/video_content.h | 1 + src/wx/config_dialog.cc | 36 ++++++++++++++++++------------------ 6 files changed, 49 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/ChangeLog b/ChangeLog index 0fcb2da4d..99cc20dc1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2014-09-07 Carl Hetherington + + * Put no stretch / no scale in the set of choices for default + scale to. + + * Fix a few bad fuzzy translations from the preferences dialog. + 2014-09-03 Carl Hetherington * Version 1.73.2 released. diff --git a/src/lib/config.cc b/src/lib/config.cc index 67abc63c2..878fedaa4 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -64,7 +64,7 @@ Config::Config () , _sound_processor (SoundProcessor::from_id (N_("dolby_cp750"))) , _allow_any_dcp_frame_rate (false) , _default_still_length (10) - , _default_scale (Ratio::from_id ("185")) + , _default_scale (VideoContentScale (Ratio::from_id ("185"))) , _default_container (Ratio::from_id ("185")) , _default_dcp_content_type (DCPContentType::from_isdcf_name ("TST")) , _default_j2k_bandwidth (100000000) @@ -137,7 +137,7 @@ Config::read () c = f.optional_string_child ("DefaultScale"); if (c) { - _default_scale = Ratio::from_id (c.get ()); + _default_scale = VideoContentScale::from_id (c.get ()); } c = f.optional_string_child ("DefaultContainer"); @@ -353,9 +353,7 @@ Config::write () const if (_language) { root->add_child("Language")->add_child_text (_language.get()); } - if (_default_scale) { - root->add_child("DefaultScale")->add_child_text (_default_scale->id ()); - } + root->add_child("DefaultScale")->add_child_text (_default_scale.id ()); if (_default_container) { root->add_child("DefaultContainer")->add_child_text (_default_container->id ()); } diff --git a/src/lib/config.h b/src/lib/config.h index 4f6b57f56..0639382a0 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -31,6 +31,7 @@ #include "isdcf_metadata.h" #include "colour_conversion.h" #include "server.h" +#include "video_content.h" class ServerDescription; class Scaler; @@ -132,7 +133,7 @@ public: return _default_still_length; } - Ratio const * default_scale () const { + VideoContentScale default_scale () const { return _default_scale; } @@ -293,7 +294,7 @@ public: changed (); } - void set_default_scale (Ratio const * s) { + void set_default_scale (VideoContentScale s) { _default_scale = s; changed (); } @@ -441,7 +442,7 @@ private: ISDCFMetadata _default_isdcf_metadata; boost::optional _language; int _default_still_length; - Ratio const * _default_scale; + VideoContentScale _default_scale; Ratio const * _default_container; DCPContentType const * _default_dcp_content_type; std::string _dcp_issuer; diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc index b0d4c2de5..5a80dba74 100644 --- a/src/lib/video_content.cc +++ b/src/lib/video_content.cc @@ -476,7 +476,7 @@ VideoContentScale::id () const SafeStringStream s; if (_ratio) { - s << _ratio->id () << "_"; + s << _ratio->id (); } else { s << (_scale ? "S1" : "S0"); } @@ -498,6 +498,21 @@ VideoContentScale::name () const return _("No scale"); } +VideoContentScale +VideoContentScale::from_id (string id) +{ + Ratio const * r = Ratio::from_id (id); + if (r) { + return VideoContentScale (r); + } + + if (id == "S0") { + return VideoContentScale (false); + } + + return VideoContentScale (true); +} + /** @param display_container Size of the container that we are displaying this content in. * @param film_container The size of the film's image. */ diff --git a/src/lib/video_content.h b/src/lib/video_content.h index 62459222d..940467680 100644 --- a/src/lib/video_content.h +++ b/src/lib/video_content.h @@ -62,6 +62,7 @@ public: static std::vector all () { return _scales; } + static VideoContentScale from_id (std::string id); private: /** a ratio to stretch the content to, or 0 for no stretch */ diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index 463b77e97..b18598d70 100644 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@ -312,31 +312,31 @@ public: _isdcf_metadata_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DefaultsPage::edit_isdcf_metadata_clicked, this, parent)); - vector ratio = Ratio::all (); - int n = 0; - for (vector::iterator i = ratio.begin(); i != ratio.end(); ++i) { - _scale->Append (std_to_wx ((*i)->nickname ())); - if (*i == config->default_scale ()) { - _scale->SetSelection (n); + vector scales = VideoContentScale::all (); + for (size_t i = 0; i < scales.size(); ++i) { + _scale->Append (std_to_wx (scales[i].name ())); + if (scales[i] == config->default_scale ()) { + _scale->SetSelection (i); } - _container->Append (std_to_wx ((*i)->nickname ())); - if (*i == config->default_container ()) { - _container->SetSelection (n); + } + + vector ratios = Ratio::all (); + for (size_t i = 0; i < ratios.size(); ++i) { + _container->Append (std_to_wx (ratios[i]->nickname ())); + if (ratios[i] == config->default_container ()) { + _container->SetSelection (i); } - ++n; } _scale->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DefaultsPage::scale_changed, this)); _container->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DefaultsPage::container_changed, this)); vector const ct = DCPContentType::all (); - n = 0; - for (vector::const_iterator i = ct.begin(); i != ct.end(); ++i) { - _dcp_content_type->Append (std_to_wx ((*i)->pretty_name ())); - if (*i == config->default_dcp_content_type ()) { - _dcp_content_type->SetSelection (n); + for (size_t i = 0; i < ct.size(); ++i) { + _dcp_content_type->Append (std_to_wx (ct[i]->pretty_name ())); + if (ct[i] == config->default_dcp_content_type ()) { + _dcp_content_type->SetSelection (i); } - ++n; } _dcp_content_type->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DefaultsPage::dcp_content_type_changed, this)); @@ -386,8 +386,8 @@ private: void scale_changed () { - vector ratio = Ratio::all (); - Config::instance()->set_default_scale (ratio[_scale->GetSelection()]); + vector scale = VideoContentScale::all (); + Config::instance()->set_default_scale (scale[_scale->GetSelection()]); } void container_changed () -- cgit v1.2.3 From 38fd8d2d230a239079ffdf3e10a48833ade6e8c5 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 7 Sep 2014 23:20:19 +0100 Subject: Try to fix crash on exit with the preferences dialog open (only appears on OS X). --- src/tools/dcpomatic.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 6b7ad0273..c3dd8cd58 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -163,7 +163,7 @@ public: setup_menu (bar); SetMenuBar (bar); - Config::instance()->Changed.connect (boost::bind (&Frame::config_changed, this)); + _config_changed_connection = Config::instance()->Changed.connect (boost::bind (&Frame::config_changed, this)); config_changed (); Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&Frame::file_new, this), ID_file_new); @@ -515,8 +515,13 @@ private: return; } + /* We don't want to hear about any more configuration changes, since they + cause the File menu to be altered, which itself will be deleted around + now (without, as far as I can see, any way for us to find out). + */ + _config_changed_connection.disconnect (); + maybe_save_then_delete_film (); - ev.Skip (); } @@ -684,6 +689,7 @@ private: int _history_items; int _history_position; wxMenuItem* _history_separator; + boost::signals2::scoped_connection _config_changed_connection; }; static const wxCmdLineEntryDesc command_line_description[] = { -- cgit v1.2.3