[Xfce4-commits] <parole:master> Use parole_icon_load instead of xfce_themed_icon...

Ali Abdallah noreply at xfce.org
Fri Oct 9 08:54:01 CEST 2009


Updating branch refs/heads/master
         to ec0d1655391dc3452132fd54188f2888ccadb922 (commit)
       from 8580af4bb4da9b4a75cc9bfdba0fb8a152ee08ee (commit)

commit ec0d1655391dc3452132fd54188f2888ccadb922
Author: Ali Abdallah <ali at ali-xfce.org>
Date:   Fri Oct 9 08:52:33 2009 +0000

    Use parole_icon_load instead of xfce_themed_icon...

 parole/parole-about.c  |    5 +++--
 parole/parole-player.c |   12 ++++++------
 parole/parole-utils.c  |   21 +++++++++++++++++++++
 parole/parole-utils.h  |    3 +++
 4 files changed, 33 insertions(+), 8 deletions(-)

diff --git a/parole/parole-about.c b/parole/parole-about.c
index b989100..9de0a88 100644
--- a/parole/parole-about.c
+++ b/parole/parole-about.c
@@ -30,8 +30,9 @@
 #include <libxfcegui4/libxfcegui4.h>
 
 #include "parole-about.h"
+#include "parole-utils.h"
 
-void  parole_about (const gchar *package)
+void  parole_about (void)
 {
     XfceAboutInfo *info;
     GtkWidget *dialog;
@@ -65,7 +66,7 @@ void  parole_about (const gchar *package)
     }
 
     gtk_icon_size_lookup (GTK_ICON_SIZE_DIALOG, &x, &y);
-    icon = xfce_themed_icon_load ("parole", x);
+    icon = parole_icon_load ("parole", x);
     
     dialog = xfce_about_dialog_new_with_values (NULL, info, icon);
     
diff --git a/parole/parole-player.c b/parole/parole-player.c
index 8abfd64..548325b 100644
--- a/parole/parole-player.c
+++ b/parole/parole-player.c
@@ -231,7 +231,7 @@ G_DEFINE_TYPE (ParolePlayer, parole_player, G_TYPE_OBJECT)
 
 void parole_show_about	(GtkWidget *widget)
 {
-    parole_about (_("Parole Media Player"));
+    parole_about ();
 }
 
 void ratio_none_toggled_cb (GtkWidget *widget, ParolePlayer *player)
@@ -489,10 +489,10 @@ parole_player_playing (ParolePlayer *player, const ParoleStream *stream)
     
     player->priv->state = PAROLE_MEDIA_STATE_PLAYING;
     
-    pix = xfce_themed_icon_load ("player_play", 16);
+    pix = parole_icon_load ("player_play", 16);
     
     if ( !pix )
-	pix = xfce_themed_icon_load ("gtk-media-play-ltr", 16);
+	pix = parole_icon_load ("gtk-media-play-ltr", 16);
     
     parole_media_list_set_row_pixbuf (player->priv->list, player->priv->row, pix);
     
@@ -537,7 +537,7 @@ parole_player_paused (ParolePlayer *player)
     
     TRACE ("Player paused");
     
-    pix = xfce_themed_icon_load (GTK_STOCK_MEDIA_PAUSE, 16);
+    pix = parole_icon_load (GTK_STOCK_MEDIA_PAUSE, 16);
     parole_media_list_set_row_pixbuf (player->priv->list, player->priv->row, pix);
     
     gtk_widget_set_sensitive (player->priv->play_pause, TRUE);
@@ -1216,8 +1216,8 @@ parole_player_set_volume_image (ParolePlayer *player, gdouble value)
 {
     GdkPixbuf *icon;
 
-    icon = xfce_themed_icon_load (parole_player_get_volume_icon_name (value), 
-				  player->priv->volume_image->allocation.width);
+    icon = parole_icon_load (parole_player_get_volume_icon_name (value), 
+			     player->priv->volume_image->allocation.width);
     if ( icon )
     {
 	g_object_set (G_OBJECT (player->priv->volume_image),
diff --git a/parole/parole-utils.c b/parole/parole-utils.c
index c774229..04139d7 100644
--- a/parole/parole-utils.c
+++ b/parole/parole-utils.c
@@ -358,3 +358,24 @@ parole_is_uri_disc (const gchar *uri)
     else
 	return FALSE;
 }
+
+GdkPixbuf *parole_icon_load (const gchar *icon_name, gint size)
+{
+    GdkPixbuf *pix = NULL;
+    GError *error = NULL;
+    
+    pix = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (), 
+				    icon_name, 
+				    size,
+				    GTK_ICON_LOOKUP_USE_BUILTIN,
+				    &error);
+				    
+    if ( error )
+    {
+	g_warning ("Unable to load icon : %s : %s", icon_name, error->message);
+	g_error_free (error);
+    }
+    
+    return pix;
+    
+}
diff --git a/parole/parole-utils.h b/parole/parole-utils.h
index 5b5ff32..a755200 100644
--- a/parole/parole-utils.h
+++ b/parole/parole-utils.h
@@ -40,4 +40,7 @@ gchar          *parole_get_subtitle_path		(const gchar *uri) G_GNUC_MALLOC G_GNU
 
 gboolean	parole_is_uri_disc			(const gchar *uri);
 
+GdkPixbuf      *parole_icon_load			(const gchar *icon_name,
+							 gint size);
+
 #endif /* __PAROLE_UTILS_ */



More information about the Xfce4-commits mailing list