Commit 41fd1676 authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/wxwindows/*: adapted to the new playlist api.
   "Add MRL" in the playlist dialog now only appends the new item to the playlist.
parent 8856aee1
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* dialogs.cpp : wxWindows plugin for vlc * dialogs.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2004 VideoLAN * Copyright (C) 2000-2004 VideoLAN
* $Id: dialogs.cpp,v 1.14 2004/01/25 03:29:01 hartman Exp $ * $Id: dialogs.cpp,v 1.15 2004/01/26 22:10:19 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -320,7 +320,7 @@ void DialogsProvider::Open( int i_access_method, int i_arg ) ...@@ -320,7 +320,7 @@ void DialogsProvider::Open( int i_access_method, int i_arg )
{ {
/* Show/hide the open dialog */ /* Show/hide the open dialog */
if( !p_open_dialog ) if( !p_open_dialog )
p_open_dialog = new OpenDialog(p_intf, this, i_access_method, i_arg , p_open_dialog = new OpenDialog( p_intf, this, i_access_method, i_arg,
OPEN_NORMAL ); OPEN_NORMAL );
if( p_open_dialog ) if( p_open_dialog )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* open.cpp : wxWindows plugin for vlc * open.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2004 VideoLAN * Copyright (C) 2000-2004 VideoLAN
* $Id: open.cpp,v 1.65 2004/01/25 08:01:13 rocky Exp $ * $Id: open.cpp,v 1.66 2004/01/26 22:10:20 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -223,6 +223,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent, ...@@ -223,6 +223,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
SetIcon( *p_intf->p_sys->p_icon ); SetIcon( *p_intf->p_sys->p_icon );
file_dialog = NULL; file_dialog = NULL;
i_disc_type_selection = 0; i_disc_type_selection = 0;
i_open_arg = i_arg;
#ifndef WIN32 #ifndef WIN32
v4l_dialog = NULL; v4l_dialog = NULL;
...@@ -383,6 +384,7 @@ int OpenDialog::Show( int i_access_method, int i_arg ) ...@@ -383,6 +384,7 @@ int OpenDialog::Show( int i_access_method, int i_arg )
i_ret = wxFrame::Show(); i_ret = wxFrame::Show();
Raise(); Raise();
SetFocus(); SetFocus();
i_open_arg = i_arg;
return i_ret; return i_ret;
} }
...@@ -891,8 +893,8 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) ) ...@@ -891,8 +893,8 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
int i_id = playlist_Add( p_playlist, (const char *)mrl[i].mb_str(), int i_id = playlist_Add( p_playlist, (const char *)mrl[i].mb_str(),
(const char *)mrl[i].mb_str(), (const char *)mrl[i].mb_str(),
PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO), PLAYLIST_END ); PLAYLIST_APPEND, PLAYLIST_END );
int i_pos = playlist_GetPositionById( p_playlist, i_id ); playlist_item_t *p_item = playlist_GetItemById( p_playlist , i_id );
/* Count the input options */ /* Count the input options */
while( i + i_options + 1 < (int)mrl.GetCount() && while( i + i_options + 1 < (int)mrl.GetCount() &&
...@@ -904,7 +906,7 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) ) ...@@ -904,7 +906,7 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
/* Insert options */ /* Insert options */
for( int j = 0; j < i_options; j++ ) for( int j = 0; j < i_options; j++ )
{ {
playlist_AddOption( p_playlist, i_pos, mrl[i + j + 1].mb_str() ); playlist_AddItemOption( p_item, mrl[i + j + 1].mb_str() );
} }
/* Get the options from the subtitles dialog */ /* Get the options from the subtitles dialog */
...@@ -912,8 +914,7 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) ) ...@@ -912,8 +914,7 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
{ {
for( int j = 0; j < (int)subsfile_mrl.GetCount(); j++ ) for( int j = 0; j < (int)subsfile_mrl.GetCount(); j++ )
{ {
playlist_AddOption( p_playlist, i_pos , playlist_AddItemOption( p_item, subsfile_mrl[j].mb_str() );
subsfile_mrl[j].mb_str() );
} }
} }
...@@ -922,10 +923,15 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) ) ...@@ -922,10 +923,15 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
{ {
for( int j = 0; j < (int)sout_mrl.GetCount(); j++ ) for( int j = 0; j < (int)sout_mrl.GetCount(); j++ )
{ {
playlist_AddOption( p_playlist, i_pos , playlist_AddItemOption( p_item, sout_mrl[j].mb_str() );
sout_mrl[j].mb_str() );
} }
} }
if( !i && i_open_arg )
{
int i_pos = playlist_GetPositionById( p_playlist , i_id );
playlist_Command( p_playlist, PLAYLIST_GOTO, i_pos );
}
i += i_options; i += i_options;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* wxwindows.h: private wxWindows interface description * wxwindows.h: private wxWindows interface description
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2004 VideoLAN * Copyright (C) 1999-2004 VideoLAN
* $Id: wxwindows.h,v 1.87 2004/01/25 03:29:02 hartman Exp $ * $Id: wxwindows.h,v 1.88 2004/01/26 22:10:20 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -375,6 +375,8 @@ private: ...@@ -375,6 +375,8 @@ private:
int i_disc_type_selection; int i_disc_type_selection;
int i_method; /* Normal or for the stream dialog ? */ int i_method; /* Normal or for the stream dialog ? */
int i_open_arg;
wxComboBox *mrl_combo; wxComboBox *mrl_combo;
wxNotebook *notebook; wxNotebook *notebook;
......
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