Merge master.
authorCarl Hetherington <cth@carlh.net>
Sun, 7 Sep 2014 22:36:40 +0000 (23:36 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 7 Sep 2014 22:36:40 +0000 (23:36 +0100)
13 files changed:
ChangeLog
src/lib/config.cc
src/lib/config.h
src/lib/video_content.cc
src/lib/video_content.h
src/tools/dcpomatic.cc
src/wx/config_dialog.cc
src/wx/po/de_DE.po
src/wx/po/es_ES.po
src/wx/po/fr_FR.po
src/wx/po/it_IT.po
src/wx/po/nl_NL.po
src/wx/po/sv_SE.po

index ca321f9720eb0e0055b13ff470d1be2832051a10..d8210ef9d992dc21feecc26cc60c2e63a347e9d6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-09-07  Carl Hetherington  <cth@carlh.net>
+
+       * 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  <cth@carlh.net>
 
        * Version 1.73.2 released.
index 1f5a25ae4dcb52f785930d8948bb5998f25dbb23..114fc5c274c7753cdc0f2e0f721603ecaf47cd12 100644 (file)
@@ -67,7 +67,7 @@ Config::Config ()
        , _cinema_sound_processor (CinemaSoundProcessor::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)
@@ -147,7 +147,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");
@@ -329,9 +329,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 ());
        }
index 9a18086829af77194d973941399b93ee80c1a52a..99b3eb62122e00529502db5100f5e069a35c4c3e 100644 (file)
@@ -33,6 +33,7 @@
 #include <dcp/signer.h>
 #include "isdcf_metadata.h"
 #include "colour_conversion.h"
+#include "video_content.h"
 
 class ServerDescription;
 class Scaler;
@@ -134,7 +135,7 @@ public:
                return _default_still_length;
        }
 
-       Ratio const * default_scale () const {
+       VideoContentScale default_scale () const {
                return _default_scale;
        }
 
@@ -307,7 +308,7 @@ public:
                changed ();
        }
 
-       void set_default_scale (Ratio const * s) {
+       void set_default_scale (VideoContentScale s) {
                _default_scale = s;
                changed ();
        }
@@ -468,7 +469,7 @@ private:
        ISDCFMetadata _default_isdcf_metadata;
        boost::optional<std::string> _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;
index 796e6575a2e62f2088affaafea41a7240adb866b..9822d77634c659a583de5314a4904032da104ec4 100644 (file)
@@ -482,7 +482,7 @@ VideoContentScale::id () const
        SafeStringStream s;
        
        if (_ratio) {
-               s << _ratio->id () << "_";
+               s << _ratio->id ();
        } else {
                s << (_scale ? "S1" : "S0");
        }
@@ -504,6 +504,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.
  */
index 27b36e9bc65ed73358ae36ef2da2adb32c607f77..d32769b5a9dde2ec41128207983e04b9721b8c0e 100644 (file)
@@ -62,6 +62,7 @@ public:
        static std::vector<VideoContentScale> all () {
                return _scales;
        }
+       static VideoContentScale from_id (std::string id);
 
 private:
        /** a ratio to stretch the content to, or 0 for no stretch */
index 3bef7bce300f663be2ca9340f7e8d4f9313d6dab..5f6a980751c0806f8596bb0e8715884f0b2b3b3c 100644 (file)
@@ -164,7 +164,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);
@@ -516,8 +516,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 ();
        }
 
@@ -685,6 +690,7 @@ private:
        int _history_items;
        int _history_position;
        wxMenuItem* _history_separator;
+       boost::signals2::scoped_connection _config_changed_connection;
 };
 
 static const wxCmdLineEntryDesc command_line_description[] = {
index 009467afa0fbfdbc7aceaf1eb0de191323a59be9..c1ea926eafe669327f02e5bde3c153a81be723d3 100644 (file)
@@ -317,31 +317,31 @@ public:
                
                _isdcf_metadata_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DefaultsPage::edit_isdcf_metadata_clicked, this, parent));
                
-               vector<Ratio const *> ratio = Ratio::all ();
-               int n = 0;
-               for (vector<Ratio const *>::iterator i = ratio.begin(); i != ratio.end(); ++i) {
-                       _scale->Append (std_to_wx ((*i)->nickname ()));
-                       if (*i == config->default_scale ()) {
-                               _scale->SetSelection (n);
+               vector<VideoContentScale> 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<Ratio const *> 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<DCPContentType const *> const ct = DCPContentType::all ();
-               n = 0;
-               for (vector<DCPContentType const *>::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));
@@ -391,8 +391,8 @@ private:
 
        void scale_changed ()
        {
-               vector<Ratio const *> ratio = Ratio::all ();
-               Config::instance()->set_default_scale (ratio[_scale->GetSelection()]);
+               vector<VideoContentScale> scale = VideoContentScale::all ();
+               Config::instance()->set_default_scale (scale[_scale->GetSelection()]);
        }
        
        void container_changed ()
index 4d57a34bc441410cbb6cd5c2f519adcbcbd179d8..ac7ea532a529a86b7668890c5492ae085d9c2b0a 100644 (file)
@@ -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"
index bfa2d0b2f0871d62e68991fb76f870d04b60a3ac..37a884a52aeab310463bcf7f7f194250811903d1 100644 (file)
@@ -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"
index 5e1e2df5d0f721bbb15dfca8cddf7d7a42e29a96..228236c984587771d19ff0ace8aacd06d34abd8e 100644 (file)
@@ -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"
index d2d191dffa1bc90aef931efa7e00bbba89e02bd0..4bebb30b1bd8db3f0663da3caa33796b2181cee3 100644 (file)
@@ -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"
index 3ed860548f9af58c8ca4641fe3c736b932892a91..e2383f996a043ee3ace8b28b5f80c7ebfb4c7145 100644 (file)
@@ -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"
index e3606f1a599420ef95b0b57e1fddc2ea66a51242..00755705c28c0142c2dd043407053ac5ba95af8b 100644 (file)
@@ -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"