# HG changeset patch # User giacomo # Date 1173883831 25200 # Node ID fbf1f593b0c635b93eaa257879e9c01a94893ee7 # Parent aac49941ee8fc6015e49d2be8cbb8e558002dc30 [svn] statusicon: added a open-file item in the small right-click menu diff -r aac49941ee8f -r fbf1f593b0c6 ChangeLog --- a/ChangeLog Wed Mar 14 07:44:00 2007 -0700 +++ b/ChangeLog Wed Mar 14 07:50:31 2007 -0700 @@ -1,3 +1,15 @@ +2007-03-14 14:44:00 +0000 Giacomo Lozito + revision [1808] + statusicon 0.3: alternative right-click menu with simple playback control commands + trunk/src/statusicon/Makefile | 4 + trunk/src/statusicon/si.c | 37 +++++++ + trunk/src/statusicon/si.h | 3 + trunk/src/statusicon/si_audacious.h | 7 + + trunk/src/statusicon/si_common.h | 2 + trunk/src/statusicon/si_ui.c | 173 +++++++++++++++++++++++++++++++++++- + 6 files changed, 218 insertions(+), 8 deletions(-) + + 2007-03-14 13:43:19 +0000 Yoshiki Yazawa revision [1806] - add 1sec guard time after issue of playlist_prev/next. diff -r aac49941ee8f -r fbf1f593b0c6 src/statusicon/si.c --- a/src/statusicon/si.c Wed Mar 14 07:44:00 2007 -0700 +++ b/src/statusicon/si.c Wed Mar 14 07:50:31 2007 -0700 @@ -146,5 +146,9 @@ case SI_AUDACIOUS_PLAYBACK_CTRL_NEXT: xmms_remote_playlist_next( si_gp.xmms_session ); break; + + case SI_AUDACIOUS_PLAYBACK_CTRL_EJECT: + xmms_remote_eject( si_gp.xmms_session ); + break; } } diff -r aac49941ee8f -r fbf1f593b0c6 src/statusicon/si_audacious.h --- a/src/statusicon/si_audacious.h Wed Mar 14 07:44:00 2007 -0700 +++ b/src/statusicon/si_audacious.h Wed Mar 14 07:50:31 2007 -0700 @@ -30,6 +30,7 @@ #define SI_AUDACIOUS_PLAYBACK_CTRL_PAUSE 2 #define SI_AUDACIOUS_PLAYBACK_CTRL_STOP 3 #define SI_AUDACIOUS_PLAYBACK_CTRL_NEXT 4 +#define SI_AUDACIOUS_PLAYBACK_CTRL_EJECT 5 void si_audacious_toggle_visibility ( void ); void si_audacious_volume_change ( gint ); diff -r aac49941ee8f -r fbf1f593b0c6 src/statusicon/si_ui.c --- a/src/statusicon/si_ui.c Wed Mar 14 07:44:00 2007 -0700 +++ b/src/statusicon/si_ui.c Wed Mar 14 07:50:31 2007 -0700 @@ -359,7 +359,7 @@ { GtkWidget *si_smenu = gtk_menu_new(); GtkWidget *si_smenu_prev_item, *si_smenu_play_item, *si_smenu_pause_item; - GtkWidget *si_smenu_stop_item, *si_smenu_next_item; + GtkWidget *si_smenu_stop_item, *si_smenu_next_item, *si_smenu_sep_item, *si_smenu_eject_item; si_smenu_prev_item = gtk_image_menu_item_new_from_stock( GTK_STOCK_MEDIA_PREVIOUS , NULL ); @@ -396,6 +396,16 @@ GINT_TO_POINTER(SI_AUDACIOUS_PLAYBACK_CTRL_NEXT) ); gtk_menu_shell_append( GTK_MENU_SHELL(si_smenu) , si_smenu_next_item ); gtk_widget_show(si_smenu_next_item); + si_smenu_sep_item = gtk_separator_menu_item_new(); + gtk_menu_shell_append( GTK_MENU_SHELL(si_smenu) , si_smenu_sep_item ); + gtk_widget_show(si_smenu_sep_item); + si_smenu_eject_item = gtk_image_menu_item_new_from_stock( + GTK_STOCK_OPEN , NULL ); + g_signal_connect_swapped( si_smenu_eject_item , "activate" , + G_CALLBACK(si_audacious_playback_ctrl) , + GINT_TO_POINTER(SI_AUDACIOUS_PLAYBACK_CTRL_EJECT) ); + gtk_menu_shell_append( GTK_MENU_SHELL(si_smenu) , si_smenu_eject_item ); + gtk_widget_show(si_smenu_eject_item); return si_smenu; }