+void DialogsProvider::OnOpenDirectory( wxCommandEvent& event )
+{
+ playlist_t *p_playlist =
+ (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+ FIND_ANYWHERE );
+ if( p_playlist == NULL )
+ {
+ return;
+ }
+
+ if( p_dir_dialog == NULL )
+ p_dir_dialog = new wxDirDialog( NULL );
+
+ if( p_dir_dialog && p_dir_dialog->ShowModal() == wxID_OK )
+ {
+ playlist_item_t *p_item;
+ wxString path = p_dir_dialog->GetPath();
+
+ int i_id = playlist_Add( p_playlist, (const char *)path.mb_str(),
+ (const char *)path.mb_str(),
+ PLAYLIST_APPEND, PLAYLIST_END );
+ p_item = playlist_ItemGetById( p_playlist, i_id );
+ if( p_item )
+ {
+ input_CreateThread( p_intf, &p_item->input );
+ }
+ }
+
+ vlc_object_release( p_playlist );
+}
+