changeset 855:fbf1f593b0c6 trunk

[svn] statusicon: added a open-file item in the small right-click menu
author giacomo
date Wed, 14 Mar 2007 07:50:31 -0700
parents aac49941ee8f
children a5f4472faa6b
files ChangeLog src/statusicon/si.c src/statusicon/si_audacious.h src/statusicon/si_ui.c
diffstat 4 files changed, 28 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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 <james@develia.org>
+  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 <yaz@cc.rim.or.jp>
   revision [1806]
   - add 1sec guard time after issue of playlist_prev/next.
--- 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;
   }
 }
--- 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 );
--- 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;
 }