Commit 34534e99 authored by Clément Stenac's avatar Clément Stenac

Fix item selection in WX wizard (Closes:#402)

parent 826fad10
...@@ -591,6 +591,8 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t ...@@ -591,6 +591,8 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t
listview->InsertItem( i, filename ); listview->InsertItem( i, filename );
listview->SetItem( i, 1, wxL2U( p_playlist->pp_items[i]-> listview->SetItem( i, 1, wxL2U( p_playlist->pp_items[i]->
input.psz_uri) ); input.psz_uri) );
listview->SetItemData( i,
(long)p_playlist->pp_items[i]->input.i_id );
} }
listview->Select( p_playlist->i_index , TRUE); listview->Select( p_playlist->i_index , TRUE);
mainSizer->Add( listview, 1, wxALL|wxEXPAND, 5 ); mainSizer->Add( listview, 1, wxALL|wxEXPAND, 5 );
...@@ -715,14 +717,25 @@ void wizInputPage::OnWizardPageChanging(wxWizardEvent& event) ...@@ -715,14 +717,25 @@ void wizInputPage::OnWizardPageChanging(wxWizardEvent& event)
else else
{ {
int i = -1; int i = -1;
wxListItem listitem;
i = listview->GetNextItem( i , wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); i = listview->GetNextItem( i , wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
if( i != -1 ) if( i != -1 )
{ {
listitem.SetId( i ); long data = listview->GetItemData( i );
listitem.SetColumn( 1 ); playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf,
listview->GetItem( listitem ); VLC_OBJECT_PLAYLIST, FIND_ANYWHERE);
p_parent->SetMrl( (const char*) listitem.GetText().mb_str() ); if( p_playlist )
{
playlist_item_t * p_item = playlist_LockItemGetById(
p_playlist, (int)data );
if( p_item )
{
p_parent->SetMrl( (const char*)p_item->input.psz_uri );
}
else
event.Veto();
}
else
event.Veto();
} }
} }
if( enable_checkbox->IsChecked() ) if( enable_checkbox->IsChecked() )
......
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