[Goodies-commits] r2555 - in xfce4-weather-plugin/trunk: . panel-plugin

Nick Schermer nick at xfce.org
Wed Mar 14 21:07:53 CET 2007


Author: nick
Date: 2007-03-14 20:07:53 +0000 (Wed, 14 Mar 2007)
New Revision: 2555

Modified:
   xfce4-weather-plugin/trunk/ChangeLog
   xfce4-weather-plugin/trunk/panel-plugin/weather-icon.c
   xfce4-weather-plugin/trunk/panel-plugin/weather-scrollbox.c
   xfce4-weather-plugin/trunk/panel-plugin/weather-summary.c
   xfce4-weather-plugin/trunk/panel-plugin/weather.c
Log:
	* Hide the ebox window, so you can see the panel background.
	* Don't crash when no icons were found.
	* Show a "No Data" label when nothing has been configured.
	* panel-plugin/sample.c: Hmm, chinese translation updates that
	  didn't get picked up by my previous commit. Should have been in
	  rc1, sorry.
	* ChangeLog: Update ChangeLog's for release
	* ChangeLog: Update ChangeLog's for release
	* ChangeLog: Update ChangeLogs
	* Makefile.in, aclocal.m4, config.h.in, configure, ltconfig,
	  ltmain.sh, panel-plugin/Makefile.in: libtool update
	* AUTHORS, COPYING, INSTALL, autogen.sh, config.guess, config.sub,
	  ltconfig, ltcf-c.sh, ltmain.sh, Makefile.in, aclocal.m4, compile,
	  config.h.in, depcomp, install-sh, missing, mkinstalldirs,
	  Makefile.am, README, configure, configure.ac, m4/debug.m4,
	  m4/depends.m4, m4/i18n.m4, panel-plugin/Makefile.am,
	  panel-plugin/Makefile.in, panel-plugin/sample.c: Initial import of
	  the sample panel plugin.
	* AUTHORS, COPYING, INSTALL, autogen.sh, config.guess, config.sub,
	  ltconfig, ltcf-c.sh, ltmain.sh, Makefile.in, aclocal.m4, compile,
	  config.h.in, depcomp, install-sh, missing, mkinstalldirs,
	  Makefile.am, README, configure, configure.ac, m4/debug.m4,
	  m4/depends.m4, m4/i18n.m4, panel-plugin/Makefile.am,

Modified: xfce4-weather-plugin/trunk/ChangeLog
===================================================================
--- xfce4-weather-plugin/trunk/ChangeLog	2007-03-14 18:51:25 UTC (rev 2554)
+++ xfce4-weather-plugin/trunk/ChangeLog	2007-03-14 20:07:53 UTC (rev 2555)
@@ -1,3 +1,9 @@
+2007-03-14  Nick Schermer <nick at xfce.org>
+
+	* Hide the ebox window, so you can see the panel background.
+	* Don't crash when no icons were found.
+	* Show a "No Data" label when nothing has been configured.
+
 2007-01-19	Nick Schermer <nick at xfce.org>
 
 	* Remove line in the translations. Was a typo.
@@ -116,43 +122,43 @@
 	* update with version from Jasper - now compatible with Xfce-4.4
 
 2003-07-11	Jasper Huijsmans <jasper at xfce.org>
-       
-	* panel-plugin/sample.c: Hmm, chinese translation updates that      
-	  didn't get picked up by my previous commit. Should have been in      
-	  rc1, sorry.      
-       
+
+	* panel-plugin/sample.c: Hmm, chinese translation updates that
+	  didn't get picked up by my previous commit. Should have been in
+	  rc1, sorry.
+
 2003-07-11	Jasper Huijsmans <jasper at xfce.org>
-       
-	* ChangeLog: Update ChangeLog's for release      
-       
+
+	* ChangeLog: Update ChangeLog's for release
+
 2003-07-10	Jasper Huijsmans <jasper at xfce.org>
-       
-	* ChangeLog: Update ChangeLog's for release      
-       
+
+	* ChangeLog: Update ChangeLog's for release
+
 2003-07-06	Jasper Huijsmans <jasper at xfce.org>
-       
-	* ChangeLog: Update ChangeLogs      
-       
+
+	* ChangeLog: Update ChangeLogs
+
 2003-07-06	Jasper Huijsmans <jasper at xfce.org>
-       
-	* Makefile.in, aclocal.m4, config.h.in, configure, ltconfig,      
-	  ltmain.sh, panel-plugin/Makefile.in: libtool update      
-       
+
+	* Makefile.in, aclocal.m4, config.h.in, configure, ltconfig,
+	  ltmain.sh, panel-plugin/Makefile.in: libtool update
+
 2003-07-02	Benedikt Meurer <benny at xfce.org>
