diff -rc xmms-1.2.4/xmms/main.c xmms.vanilla/xmms/main.c
*** xmms-1.2.4/xmms/main.c	Mon Nov 20 16:45:10 2000
--- xmms.vanilla/xmms/main.c	Mon Dec 25 02:30:32 2000
***************
*** 37,47 ****
  
  GtkWidget *mainwin, *mainwin_url_window = NULL, *mainwin_dir_browser = NULL;
  GtkWidget *mainwin_jtt = NULL, *mainwin_jtf = NULL;
! GtkItemFactory *mainwin_options_menu, *mainwin_songname_menu, *mainwin_vis_menu;
  GtkItemFactory *mainwin_general_menu;
  GdkPixmap *mainwin_bg = NULL, *mainwin_bg_dblsize;
  GdkGC *mainwin_gc;
  
  GtkAccelGroup *mainwin_accel;
  
  gboolean mainwin_focus = FALSE;
--- 37,48 ----
  
  GtkWidget *mainwin, *mainwin_url_window = NULL, *mainwin_dir_browser = NULL;
  GtkWidget *mainwin_jtt = NULL, *mainwin_jtf = NULL;
! GtkItemFactory *mainwin_options_menu, *mainwin_songname_menu, *mainwin_vis_menu, *playlist_popup_menu;
  GtkItemFactory *mainwin_general_menu;
  GdkPixmap *mainwin_bg = NULL, *mainwin_bg_dblsize;
  GdkGC *mainwin_gc;
  
+ 
  GtkAccelGroup *mainwin_accel;
  
  gboolean mainwin_focus = FALSE;
***************
*** 252,257 ****
--- 253,354 ----
  	MAINWIN_GENERAL_EXIT
  };
  
