Updated nl_NL translation from Rob van Nieuwkerk.
[dcpomatic.git] / src / wx / dcp_panel.cc
index ded073152e40e1a14fe9e4e66729f82a16d4e33c..5d0756b3edb0fcbdad643ce1e57d323cfe9e8f2b 100644 (file)
@@ -27,6 +27,7 @@
 #include "check_box.h"
 #include "static_text.h"
 #include "check_box.h"
+#include "dcpomatic_button.h"
 #include "lib/ratio.h"
 #include "lib/config.h"
 #include "lib/dcp_content_type.h"
@@ -57,6 +58,9 @@ using std::max;
 using std::make_pair;
 using boost::lexical_cast;
 using boost::shared_ptr;
+#if BOOST_VERSION >= 106100
+using namespace boost::placeholders;
+#endif
 using dcp::locale_convert;
 
 DCPPanel::DCPPanel (wxNotebook* n, boost::shared_ptr<Film> film)
@@ -76,8 +80,8 @@ DCPPanel::DCPPanel (wxNotebook* n, boost::shared_ptr<Film> film)
        FocusManager::instance()->add(_name);
 
        _use_isdcf_name = new CheckBox (_panel, _("Use ISDCF name"));
-       _edit_isdcf_button = new wxButton (_panel, wxID_ANY, _("Details..."));
-       _copy_isdcf_name_button = new wxButton (_panel, wxID_ANY, _("Copy as name"));
+       _edit_isdcf_button = new Button (_panel, _("Details..."));
+       _copy_isdcf_name_button = new Button (_panel, _("Copy as name"));
 
        /* wxST_ELLIPSIZE_MIDDLE works around a bug in GTK2 and/or wxWidgets, see
           http://trac.wxwidgets.org/ticket/12539
@@ -99,7 +103,7 @@ DCPPanel::DCPPanel (wxNotebook* n, boost::shared_ptr<Film> film)
 
        _key_label = create_label (_panel, _("Key"), true);
        _key = new StaticText (_panel, "", wxDefaultPosition, size);
-       _edit_key = new wxButton (_panel, wxID_ANY, _("Edit..."));
+       _edit_key = new Button (_panel, _("Edit..."));
 
        _reels_label = create_label (_panel, _("Reels"), true);
        _reel_type = new wxChoice (_panel, wxID_ANY);
@@ -306,9 +310,10 @@ DCPPanel::frame_rate_choice_changed ()
        }
 
        _film->set_video_frame_rate (
-               boost::lexical_cast<int> (
-                       wx_to_std (_frame_rate_choice->GetString (_frame_rate_choice->GetSelection ()))
-                       )
+               boost::lexical_cast<int>(
+                       wx_to_std(_frame_rate_choice->GetString(_frame_rate_choice->GetSelection()))
+                       ),
+               true
                );
 }
 
@@ -564,6 +569,13 @@ DCPPanel::set_film (shared_ptr<Film> film)
 
        _film = film;
 
+       if (!_film) {
+               /* Really should all the film_changed below but this might be enough */
+               checked_set (_dcp_name, wxT(""));
+               set_general_sensitivity (false);
+               return;
+       }
+
        film_changed (Film::NAME);
        film_changed (Film::USE_ISDCF_NAME);
        film_changed (Film::CONTENT);
@@ -627,6 +639,8 @@ DCPPanel::setup_sensitivity ()
        _resolution->Enable             (_generally_sensitive && _film && !_film->references_dcp_video());
        _three_d->Enable                (_generally_sensitive && _film && !_film->references_dcp_video());
        _standard->Enable               (_generally_sensitive && _film && !_film->references_dcp_video() && !_film->references_dcp_audio());
+       _reencode_j2k->Enable           (_generally_sensitive && _film);
+       _show_audio->Enable             (_generally_sensitive && _film);
 }
 
 void
@@ -721,8 +735,6 @@ DCPPanel::setup_frame_rate_widget ()
                _frame_rate_choice->Show ();
                _frame_rate_spin->Hide ();
        }
-
-       _frame_rate_sizer->Layout ();
 }
 
 wxPanel *
@@ -743,13 +755,9 @@ DCPPanel::make_video_panel ()
 
        _frame_rate_label = create_label (panel, _("Frame Rate"), true);
        _frame_rate_choice = new wxChoice (panel, wxID_ANY);
-       _frame_rate_sizer = new wxBoxSizer (wxHORIZONTAL);
-       _frame_rate_sizer->Add (_frame_rate_choice, 1, wxALIGN_CENTER_VERTICAL);
        _frame_rate_spin = new wxSpinCtrl (panel, wxID_ANY);
-       _frame_rate_sizer->Add (_frame_rate_spin, 1, wxALIGN_CENTER_VERTICAL);
        setup_frame_rate_widget ();
-       _best_frame_rate = new wxButton (panel, wxID_ANY, _("Use best"));
-       _frame_rate_sizer->Add (_best_frame_rate, 1, wxALIGN_CENTER_VERTICAL);
+       _best_frame_rate = new Button (panel, _("Use best"));
 
        _three_d = new CheckBox (panel, _("3D"));
 
@@ -872,7 +880,7 @@ DCPPanel::make_audio_panel ()
                _audio_processor->Append (std_to_wx (ap->name ()), new wxStringClientData (std_to_wx (ap->id ())));
        }
 
-       _show_audio = new wxButton (panel, wxID_ANY, _("Show audio..."));
+       _show_audio = new Button (panel, _("Show audio..."));
 
        _audio_channels->Bind (wxEVT_CHOICE, boost::bind (&DCPPanel::audio_channels_changed, this));
        _audio_processor->Bind (wxEVT_CHOICE, boost::bind (&DCPPanel::audio_processor_changed, this));