-       
-	* AUTHORS, COPYING, INSTALL, autogen.sh, config.guess, config.sub,      
-	  ltconfig, ltcf-c.sh, ltmain.sh, Makefile.in, aclocal.m4, compile,      
-	  config.h.in, depcomp, install-sh, missing, mkinstalldirs,      
-	  Makefile.am, README, configure, configure.ac, m4/debug.m4,      
-	  m4/depends.m4, m4/i18n.m4, panel-plugin/Makefile.am,      
-	  panel-plugin/Makefile.in, panel-plugin/sample.c: Initial import of      
-	  the sample panel plugin.      
-       
+
+	* AUTHORS, COPYING, INSTALL, autogen.sh, config.guess, config.sub,
+	  ltconfig, ltcf-c.sh, ltmain.sh, Makefile.in, aclocal.m4, compile,
+	  config.h.in, depcomp, install-sh, missing, mkinstalldirs,
+	  Makefile.am, README, configure, configure.ac, m4/debug.m4,
+	  m4/depends.m4, m4/i18n.m4, panel-plugin/Makefile.am,
+	  panel-plugin/Makefile.in, panel-plugin/sample.c: Initial import of
+	  the sample panel plugin.
+
 2003-07-02	Benedikt Meurer <benny at xfce.org>
-       
-	* AUTHORS, COPYING, INSTALL, autogen.sh, config.guess, config.sub,      
-	  ltconfig, ltcf-c.sh, ltmain.sh, Makefile.in, aclocal.m4, compile,      
-	  config.h.in, depcomp, install-sh, missing, mkinstalldirs,      
-	  Makefile.am, README, configure, configure.ac, m4/debug.m4,      
-	  m4/depends.m4, m4/i18n.m4, panel-plugin/Makefile.am,      
+
+	* AUTHORS, COPYING, INSTALL, autogen.sh, config.guess, config.sub,
+	  ltconfig, ltcf-c.sh, ltmain.sh, Makefile.in, aclocal.m4, compile,
+	  config.h.in, depcomp, install-sh, missing, mkinstalldirs,
+	  Makefile.am, README, configure, configure.ac, m4/debug.m4,
+	  m4/depends.m4, m4/i18n.m4, panel-plugin/Makefile.am,
 	  panel-plugin/Makefile.in, panel-plugin/sample.c: Initial revision

Modified: xfce4-weather-plugin/trunk/panel-plugin/weather-icon.c
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/weather-icon.c	2007-03-14 18:51:25 UTC (rev 2554)
+++ xfce4-weather-plugin/trunk/panel-plugin/weather-icon.c	2007-03-14 20:07:53 UTC (rev 2555)
@@ -1,7 +1,7 @@
 /*  $Id$
  *
  *  Copyright (c) 2003-2007 Xfce Development Team
- * 
+ *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  the Free Software Foundation; either version 2 of the License, or
@@ -46,13 +46,12 @@
                               THEMESDIR, G_DIR_SEPARATOR_S,
                               DEFAULT_W_THEME, G_DIR_SEPARATOR_S, number);
 
-  image = gdk_pixbuf_new_from_file_at_scale (filename,
-                                             width, height, TRUE, NULL);
+  image = gdk_pixbuf_new_from_file_at_scale (filename, width, height, TRUE, NULL);
 
+  if (G_UNLIKELY (!image))
+    g_warning ("Unable to open image: %s", filename);
+
   g_free (filename);
 
-  if (!image)
-    g_warning ("Weather Plugin: No image found");
-
   return image;
 }

Modified: xfce4-weather-plugin/trunk/panel-plugin/weather-scrollbox.c
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/weather-scrollbox.c	2007-03-14 18:51:25 UTC (rev 2554)
+++ xfce4-weather-plugin/trunk/panel-plugin/weather-scrollbox.c	2007-03-14 20:07:53 UTC (rev 2555)
@@ -1,7 +1,7 @@
 /*  $Id$
  *
  *  Copyright (c) 2003-2007 Xfce Development Team
- * 
+ *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  the Free Software Foundation; either version 2 of the License, or
@@ -359,7 +359,9 @@
         {
           lbl = (Label *) g_ptr_array_index (self->labels, i);
 
-          g_object_unref (G_OBJECT (lbl->pixmap));
+          if (lbl->pixmap)
+            g_object_unref (G_OBJECT (lbl->pixmap));
+
           g_free (lbl->msg);
         }
       g_ptr_array_free (self->labels, TRUE);
@@ -415,8 +417,6 @@
 {
   GtkScrollbox *self = (GtkScrollbox *) instance;
 
-/*      GTK_WIDGET_SET_FLAGS (GTK_WIDGET(self), GTK_NO_WINDOW);*/
-
   self->draw_timeout = 0;
   self->labels = g_ptr_array_new ();
   self->pixmap = NULL;