+ enum
+ {
+ 	DEL_FILE, MOV_FILE, SEL_ALL, SEL_NONE, SEL_CROP, SEL_INV, SEL_DEL,
+ 	PLAYLISTWIN_SORT_BYTITLE, PLAYLISTWIN_SORT_BYFILENAME, PLAYLISTWIN_SORT_BYPATH,
+ 	PLAYLISTWIN_SORT_SEL_BYTITLE, PLAYLISTWIN_SORT_SEL_BYFILENAME,
+ 	PLAYLISTWIN_SORT_SEL_BYPATH, PLAYLISTWIN_SORT_RANDOMIZE, PLAYLISTWIN_SORT_REVERSE
+ 
+ };
+ 
+ void playlist_popup_callback(gpointer cb_data, guint action, GtkWidget * w)
+ {
+ 	switch (action)
+ 	{
+ 		case DEL_FILE:
+ 			playlist_list_delete_file();
+ 			break;
+ 		case SEL_ALL:
+ 			playlistwin_select_all();
+ 			break;
+ 		case SEL_NONE:
+ 			playlistwin_select_none();
+ 			break;
+ 		case SEL_CROP:
+ 			playlist_delete(TRUE);
+ 			break;
+ 		case SEL_DEL:
+ 			playlist_delete(FALSE);
+ 			break;
+ 		case SEL_INV:
+ 			playlistwin_inverse_selection();
+     			break;
+ 		case PLAYLISTWIN_SORT_BYTITLE:
+ 			playlist_sort_by_title();
+ 			playlistwin_update_list();
+ 			break;
+ 		case PLAYLISTWIN_SORT_BYFILENAME:
+ 			playlist_sort_by_filename();
+ 			playlistwin_update_list();
+ 			break;
+ 		case PLAYLISTWIN_SORT_BYPATH:
+ 			playlist_sort_by_path();
+ 			playlistwin_update_list();
+ 			break;
+ 		case PLAYLISTWIN_SORT_SEL_BYTITLE:
+ 			playlist_sort_selected_by_title();
+ 			playlistwin_update_list();
+ 			break;
+ 		case PLAYLISTWIN_SORT_SEL_BYFILENAME:
+ 			playlist_sort_selected_by_filename();
+ 			playlistwin_update_list();
+ 			break;
+ 		case PLAYLISTWIN_SORT_SEL_BYPATH:
+ 			playlist_sort_selected_by_path();
+ 			playlistwin_update_list();
+ 			break;
+ 		case PLAYLISTWIN_SORT_REVERSE:
+ 			playlist_reverse();
+ 			playlistwin_update_list();
+ 			break;
+ 		case PLAYLISTWIN_SORT_RANDOMIZE:
+ 			playlist_random();
+ 			playlistwin_update_list();
+ 			break;
+ 
+ 	}
+ }
+ 
+ /* findme: by freax playlist_popup_menu_entries */
+ #define PLAYLIST_POPUP_MENU_ENTRIES 21
+ GtkItemFactoryEntry playlist_popup_menu_entries[] =
+ {
+ 	{N_("/File"), NULL, NULL, 0, "<Branch>"},
+ 	{N_("/File/Delete selected"), NULL, playlist_popup_callback, DEL_FILE, "<Item>"},
+ 	{N_("/-"), NULL, NULL, 0, "<Separator>"},
+ 	{N_("/Select"), NULL, NULL, 0, "<Branch>"},
+ 	{N_("/Select/Select all"), NULL, playlist_popup_callback, SEL_ALL, "<Item>"},
+ 	{N_("/Select/Select none"), NULL, playlist_popup_callback, SEL_NONE, "<Item>"},
+ 	{N_("/Select/Crop selection"), NULL, playlist_popup_callback, SEL_CROP, "<Item>"},
+ 	{N_("/Select/Invert selection"), NULL, playlist_popup_callback, SEL_INV, "<Item>"},
+ 	{N_("/Select/Remove from list"), NULL, playlist_popup_callback, SEL_DEL, "<Item>"},
+ 	{N_("/-"), NULL, NULL, 0, "<Separator>"},
+ 	{N_("/Sort List"), NULL, NULL, 0, "<Branch>"},
+ 	{N_("/Sort List/By Title"), NULL, playlist_popup_callback, PLAYLISTWIN_SORT_BYTITLE, "<Item>"},
+ 	{N_("/Sort List/By Filename"), NULL, playlist_popup_callback, PLAYLISTWIN_SORT_BYFILENAME, "<Item>"},
+ 	{N_("/Sort List/By Path + Filename"), NULL, playlist_popup_callback, PLAYLISTWIN_SORT_BYPATH, "<Item>"},
+ 	{N_("/Sort Selection"), NULL, NULL, 0, "<Branch>"},
+ 	{N_("/Sort Selection/By Title"), NULL, playlist_popup_callback, PLAYLISTWIN_SORT_SEL_BYTITLE, "<Item>"},
+ 	{N_("/Sort Selection/By Filename"), NULL, playlist_popup_callback, PLAYLISTWIN_SORT_SEL_BYFILENAME, "<Item>"},
+ 	{N_("/Sort Selection/By Path + Filename"), NULL, playlist_popup_callback, PLAYLISTWIN_SORT_SEL_BYPATH, "<Item>"},
+ 	{N_("/-"), NULL, NULL, 0, "<Separator>"},
+ 	{N_("/Randomize List"), NULL, playlist_popup_callback, PLAYLISTWIN_SORT_RANDOMIZE, "<Item>"},
+ 	{N_("/Reverse List"), NULL, playlist_popup_callback, PLAYLISTWIN_SORT_REVERSE, "<Item>"},
+ 
+ };
+ 
+ 
  #define MAINWIN_GENERAL_MENU_ENTRIES 30
  
  void mainwin_general_menu_callback(gpointer cb_data, guint action, GtkWidget * w);
***************
*** 744,749 ****
--- 841,847 ----
  	MAINWIN_VIS_ACTIVE_MAINWIN, MAINWIN_VIS_ACTIVE_PLAYLISTWIN
  };
  
