summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wx/film_editor.cc16
-rw-r--r--src/wx/film_editor.h1
2 files changed, 17 insertions, 0 deletions
diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc
index e2886b5f5..017a9d7c9 100644
--- a/src/wx/film_editor.cc
+++ b/src/wx/film_editor.cc
@@ -238,6 +238,7 @@ FilmEditor::connect_to_widgets ()
_content->Bind (wxEVT_COMMAND_LIST_ITEM_SELECTED, boost::bind (&FilmEditor::content_selection_changed, this));
_content->Bind (wxEVT_COMMAND_LIST_ITEM_DESELECTED, boost::bind (&FilmEditor::content_selection_changed, this));
_content->Bind (wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, boost::bind (&FilmEditor::content_right_click, this, _1));
+ _content->Bind (wxEVT_DROP_FILES, boost::bind (&FilmEditor::content_files_dropped, this, _1));
_content_add_file->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&FilmEditor::content_add_file_clicked, this));
_content_add_folder->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&FilmEditor::content_add_folder_clicked, this));
_content_remove->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&FilmEditor::content_remove_clicked, this));
@@ -308,6 +309,8 @@ FilmEditor::make_content_panel ()
_panels.push_back (_subtitle_panel);
_timing_panel = new TimingPanel (this);
_panels.push_back (_timing_panel);
+
+ _content->DragAcceptFiles (true);
}
/** Called when the name widget has been changed */
@@ -1060,3 +1063,16 @@ FilmEditor::setup_frame_rate_widget ()
_frame_rate_sizer->Layout ();
}
+
+void
+FilmEditor::content_files_dropped (wxDropFilesEvent& event)
+{
+ if (!_film) {
+ return;
+ }
+
+ wxString* paths = event.GetFiles ();
+ for (int i = 0; i < event.GetNumberOfFiles(); i++) {
+ _film->examine_and_add_content (content_factory (_film, wx_to_std (paths[i])));
+ }
+}
diff --git a/src/wx/film_editor.h b/src/wx/film_editor.h
index 6f39f2d68..1854df05e 100644
--- a/src/wx/film_editor.h
+++ b/src/wx/film_editor.h
@@ -83,6 +83,7 @@ private:
void content_remove_clicked ();
void content_earlier_clicked ();
void content_later_clicked ();
+ void content_files_dropped (wxDropFilesEvent& event);
void container_changed ();
void dcp_content_type_changed ();
void scaler_changed ();