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

Colin Leroy colin at xfce.org
Sat Jun 13 09:35:18 CEST 2009


Author: colin
Date: 2009-06-13 07:35:18 +0000 (Sat, 13 Jun 2009)
New Revision: 7546

Modified:
   xfce4-weather-plugin/trunk/ChangeLog
   xfce4-weather-plugin/trunk/panel-plugin/weather.c
Log:
2009-06-13	Colin Leroy <colin at colino.net>

	* panel-plugin/weather.c: fix bug #4642, "Change Location of 
	Text / Format". The location part was already fixed (bug #5442),
	this removes the "T:" or similar prefix when there's only one value
	to display.



Modified: xfce4-weather-plugin/trunk/ChangeLog
===================================================================
--- xfce4-weather-plugin/trunk/ChangeLog	2009-06-13 07:28:23 UTC (rev 7545)
+++ xfce4-weather-plugin/trunk/ChangeLog	2009-06-13 07:35:18 UTC (rev 7546)
@@ -1,5 +1,12 @@
 2009-06-13	Colin Leroy <colin at colino.net>
 
+	* panel-plugin/weather.c: fix bug #4642, "Change Location of 
+	Text / Format". The location part was already fixed (bug #5442),
+	this removes the "T:" or similar prefix when there's only one value
+	to display.
+
+2009-06-13	Colin Leroy <colin at colino.net>
+
 	* panel-plugin/weather-translate.c: fix bug #3818, "weekdays in 
 	Russian are displayed ugly in forecast tab". First patch fixes a
 	too short buffer (by Sergey Otinov), second patch checks whether

Modified: xfce4-weather-plugin/trunk/panel-plugin/weather.c
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/weather.c	2009-06-13 07:28:23 UTC (rev 7545)
+++ xfce4-weather-plugin/trunk/panel-plugin/weather.c	2009-06-13 07:35:18 UTC (rev 7546)
@@ -89,7 +89,8 @@
             datas          opt,
             units          unit,
             gint           size,
-	    GtkOrientation orientation)
+	    GtkOrientation orientation,
+	    gboolean       multiple_labels)
 {
 
   gchar       *str, *value;
@@ -167,19 +168,31 @@
     }
 
 
-
-  if (value != NULL)
-    {
-      str = g_strdup_printf ("<span size=\"%s\">%s: %s</span>",
-                             txtsize, lbl, value);
-      g_free (value);
-    }
-  else
-    {
-      str = g_strdup_printf ("<span size=\"%s\">%s: %s %s</span>",
-                             txtsize, lbl, rawvalue, get_unit (unit, opt));
-    }
-
+  if (multiple_labels) {
+    if (value != NULL)
+      {
+	str = g_strdup_printf ("<span size=\"%s\">%s: %s</span>",
+                               txtsize, lbl, value);
+	g_free (value);
+      }
+    else
+      {
+	str = g_strdup_printf ("<span size=\"%s\">%s: %s %s</span>",
+                               txtsize, lbl, rawvalue, get_unit (unit, opt));
+      }
+  } else {
+    if (value != NULL)
+      {
+	str = g_strdup_printf ("<span size=\"%s\">%s</span>",
+                               txtsize, value);
+	g_free (value);
+      }
+    else
+      {
+	str = g_strdup_printf ("<span size=\"%s\">%s %s</span>",
+                               txtsize, rawvalue, get_unit (unit, opt));
+      }
+  }
   return str;
 }
 
@@ -254,7 +267,7 @@
     {
       opt = g_array_index (data->labels, datas, i);
 
-      str = make_label (data->weatherdata, opt, data->unit, data->size, data->orientation);
+      str = make_label (data->weatherdata, opt, data->unit, data->size, data->orientation, (data->labels->len > 1));
 
       gtk_scrollbox_set_label (GTK_SCROLLBOX (data->scrollbox), -1, str);
 




More information about the Goodies-commits mailing list