Fix breakage to adding multiple files at the same time.
[dcpomatic.git] / src / wx / film_editor.cc
index ef35349390573e356ed463ed64581d64f4be22a8..11926b8a10d7ec9038df4ef2c39ba3068c02b2b7 100644 (file)
@@ -36,8 +36,7 @@
 #include "lib/filter.h"
 #include "lib/ratio.h"
 #include "lib/config.h"
-#include "lib/still_image_content.h"
-#include "lib/moving_image_content.h"
+#include "lib/image_content.h"
 #include "lib/ffmpeg_content.h"
 #include "lib/sndfile_content.h"
 #include "lib/dcp_content_type.h"
@@ -151,7 +150,7 @@ FilmEditor::make_dcp_panel ()
        }
        ++r;
 
-       _encrypted = new wxCheckBox (_dcp_panel, wxID_ANY, wxT ("Encrypted"));
+       _encrypted = new wxCheckBox (_dcp_panel, wxID_ANY, _("Encrypted"));
        grid->Add (_encrypted, wxGBPosition (r, 0), wxGBSpan (1, 2));
        ++r;
 
@@ -748,7 +747,7 @@ FilmEditor::content_add_file_clicked ()
        /* XXX: check for lots of files here and do something */
 
        for (unsigned int i = 0; i < paths.GetCount(); ++i) {
-               _film->examine_and_add_content (content_factory (_film, wx_to_std (d->GetPath ())));
+               _film->examine_and_add_content (content_factory (_film, wx_to_std (paths[i])));
        }
 
        d->Destroy ();
@@ -766,8 +765,8 @@ FilmEditor::content_add_folder_clicked ()
        }
 
        _film->examine_and_add_content (
-               shared_ptr<MovingImageContent> (
-                       new MovingImageContent (_film, boost::filesystem::path (wx_to_std (d->GetPath ())))
+               shared_ptr<ImageContent> (
+                       new ImageContent (_film, boost::filesystem::path (wx_to_std (d->GetPath ())))
                        )
                );
 }
@@ -826,7 +825,9 @@ FilmEditor::selected_content ()
                        break;
                }
 
-               sel.push_back (_film->content()[s]);
+               if (s < int (_film->content().size ())) {
+                       sel.push_back (_film->content()[s]);
+               }
        }
 
        return sel;