Hand-apply 0ca0ab9f23ac0238643a6d148148385388f71c00 from master;
[dcpomatic.git] / src / wx / content_panel.cc
index 991080e590f059e123ca443333d4dd1e26b03886..2932ee7c58bca7cd6da585f47b7fb5bb435f6a63 100644 (file)
@@ -64,27 +64,36 @@ ContentPanel::ContentPanel (wxNotebook* n, boost::shared_ptr<Film> f)
                _content->SetColumnWidth (0, 512);
 
                wxBoxSizer* b = new wxBoxSizer (wxVERTICAL);
+               
                _add_file = new wxButton (_panel, wxID_ANY, _("Add file(s)..."));
-               b->Add (_add_file, 1, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
+               _add_file->SetToolTip (_("Add video, image or sound files to the film."));
+               b->Add (_add_file, 0, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
+               
                _add_folder = new wxButton (_panel, wxID_ANY, _("Add folder..."));
+               _add_folder->SetToolTip (_("Add a folder of image files (which will be used as a moving image sequence) or a DCP."));
                b->Add (_add_folder, 1, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
+               
                _remove = new wxButton (_panel, wxID_ANY, _("Remove"));
-               b->Add (_remove, 1, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
+               _remove->SetToolTip (_("Remove the selected piece of content from the film."));
+               b->Add (_remove, 0, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
+               
                _earlier = new wxButton (_panel, wxID_ANY, _("Up"));
-               b->Add (_earlier, 1, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
+               _earlier->SetToolTip (_("Move the selected piece of content earlier in the film."));
+               b->Add (_earlier, 0, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
+               
                _later = new wxButton (_panel, wxID_ANY, _("Down"));
-               b->Add (_later, 1, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
+               _later->SetToolTip (_("Move the selected piece of content later in the film."));
+               b->Add (_later, 0, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
+               
                _timeline = new wxButton (_panel, wxID_ANY, _("Timeline..."));
-               b->Add (_timeline, 1, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
+               _timeline->SetToolTip (_("Open the timeline for the film."));
+               b->Add (_timeline, 0, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
 
                s->Add (b, 0, wxALL, 4);
 
                _sizer->Add (s, 0, wxEXPAND | wxALL, 6);
        }
 
-       _sequence_video = new wxCheckBox (_panel, wxID_ANY, _("Keep video in sequence"));
-       _sizer->Add (_sequence_video);
-
        _notebook = new wxNotebook (_panel, wxID_ANY);
        _sizer->Add (_notebook, 1, wxEXPAND | wxTOP, 6);
 
@@ -107,7 +116,6 @@ ContentPanel::ContentPanel (wxNotebook* n, boost::shared_ptr<Film> f)
        _earlier->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ContentPanel::earlier_clicked, this));
        _later->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ContentPanel::later_clicked, this));
        _timeline->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ContentPanel::timeline_clicked, this));
-       _sequence_video->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&ContentPanel::sequence_video_changed, this));
 }
 
 ContentList
@@ -193,16 +201,6 @@ ContentPanel::selected_ffmpeg ()
        return sc;
 }
 
-void
-ContentPanel::sequence_video_changed ()
-{
-       if (!_film) {
-               return;
-       }
-       
-       _film->set_sequence_video (_sequence_video->GetValue ());
-}
-
 void
 ContentPanel::film_changed (Film::Property p)
 {
@@ -210,9 +208,6 @@ ContentPanel::film_changed (Film::Property p)
        case Film::CONTENT:
                setup ();
                break;
-       case Film::SEQUENCE_VIDEO:
-               checked_set (_sequence_video, _film->sequence_video ());
-               break;
        default:
                break;
        }
@@ -263,6 +258,7 @@ ContentPanel::add_folder_clicked ()
 {
        wxDirDialog* d = new wxDirDialog (_panel, _("Choose a folder"), wxT (""), wxDD_DIR_MUST_EXIST);
        int const r = d->ShowModal ();
+       boost::filesystem::path const path (wx_to_std (d->GetPath ()));
        d->Destroy ();
        
        if (r != wxID_OK) {
@@ -272,10 +268,10 @@ ContentPanel::add_folder_clicked ()
        shared_ptr<Content> content;
        
        try {
-               content.reset (new ImageContent (_film, boost::filesystem::path (wx_to_std (d->GetPath ()))));
+               content.reset (new ImageContent (_film, path));
        } catch (...) {
                try {
-                       content.reset (new DCPContent (_film, boost::filesystem::path (wx_to_std (d->GetPath ()))));
+                       content.reset (new DCPContent (_film, path));
                } catch (...) {
                        error_dialog (_panel, _("Could not find any images nor a DCP in that folder"));
                        return;
@@ -342,6 +338,9 @@ void
 ContentPanel::set_film (shared_ptr<Film> f)
 {
        _film = f;
+
+       film_changed (Film::CONTENT);
+       film_changed (Film::AUDIO_CHANNELS);
        selection_changed ();
 }
 
@@ -357,7 +356,6 @@ ContentPanel::set_general_sensitivity (bool s)
        _earlier->Enable (s);
        _later->Enable (s);
        _timeline->Enable (s);
-       _sequence_video->Enable (s);
 
        /* Set the panels in the content notebook */
        for (list<ContentSubPanel*>::iterator i = _panels.begin(); i != _panels.end(); ++i) {
@@ -423,7 +421,7 @@ ContentPanel::setup ()
 
        ContentList content = _film->content ();
        sort (content.begin(), content.end(), ContentSorter ());
-       
+
        for (ContentList::iterator i = content.begin(); i != content.end(); ++i) {
                int const t = _content->GetItemCount ();
                bool const valid = (*i)->paths_valid ();