Modified: xfce4-weather-plugin/trunk/panel-plugin/weather-summary.c
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/weather-summary.c	2007-03-14 18:51:25 UTC (rev 2554)
+++ xfce4-weather-plugin/trunk/panel-plugin/weather-summary.c	2007-03-14 20:07:53 UTC (rev 2555)
@@ -1,7 +1,7 @@
 /*  $Id$
  *
  *  Copyright (c) 2003-2007 Xfce Development Team
- * 
+ *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  the Free Software Foundation; either version 2 of the License, or
@@ -193,16 +193,20 @@
 
   icon = get_icon (get_data_f (weatherdata, ICON_D), GTK_ICON_SIZE_DIALOG);
   icon_d = gtk_image_new_from_pixbuf (icon);
-  g_object_unref (G_OBJECT (icon));
   box_d = gtk_event_box_new ();
   gtk_container_add (GTK_CONTAINER (box_d), icon_d);
 
+  if (G_LIKELY (icon))
+    g_object_unref (G_OBJECT (icon));
+
   icon = get_icon (get_data_f (weatherdata, ICON_N), GTK_ICON_SIZE_DIALOG);
   icon_n = gtk_image_new_from_pixbuf (icon);
-  g_object_unref (G_OBJECT (icon));
   box_n = gtk_event_box_new ();
   gtk_container_add (GTK_CONTAINER (box_n), icon_n);
 
+  if (G_LIKELY (icon))
+    g_object_unref (G_OBJECT (icon));
+
   if (G_UNLIKELY (!tooltips))
     tooltips = gtk_tooltips_new ();
 
@@ -386,8 +390,10 @@
     icon = get_icon ("99", GTK_ICON_SIZE_DIALOG);
 
   gtk_window_set_icon (GTK_WINDOW (window), icon);
-  g_object_unref (G_OBJECT (icon));
 
+  if (G_LIKELY (icon))
+    g_object_unref (G_OBJECT (icon));
+
   notebook = gtk_notebook_new ();
   gtk_container_set_border_width (GTK_CONTAINER (notebook), BORDER);
   gtk_notebook_append_page (GTK_NOTEBOOK (notebook),

Modified: xfce4-weather-plugin/trunk/panel-plugin/weather.c
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/weather.c	2007-03-14 18:51:25 UTC (rev 2554)
+++ xfce4-weather-plugin/trunk/panel-plugin/weather.c	2007-03-14 20:07:53 UTC (rev 2555)
@@ -1,7 +1,7 @@
 /*  $Id$
  *
  *  Copyright (c) 2003-2007 Xfce Development Team
- * 
+ *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  the Free Software Foundation; either version 2 of the License, or
@@ -213,14 +213,19 @@
   GdkPixbuf *icon = get_icon ("99", data->iconsize);
 
   gtk_image_set_from_pixbuf (GTK_IMAGE (data->iconimage), icon);
-  g_object_unref (G_OBJECT (icon));
 
+  if (G_LIKELY (icon))
+    g_object_unref (G_OBJECT (icon));
+
   if (data->weatherdata)
     {
       xml_weather_free (data->weatherdata);
       data->weatherdata = NULL;
     }
 
+  gtk_scrollbox_set_label (GTK_SCROLLBOX (data->scrollbox), -1, "<span size=\"small\">No Data</span>");
+  gtk_scrollbox_enablecb  (GTK_SCROLLBOX (data->scrollbox), TRUE);
+
   gtk_tooltips_set_tip (data->tooltips, data->tooltipbox,
                         _("Cannot update weather data"), NULL);
 }
@@ -250,7 +255,8 @@
 
   icon = get_icon (get_data (data->weatherdata, WICON), data->iconsize);
   gtk_image_set_from_pixbuf (GTK_IMAGE (data->iconimage), icon);
-  g_object_unref (G_OBJECT (icon));
+  if (G_LIKELY (icon))
+    g_object_unref (G_OBJECT (icon));
 
   gtk_tooltips_set_tip (data->tooltips, data->tooltipbox,
                         translate_desc (get_data (data->weatherdata, TRANS)),
@@ -705,8 +711,10 @@
   icon = get_icon ("99", GTK_ICON_SIZE_SMALL);
   data->iconimage = gtk_image_new_from_pixbuf (icon);
   gtk_misc_set_alignment (GTK_MISC (data->iconimage), 0.5, 1);
-  g_object_unref (G_OBJECT (icon));
 
+  if (G_LIKELY (icon))
+    g_object_unref (G_OBJECT (icon));
+
   data->labels = g_array_new (FALSE, TRUE, sizeof (datas));
 
   vbox = gtk_vbox_new (FALSE, 0);
@@ -717,6 +725,7 @@
   data->tooltipbox = gtk_event_box_new ();
   gtk_container_add (GTK_CONTAINER (data->tooltipbox), vbox);
   gtk_widget_show_all (data->tooltipbox);
+  GTK_WIDGET_SET_FLAGS (GTK_WIDGET(data->tooltipbox), GTK_NO_WINDOW);
 
   xfce_panel_plugin_add_action_widget (plugin, data->tooltipbox);
 




More information about the Goodies-commits mailing list