GUI tweaks.
authorCarl Hetherington <cth@carlh.net>
Mon, 5 Nov 2012 15:23:17 +0000 (15:23 +0000)
committerCarl Hetherington <cth@carlh.net>
Mon, 5 Nov 2012 15:23:17 +0000 (15:23 +0000)
src/wx/dci_name_dialog.cc
src/wx/film_editor.cc
src/wx/film_editor.h

index bb6c2580797f8ff20b4bfcf22de5047e6071ea72..6927d6c9eba713dc52e2c135878c2ce81542f937 100644 (file)
@@ -43,7 +43,7 @@ DCINameDialog::DCINameDialog (wxWindow* parent, shared_ptr<Film> film)
        _territory = new wxTextCtrl (this, wxID_ANY);
        table->Add (_territory, 1, wxEXPAND);
 
-       add_label_to_sizer (table, this, "Rating (e.g. 15");
+       add_label_to_sizer (table, this, "Rating (e.g. 15)");
        _rating = new wxTextCtrl (this, wxID_ANY);
        table->Add (_rating, 1, wxEXPAND);
 
index e2a31d8d4244d625414c2617e0022a186dc5a240..70305978061b820cc6eaf9862dea521e076d3691 100644 (file)
@@ -57,6 +57,7 @@ using boost::shared_ptr;
 FilmEditor::FilmEditor (shared_ptr<Film> f, wxWindow* parent)
        : wxPanel (parent)
        , _film (f)
+       , _generally_sensitive (true)
 {
        _sizer = new wxFlexGridSizer (2, 4, 4);
        SetSizer (_sizer);
@@ -506,6 +507,7 @@ FilmEditor::film_changed (Film::Property p)
                break;
        case Film::WITH_SUBTITLES:
                checked_set (_with_subtitles, _film->with_subtitles ());
+               _subtitle_stream->Enable (_film->with_subtitles ());
                _subtitle_scale->Enable (_film->with_subtitles ());
                _subtitle_offset->Enable (_film->with_subtitles ());
                _dcp_name->SetLabel (std_to_wx (_film->dcp_name ()));
@@ -612,6 +614,8 @@ FilmEditor::set_film (shared_ptr<Film> f)
 void
 FilmEditor::set_things_sensitive (bool s)
 {
+       _generally_sensitive = s;
+       
        _name->Enable (s);
        _use_dci_name->Enable (s);
        _edit_dci_button->Enable (s);
@@ -812,7 +816,11 @@ FilmEditor::with_subtitles_toggled (wxCommandEvent &)
 void
 FilmEditor::setup_subtitle_control_sensitivity ()
 {
-       bool const h = _film ? _film->has_subtitles() : false;
+       bool h = false;
+       if (_generally_sensitive && _film) {
+               h = _film->has_subtitles();
+       }
+       
        _with_subtitles->Enable (h);
        _subtitle_stream->Enable (h);
        _subtitle_offset->Enable (h);
index 778988a0f59ac65618aeeb7297e7b5b040015b93..c5fe4b6cc98941c58e322e51129c8a6f2dfe6a6e 100644 (file)
@@ -147,4 +147,6 @@ private:
        std::vector<Format const *> _formats;
 
        wxSizer* _sizer;
+
+       bool _generally_sensitive;
 };