Commit 4ae5becb authored by Clément Stenac's avatar Clément Stenac

Use play to end as default, and add "play this branch" to popup

parent bcec187b
...@@ -91,6 +91,7 @@ enum ...@@ -91,6 +91,7 @@ enum
Infos_Event, Infos_Event,
PopupPlay_Event, PopupPlay_Event,
PopupPlayThis_Event,
PopupDel_Event, PopupDel_Event,
PopupEna_Event, PopupEna_Event,
PopupInfo_Event, PopupInfo_Event,
...@@ -144,6 +145,7 @@ BEGIN_EVENT_TABLE(Playlist, wxFrame) ...@@ -144,6 +145,7 @@ BEGIN_EVENT_TABLE(Playlist, wxFrame)
/* Popup events */ /* Popup events */
EVT_MENU( PopupPlay_Event, Playlist::OnPopupPlay) EVT_MENU( PopupPlay_Event, Playlist::OnPopupPlay)
EVT_MENU( PopupPlayThis_Event, Playlist::OnPopupPlay)
EVT_MENU( PopupDel_Event, Playlist::OnPopupDel) EVT_MENU( PopupDel_Event, Playlist::OnPopupDel)
EVT_MENU( PopupEna_Event, Playlist::OnPopupEna) EVT_MENU( PopupEna_Event, Playlist::OnPopupEna)
EVT_MENU( PopupInfo_Event, Playlist::OnPopupInfo) EVT_MENU( PopupInfo_Event, Playlist::OnPopupInfo)
...@@ -260,6 +262,7 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ): ...@@ -260,6 +262,7 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
/* Create the popup menu */ /* Create the popup menu */
popup_menu = new wxMenu; popup_menu = new wxMenu;
popup_menu->Append( PopupPlay_Event, wxU(_("Play")) ); popup_menu->Append( PopupPlay_Event, wxU(_("Play")) );
popup_menu->Append( PopupPlayThis_Event, wxU(_("Play this branch")) );
popup_menu->Append( PopupDel_Event, wxU(_("Delete")) ); popup_menu->Append( PopupDel_Event, wxU(_("Delete")) );
popup_menu->Append( PopupEna_Event, wxU(_("Enable/Disable")) ); popup_menu->Append( PopupEna_Event, wxU(_("Enable/Disable")) );
popup_menu->Append( PopupInfo_Event, wxU(_("Info")) ); popup_menu->Append( PopupInfo_Event, wxU(_("Info")) );
...@@ -330,9 +333,8 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ): ...@@ -330,9 +333,8 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
icons[ ITEM_TYPE_NET ] = wxIcon( type_net_xpm ); icons[ ITEM_TYPE_NET ] = wxIcon( type_net_xpm );
icons[ ITEM_TYPE_CARD ] = wxIcon( type_card_xpm ); icons[ ITEM_TYPE_CARD ] = wxIcon( type_card_xpm );
for( int i = 0; i< WXSIZEOF( icons ) ; i++ ) for( unsigned int i = 0; i< WXSIZEOF( icons ) ; i++ )
{ {
// p_images->Add( wxBitmap( wxBitmap(icons[i]).ConvertToImage().Rescale(16,16) ) );
p_images->Add( wxIcon( icons[i] )); p_images->Add( wxIcon( icons[i] ));
} }
...@@ -1144,8 +1146,6 @@ void Playlist::OnRepeat( wxCommandEvent& event ) ...@@ -1144,8 +1146,6 @@ void Playlist::OnRepeat( wxCommandEvent& event )
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
void Playlist::OnActivateItem( wxTreeEvent& event ) void Playlist::OnActivateItem( wxTreeEvent& event )
{ {
playlist_item_t *p_item,*p_node; playlist_item_t *p_item,*p_node;
...@@ -1154,14 +1154,7 @@ void Playlist::OnActivateItem( wxTreeEvent& event ) ...@@ -1154,14 +1154,7 @@ void Playlist::OnActivateItem( wxTreeEvent& event )
PlaylistItem *p_wxitem = (PlaylistItem *)treectrl->GetItemData( PlaylistItem *p_wxitem = (PlaylistItem *)treectrl->GetItemData(
event.GetItem() ); event.GetItem() );
wxTreeItemId parent = treectrl->GetItemParent( event.GetItem() ); wxTreeItemId parent = treectrl->GetItemParent( event.GetItem() );
if( parent.IsOk() )
{
fprintf(stderr,"Ca gre\n" );
}
else
{
fprintf(stderr,"Ca craint\n" );
}
PlaylistItem *p_wxparent = (PlaylistItem *)treectrl->GetItemData( parent ); PlaylistItem *p_wxparent = (PlaylistItem *)treectrl->GetItemData( parent );
if( p_playlist == NULL ) if( p_playlist == NULL )
...@@ -1177,8 +1170,15 @@ void Playlist::OnActivateItem( wxTreeEvent& event ) ...@@ -1177,8 +1170,15 @@ void Playlist::OnActivateItem( wxTreeEvent& event )
else else
{ {
p_node = p_wxitem->p_item; p_node = p_wxitem->p_item;
if( p_wxitem->p_item->i_children > 0 )
{
p_item = p_wxitem->p_item->pp_children[0];
}
else
{
p_item = NULL; p_item = NULL;
} }
}
playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, i_current_view, playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, i_current_view,
p_node, p_item ); p_node, p_item );
...@@ -1375,10 +1375,31 @@ void Playlist::OnPopupPlay( wxMenuEvent& event ) ...@@ -1375,10 +1375,31 @@ void Playlist::OnPopupPlay( wxMenuEvent& event )
return; return;
} }
if( p_popup_item != NULL ) if( p_popup_item != NULL )
{
if( p_popup_item->i_children > -1 )
{
if( event.GetId() == PopupPlay_Event &&
p_popup_item->i_children > 0 )
{ {
playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, playlist_Control( p_playlist, PLAYLIST_VIEWPLAY,
VIEW_SIMPLE, p_popup_parent, p_popup_item ); i_current_view, p_popup_item,
/*FIXME*/ p_popup_item->pp_children[0] );
}
else
{
playlist_Control( p_playlist, PLAYLIST_VIEWPLAY,
i_current_view, p_popup_item, NULL );
}
}
else
{
if( event.GetId() == PopupPlay_Event )
{
playlist_Control( p_playlist, PLAYLIST_VIEWPLAY,
i_current_view, p_popup_parent,
p_popup_item );
}
}
} }
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
......
...@@ -477,7 +477,10 @@ int playlist_Delete( playlist_t * p_playlist, int i_id ) ...@@ -477,7 +477,10 @@ int playlist_Delete( playlist_t * p_playlist, int i_id )
playlist_item_t *p_item = playlist_ItemGetById( p_playlist, i_id ); playlist_item_t *p_item = playlist_ItemGetById( p_playlist, i_id );
if( p_item == NULL ) return VLC_EGENERIC; if( p_item == NULL )
{
return VLC_EGENERIC;
}
/* Check if it is the current item */ /* Check if it is the current item */
if( p_playlist->status.p_item == p_item ) if( p_playlist->status.p_item == p_item )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment