Commit 34eab38e authored by Pierre Baillet's avatar Pierre Baillet

Corrected playlist update on file opening.

parent 9dde7278
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_callbacks.c : Callbacks for the Gtk+ plugin. * gtk_callbacks.c : Callbacks for the Gtk+ plugin.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_callbacks.c,v 1.12 2001/03/21 13:42:34 sam Exp $ * $Id: gtk_callbacks.c,v 1.13 2001/04/08 13:09:32 octplane Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -51,18 +51,11 @@ ...@@ -51,18 +51,11 @@
#include "gtk_callbacks.h" #include "gtk_callbacks.h"
#include "gtk_interface.h" #include "gtk_interface.h"
#include "gtk_support.h" #include "gtk_support.h"
#include "gtk_playlist.h"
#include "intf_gtk.h" #include "intf_gtk.h"
#include "main.h" #include "main.h"
/****************************************************************************
* External function
*/
void on_generic_drop_data_received( intf_thread_t * p_intf,
GtkSelectionData *data, guint info, int position);
/***************************************************************************** /*****************************************************************************
* Callbacks * Callbacks
******************************************************************************/ ******************************************************************************/
...@@ -252,14 +245,30 @@ void ...@@ -252,14 +245,30 @@ void
on_fileopen_ok_clicked (GtkButton *button, on_fileopen_ok_clicked (GtkButton *button,
gpointer user_data) gpointer user_data)
{ {
GtkWidget *filesel; GtkCList *playlist_clist;
gchar *filename; gchar *filename;
filesel = gtk_widget_get_toplevel (GTK_WIDGET (button)); GtkWidget *filesel = gtk_widget_get_toplevel ( GTK_WIDGET (button) );
/* retrieve the interface */
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(filesel), "intf_fileopen" );
/* hide the widget */
gtk_widget_hide (filesel); gtk_widget_hide (filesel);
filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (filesel)); filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (filesel));
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, (char*)filename ); /* catch the GTK CList */
playlist_clist = GTK_CLIST(
lookup_widget(p_intf->p_sys->p_playlist,"playlist_clist"));
intf_PlaylistAdd( p_main->p_playlist,
PLAYLIST_END,
(char*)filename );
/* update the display */
rebuildCList( playlist_clist ,
p_main->p_playlist );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_playlist.c : Interface for the playlist dialog * gtk_playlist.c : Interface for the playlist dialog
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: gtk_playlist.c,v 1.8 2001/03/21 13:42:34 sam Exp $ * $Id: gtk_playlist.c,v 1.9 2001/04/08 13:09:32 octplane Exp $
* *
* Authors: Pierre Baillet <oct@zoy.org> * Authors: Pierre Baillet <oct@zoy.org>
* *
...@@ -56,19 +56,11 @@ ...@@ -56,19 +56,11 @@
#include "gtk_callbacks.h" #include "gtk_callbacks.h"
#include "gtk_interface.h" #include "gtk_interface.h"
#include "gtk_support.h" #include "gtk_support.h"
#include "gtk_playlist.h"
#include "intf_gtk.h" #include "intf_gtk.h"
#include "main.h"
/* Playlist specific functions */ #include "main.h"
void rebuildCList(GtkCList * clist, playlist_t * playlist_p);
gint compareItems(gconstpointer a, gconstpointer b);
int hasValidExtension(gchar * filename);
GList * intf_readFiles(gchar * fsname );
int intf_AppendList( playlist_t * p_playlist, int i_pos, GList * list );
void GtkPlayListManage( gpointer p_data );
void on_generic_drop_data_received( intf_thread_t * p_intf,
GtkSelectionData *data, guint info, int position);
void void
on_menubar_playlist_activate (GtkMenuItem *menuitem, on_menubar_playlist_activate (GtkMenuItem *menuitem,
...@@ -110,7 +102,7 @@ on_toolbar_playlist_clicked (GtkButton *button, ...@@ -110,7 +102,7 @@ on_toolbar_playlist_clicked (GtkButton *button,
if( !GTK_IS_WIDGET( p_intf->p_sys->p_playlist ) ) if( !GTK_IS_WIDGET( p_intf->p_sys->p_playlist ) )
{ {
/* this shoud never happen */ /* this should never happen */
intf_ErrMsgImm("intf_playlist is not a widget !"); intf_ErrMsgImm("intf_playlist is not a widget !");
p_intf->p_sys->p_playlist = create_intf_playlist(); p_intf->p_sys->p_playlist = create_intf_playlist();
...@@ -273,7 +265,7 @@ on_delete_clicked (GtkMenuItem *item, ...@@ -273,7 +265,7 @@ on_delete_clicked (GtkMenuItem *item,
g_list_foreach( selection, g_list_foreach( selection,
deleteGListItem, deleteGListItem,
p_intf ); p_intf );
/* rebuild the CList */
rebuildCList( clist, playlist_p ); rebuildCList( clist, playlist_p );
} }
......
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