[Xfce4-commits] r24287 - xfburn/branches/libburn_trial/xfburn

Jean-François Wauthy pollux at xfce.org
Sun Jan 7 16:29:12 CET 2007


Author: pollux
Date: 2007-01-07 15:29:12 +0000 (Sun, 07 Jan 2007)
New Revision: 24287

Modified:
   xfburn/branches/libburn_trial/xfburn/xfburn-preferences-dialog.c
Log:
try to use media-optical and media-cdrom as themable icon before gtk-cdrom, this should avoid 
crappy png icon being shown


Modified: xfburn/branches/libburn_trial/xfburn/xfburn-preferences-dialog.c
===================================================================
--- xfburn/branches/libburn_trial/xfburn/xfburn-preferences-dialog.c	2007-01-07 13:49:03 UTC (rev 24286)
+++ xfburn/branches/libburn_trial/xfburn/xfburn-preferences-dialog.c	2007-01-07 15:29:12 UTC (rev 24287)
@@ -125,6 +125,7 @@
   GtkWidget *frame;
   GtkWidget *scrolled_window;
   GtkListStore *icon_store, *store;
+  gint x,y;
   GdkPixbuf *icon = NULL;
   GtkTreeIter iter;
   GtkTreeViewColumn *column_name;
@@ -289,17 +290,22 @@
   g_signal_connect (G_OBJECT (priv->button_scan), "clicked", G_CALLBACK (scan_button_clicked_cb), obj);
   gtk_widget_show (priv->button_scan);
 
-  icon = gtk_widget_render_icon (GTK_WIDGET (priv->icon_bar),
-                                 GTK_STOCK_CDROM,
-                                 GTK_ICON_SIZE_DIALOG,
-                                 NULL);
+  gtk_icon_size_lookup (GTK_ICON_SIZE_DIALOG, &x, &y);
+  icon = xfce_themed_icon_load ("media-optical", x);
+  if (!icon)
+    icon = xfce_themed_icon_load ("media-cdrom", x);
+  if (!icon)
+    icon = xfce_themed_icon_load (GTK_STOCK_CDROM, x);
+
+  
   gtk_list_store_append (icon_store, &iter);
   gtk_list_store_set (icon_store, &iter,
                       SETTINGS_LIST_PIXBUF_COLUMN, icon,
                       SETTINGS_LIST_TEXT_COLUMN, _("Devices"),
                       SETTINGS_LIST_INDEX_COLUMN, index,
                       -1);
-  g_object_unref (G_OBJECT (icon));
+  if (icon)
+    g_object_unref (G_OBJECT (icon));
   
   exo_mutual_binding_new (G_OBJECT (priv->notebook), "page", G_OBJECT (priv->icon_bar), "active");
   



More information about the Xfce4-commits mailing list