[Goodies-commits] r2800 - in xfce4-volstatus-icon/trunk: . xfce4-volstatus-icon

Brian Tarricone kelnos at xfce.org
Wed May 30 04:24:02 CEST 2007


Author: kelnos
Date: 2007-05-30 02:24:02 +0000 (Wed, 30 May 2007)
New Revision: 2800

Modified:
   xfce4-volstatus-icon/trunk/configure.ac.in
   xfce4-volstatus-icon/trunk/xfce4-volstatus-icon/xfce-volstatus-icon.c
Log:
* bump version to 0.2.0svn
* show drive icon in popup menu


Modified: xfce4-volstatus-icon/trunk/configure.ac.in
===================================================================
--- xfce4-volstatus-icon/trunk/configure.ac.in	2007-05-29 21:47:22 UTC (rev 2799)
+++ xfce4-volstatus-icon/trunk/configure.ac.in	2007-05-30 02:24:02 UTC (rev 2800)
@@ -5,7 +5,7 @@
 dnl Copyright (c) 2006 Brian Tarricone <bjt23 at cornell.edu>
 dnl
 
-m4_define([volstatus_version], [0.1.0])
+m4_define([volstatus_version], [0.2.0svn])
 
 dnl init autoconf
 AC_INIT([xfce4-volstatus-icon], [volstatus_version], [bjt23 at cornell.edu])

Modified: xfce4-volstatus-icon/trunk/xfce4-volstatus-icon/xfce-volstatus-icon.c
===================================================================
--- xfce4-volstatus-icon/trunk/xfce4-volstatus-icon/xfce-volstatus-icon.c	2007-05-29 21:47:22 UTC (rev 2799)
+++ xfce4-volstatus-icon/trunk/xfce4-volstatus-icon/xfce-volstatus-icon.c	2007-05-30 02:24:02 UTC (rev 2800)
@@ -203,6 +203,7 @@
     XfceVolstatusIcon *icon = XFCE_VOLSTATUS_ICON(status_icon);
     GtkWidget *menu, *mi;
     GList *mounted_drives = NULL;
+    GtkIconTheme *itheme = gtk_icon_theme_get_default();
     
     menu = gtk_menu_new();
 #if GTK_CHECK_VERSION(2, 12, 0)
@@ -222,11 +223,27 @@
         for(l = mounted_drives; l; l = l->next) {
             GHalDrive *drive = l->data;
             gchar *name, *label;
+            GList *icon_names, *l;
+            GtkWidget *img = NULL;
             
             name = ghal_drive_get_display_name(drive);
             label = g_strdup_printf(_("Safely remove \"%s\""), name);
             
-            mi = gtk_menu_item_new_with_label(label);
+            icon_names = ghal_drive_get_icon_list(drive);
+            for(l = icon_names; l; l = l->next) {
+                if(gtk_icon_theme_has_icon(itheme, l->data)) {
+                    img = gtk_image_new_from_icon_name(l->data,
+                                                       GTK_ICON_SIZE_MENU);
+                    gtk_widget_show(img);
+                    break;
+                }
+            }
+            g_list_foreach(icon_names, (GFunc)g_free, NULL);
+            g_list_free(icon_names);
+            
+            mi = gtk_image_menu_item_new_with_label(label);
+            if(img)
+                gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(mi), img);
             g_object_set_data(G_OBJECT(mi), "ghal-drive", drive);
             gtk_widget_show(mi);
             gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);




More information about the Goodies-commits mailing list