+ 
  void mainwin_vis_set_active_vis(gint new_vis)
  {
  	switch (new_vis)
***************
*** 2550,2555 ****
--- 2648,2654 ----
  	GTK_CHECK_MENU_ITEM(gtk_item_factory_get_widget(mainwin_options_menu, _("/Playlist WindowShade Mode")))->active = cfg.playlist_shaded;
  	GTK_CHECK_MENU_ITEM(gtk_item_factory_get_widget(mainwin_options_menu, _("/Equalizer WindowShade Mode")))->active = cfg.equalizer_shaded;
  	mainwin_songname_menu = gtk_item_factory_new(GTK_TYPE_MENU, "<Main>", mainwin_accel);
+ 
  #ifdef ENABLE_NLS
  {
  	int i;
***************
*** 2611,2621 ****
  	GTK_CHECK_MENU_ITEM(gtk_item_factory_get_widget(mainwin_general_menu, _("/Playlist Editor")))->active = cfg.playlist_visible;
  	gtk_menu_item_set_submenu(GTK_MENU_ITEM(gtk_item_factory_get_widget(mainwin_general_menu, _("/Options"))), GTK_WIDGET(gtk_item_factory_get_widget(mainwin_options_menu, "")));
  	gtk_menu_item_set_submenu(GTK_MENU_ITEM(gtk_item_factory_get_widget(mainwin_general_menu, _("/Visualization"))), GTK_WIDGET(gtk_item_factory_get_widget(mainwin_vis_menu, "")));
  }
  
  void setup_main_window(void)
  {
- 
  	mainwin_bg = gdk_pixmap_new(mainwin->window, 275, 116, gdk_rgb_get_visual()->depth);
  	mainwin_bg_dblsize = gdk_pixmap_new(mainwin->window, 550, 232, gdk_rgb_get_visual()->depth);
  	if (cfg.doublesize)
--- 2710,2735 ----
  	GTK_CHECK_MENU_ITEM(gtk_item_factory_get_widget(mainwin_general_menu, _("/Playlist Editor")))->active = cfg.playlist_visible;
  	gtk_menu_item_set_submenu(GTK_MENU_ITEM(gtk_item_factory_get_widget(mainwin_general_menu, _("/Options"))), GTK_WIDGET(gtk_item_factory_get_widget(mainwin_options_menu, "")));
  	gtk_menu_item_set_submenu(GTK_MENU_ITEM(gtk_item_factory_get_widget(mainwin_general_menu, _("/Visualization"))), GTK_WIDGET(gtk_item_factory_get_widget(mainwin_vis_menu, "")));
+ 
+ /* findme: by freax playlist_popup_menu (create the popup) */
+ 	playlist_popup_menu = gtk_item_factory_new(GTK_TYPE_MENU, "<Main>", mainwin_accel);
+ 	gtk_item_factory_create_items(playlist_popup_menu, PLAYLIST_POPUP_MENU_ENTRIES, playlist_popup_menu_entries, NULL);
+ /* fixme: Some items should be disabled by default and enabled when a playlist is defined */
+ #ifdef ENABLE_NLS
+ {
+ 	int i;
+ 	for (i = 0; i < PLAYLIST_POPUP_MENU_ENTRIES; i++)
+ 	{
+ 		playlist_popup_menu_entries[i].path =
+ 			gettext(playlist_popup_menu_entries[i].path);
+ 	}
+ }
+ #endif
+ 
  }
  
  void setup_main_window(void)
  {
  	mainwin_bg = gdk_pixmap_new(mainwin->window, 275, 116, gdk_rgb_get_visual()->depth);
  	mainwin_bg_dblsize = gdk_pixmap_new(mainwin->window, 550, 232, gdk_rgb_get_visual()->depth);
  	if (cfg.doublesize)
diff -rc xmms-1.2.4/xmms/main.h xmms.vanilla/xmms/main.h
*** xmms-1.2.4/xmms/main.h	Fri Oct 20 15:40:32 2000
--- xmms.vanilla/xmms/main.h	Thu Dec 21 23:24:47 2000
***************
*** 71,77 ****
  extern GList *disabled_iplugins;
  extern GtkWidget *equalizerwin;
  extern GtkWidget *playlistwin;
! extern GtkItemFactory *mainwin_vis_menu, *mainwin_general_menu, *mainwin_options_menu;
  extern GList *dock_window_list;
  extern gboolean pposition_broken;
  
--- 71,78 ----
  extern GList *disabled_iplugins;
  extern GtkWidget *equalizerwin;
  extern GtkWidget *playlistwin;
! /* findme: playlist_popup_menu added by freax */
! extern GtkItemFactory *mainwin_vis_menu, *mainwin_general_menu, *mainwin_options_menu ,*playlist_popup_menu;
  extern GList *dock_window_list;
  extern gboolean pposition_broken;
  
diff -rc xmms-1.2.4/xmms/playlist.c xmms.vanilla/xmms/playlist.c
*** xmms-1.2.4/xmms/playlist.c	Thu Nov  9 12:12:08 2000
--- xmms.vanilla/xmms/playlist.c	Tue Dec 26 01:51:46 2000
***************
*** 27,32 ****
--- 27,33 ----
  static pthread_t playlist_get_info_thread;
  pthread_mutex_t playlist_mutex = PTHREAD_MUTEX_INITIALIZER;
  PlaylistEntry *playlist_position;
+ GtkWidget *playlist_del_file_dialog;
  
  extern PlayList_List *playlistwin_list;
  extern Vis *mainwin_vis;
***************
*** 40,45 ****
--- 41,126 ----
  	return g_list_find(playlist, playlist_position);
  }
  
+ 
+ /* findme playlist_list_delete_file(void) by freax */
+ void playlist_delete_file_ok(void) 
+ {
+     GList *node, *playing_song;
+     PlaylistEntry *entry;
+ 
+     if (playlist)
+     {
+ 	playing_song = g_list_find(playlist, playlist_position);
+ 	node = playlist;
+ 	while (node)
+ 	{
+ 	    entry = (PlaylistEntry *) node->data;
+ 	    if (entry->selected) 
+ 	    {
+ 		if ((playing_song == node) && (get_input_playing())) input_stop();
+ 		remove(entry->filename);
+ 	    }
+ 	    node = node->next;
+ 
+ 	}
+ 
+ 	playlist_delete(FALSE);
+ 	playlist_remove_dead_files();
+ 	playlistwin_update_list();
+ 	playlist_generate_shuffle_list();
+ 
+     }
+ }
+ 
+ void playlist_delete_file_dialog_button_clicked(GtkWidget *widget, gpointer gdata)
+ {
+     /*user pressed YES*/
+     playlist_delete_file_ok();
+     gtk_widget_destroy(playlist_del_file_dialog);
+     
+ }
+ 
+ 
+ void playlist_list_delete_file(void)
+ {
+     GtkWidget *label, *okay_button, *nope_button;
+     GList *node;
+     PlaylistEntry *entry;
+     char warning[70];
+     int i=0;
+ 
+     if (playlist)
+     {
+ 	node = playlist;
+ 	while (node)
+ 	{
+ 	    entry = (PlaylistEntry *) node->data;
+ 	    if (entry->selected) i++;
+ 	    node = node->next;
+ 	}
+     }  
+ 
+     if (i > 0) {
+ 	if (i == 1) sprintf(warning,"Are you sure you want to delete\nthe selected file ?");
+ 	    else sprintf(warning,"Are you sure you want\nto delete %d files ?",i);
+ 	playlist_del_file_dialog = gtk_dialog_new();
+ 	label = gtk_label_new (warning);
+ 	okay_button = gtk_button_new_with_label("Yes");
+ 	nope_button = gtk_button_new_with_label("No");
+ 
+ 	gtk_signal_connect_object(GTK_OBJECT (okay_button), "clicked", playlist_delete_file_dialog_button_clicked,GTK_OBJECT(playlist_del_file_dialog));
+ 	gtk_signal_connect_object(GTK_OBJECT (nope_button), "clicked", gtk_widget_destroy,GTK_OBJECT(playlist_del_file_dialog));
+      
+ 	gtk_container_add (GTK_CONTAINER (GTK_DIALOG(playlist_del_file_dialog)->action_area), okay_button);
+ 	gtk_container_add (GTK_CONTAINER (GTK_DIALOG(playlist_del_file_dialog)->action_area), nope_button);
+ 
+ 	gtk_container_add (GTK_CONTAINER (GTK_DIALOG(playlist_del_file_dialog)->vbox), label);
+ 	gtk_widget_show_all (playlist_del_file_dialog);
+     }
+ }
+ 
+ 
+ 
  void playlist_clear(void)
  {
  	GList *node;
***************
*** 72,77 ****
--- 153,159 ----
  	pthread_mutex_unlock(&playlist_mutex);
  	playlist_generate_shuffle_list();
  }
+ 
  
  void playlist_delete_index(glong index)
  {
diff -rc xmms-1.2.4/xmms/playlist.h xmms.vanilla/xmms/playlist.h
*** xmms-1.2.4/xmms/playlist.h	Fri Jul 28 18:38:36 2000
--- xmms.vanilla/xmms/playlist.h	Fri Dec 22 12:13:42 2000
***************
*** 74,79 ****
--- 74,81 ----
  gchar* playlist_get_filename(gint pos);
  gchar* playlist_get_songtitle(gint pos);
  gint playlist_get_songtime(gint pos);
+ /* findme: added by freax */
+ void playlist_list_delete_file(void);
  
  
  #define PL_LOCK()    pthread_mutex_lock(&playlist_mutex)
diff -rc xmms-1.2.4/xmms/playlist_list.c xmms.vanilla/xmms/playlist_list.c
*** xmms-1.2.4/xmms/playlist_list.c	Thu Nov  9 12:12:08 2000
--- xmms.vanilla/xmms/playlist_list.c	Mon Dec 25 02:37:41 2000
***************
*** 22,27 ****
--- 22,29 ----
  #include <wchar.h>
  #endif
  
+ 
+ 
  gint playlist_list_auto_drag_down_func(gpointer data)
  {
  	PlayList_List *pl = data;
***************
*** 119,125 ****
  	GList *list;
  	PlaylistEntry *entry;
  	gint nr, y;
! 
  	if (get_playlist() && inside_widget(event->x, event->y, &pl->pl_widget) && pl->pl_fheight)
  	{
  		if (event->button == 1)
--- 121,128 ----
  	GList *list;
  	PlaylistEntry *entry;
  	gint nr, y;
! 	    
! 	
  	if (get_playlist() && inside_widget(event->x, event->y, &pl->pl_widget) && pl->pl_fheight)
  	{
  		if (event->button == 1)
***************
*** 224,229 ****
--- 227,239 ----
  
  void playlist_list_button_release_cb(GtkWidget * widget, GdkEventButton * event, PlayList_List * pl)
  {
+ 
+ 	/* findme: added by freax (popup menu) */
+ 	if (event->button == 3)
+ 	{
+ 	    util_item_factory_popup(playlist_popup_menu, event->x_root, event->y_root + 2, 1, GDK_CURRENT_TIME);
+ 	}
+ 
  	pl->pl_dragging = FALSE;
  	pl->pl_auto_drag_down = FALSE;
  	pl->pl_auto_drag_up = FALSE;
diff -rc xmms-1.2.4/xmms/playlistwin.c xmms.vanilla/xmms/playlistwin.c
*** xmms-1.2.4/xmms/playlistwin.c	Mon Nov 20 16:45:10 2000
--- xmms.vanilla/xmms/playlistwin.c	Fri Dec 22 00:10:18 2000
***************
*** 95,101 ****
  
  enum
  {
! 	PLAYLISTWIN_REMOVE_DEAD_FILES
  };
  
  #define PLAYLISTWIN_SUB_MENU_ENTRIES 1
--- 95,102 ----
  
  enum
  {
! 	PLAYLISTWIN_REMOVE_DEAD_FILES,
! 	PLAYLISTWIN_DELETE_FILE
  };
  
  #define PLAYLISTWIN_SUB_MENU_ENTRIES 1
***************
*** 103,108 ****
--- 104,110 ----
  GtkItemFactoryEntry playlistwin_sub_menu_entries[] =
  {
  	{N_("/Remove Dead Files"), NULL, playlistwin_sub_menu_callback, PLAYLISTWIN_REMOVE_DEAD_FILES, "<Item>"},
+ 
  };
  
  void playlistwin_draw_frame(void);
diff -rc xmms-1.2.4/xmms/playlistwin.h xmms.vanilla/xmms/playlistwin.h
*** xmms-1.2.4/xmms/playlistwin.h	Wed Feb 16 22:05:58 2000
--- xmms.vanilla/xmms/playlistwin.h	Fri Dec 22 12:29:34 2000
***************
*** 38,44 ****
  void playlistwin_scroll_down_pushed(void);
  void playlistwin_vis_disable(void);
  void playlistwin_vis_enable(void);
! 
  extern Vis *playlistwin_vis;
  
  #endif
--- 38,46 ----
  void playlistwin_scroll_down_pushed(void);
  void playlistwin_vis_disable(void);
  void playlistwin_vis_enable(void);
! void playlistwin_select_none(void);
! void playlistwin_select_all(void);
! void playlistwin_inverse_selection(void);
  extern Vis *playlistwin_vis;
  
  #endif

