[Goodies-commits] r2821 - in xfce4-weather-plugin/trunk: . icons icons/48x48 icons/liquid panel-plugin po

Jean-François Wauthy pollux at xfce.org
Mon Jun 11 09:27:40 CEST 2007


Author: pollux
Date: 2007-06-11 07:27:40 +0000 (Mon, 11 Jun 2007)
New Revision: 2821

Modified:
   xfce4-weather-plugin/trunk/
   xfce4-weather-plugin/trunk/icons/
   xfce4-weather-plugin/trunk/icons/48x48/
   xfce4-weather-plugin/trunk/icons/liquid/
   xfce4-weather-plugin/trunk/panel-plugin/
   xfce4-weather-plugin/trunk/panel-plugin/weather-search.c
   xfce4-weather-plugin/trunk/panel-plugin/weather.c
   xfce4-weather-plugin/trunk/po/
Log:
* update svn:ignore property
* improve search dialog using XfceTitledDialog
* using 'adaptive' text size for the 'No Data' message




Property changes on: xfce4-weather-plugin/trunk
___________________________________________________________________
Name: svn:ignore
   + configure
Makefile.in
config.log
depcomp
compile
config.guess
config.h
config.sub
intltool-merge
intltool-extract
Makefile
mkinstalldirs
intltool-extract.in
intltool-update
configure.in
config.status
intltool-update.in
stamp-h1
config.h.in
autom4te.cache
intltool-merge.in
missing
aclocal.m4
install-sh




Property changes on: xfce4-weather-plugin/trunk/icons
___________________________________________________________________
Name: svn:ignore
   + Makefile
Makefile.in




Property changes on: xfce4-weather-plugin/trunk/icons/48x48
___________________________________________________________________
Name: svn:ignore
   + Makefile
Makefile.in




Property changes on: xfce4-weather-plugin/trunk/icons/liquid
___________________________________________________________________
Name: svn:ignore
   + Makefile
Makefile.in




Property changes on: xfce4-weather-plugin/trunk/panel-plugin
___________________________________________________________________
Name: svn:ignore
   + Makefile.in
xfce4-weather-plugin
.deps
Makefile
weather.desktop



Modified: xfce4-weather-plugin/trunk/panel-plugin/weather-search.c
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/weather-search.c	2007-06-11 04:43:50 UTC (rev 2820)
+++ xfce4-weather-plugin/trunk/panel-plugin/weather-search.c	2007-06-11 07:27:40 UTC (rev 2821)
@@ -23,6 +23,8 @@
 
 #include <string.h>
 
+#include <libxfcegui4/libxfcegui4.h>
+
 #include "weather-parsers.h"
 #include "weather-data.h"
 #include "weather.h"
@@ -178,7 +180,7 @@
                       gchar     *proxy_host,
                       gint       proxy_port)
 {
-  GtkWidget         *vbox, *label, *button, *hbox, *scroll, *frame;
+  GtkWidget         *vbox, *button, *hbox, *scroll, *frame;
   GtkTreeViewColumn *column;
   GtkCellRenderer   *renderer = gtk_cell_renderer_text_new ();
   search_dialog     *dialog;
@@ -192,11 +194,11 @@
     return NULL;
 
   dialog->dialog =
-    gtk_dialog_new_with_buttons (_("Search weather location code"), parent,
-                                 GTK_DIALOG_MODAL |
-                                 GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_OK,
-                                 GTK_RESPONSE_ACCEPT, GTK_STOCK_CANCEL,
-                                 GTK_RESPONSE_REJECT, NULL);
+    xfce_titled_dialog_new_with_buttons (_("Search weather location code"), parent,
+						GTK_DIALOG_MODAL |
+						GTK_DIALOG_DESTROY_WITH_PARENT, 
+						GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
+						GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL);
 
   gtk_window_set_icon_name (GTK_WINDOW (dialog->dialog), GTK_STOCK_FIND);
 
@@ -205,9 +207,8 @@
   gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog->dialog)->vbox), vbox,
                       TRUE, TRUE, 0);
 
-  label = gtk_label_new (_("Enter a city name or zip code:"));
-  gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
-  gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+  xfce_titled_dialog_set_subtitle (XFCE_TITLED_DIALOG (dialog->dialog), 
+				   _("Enter a city name or zip code"));
 
   hbox = gtk_hbox_new (FALSE, BORDER);
   gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
@@ -239,7 +240,7 @@
                     G_CALLBACK (pass_search_results), dialog->dialog);
   gtk_container_add (GTK_CONTAINER (scroll), dialog->result_list);
 
-  gtk_widget_set_size_request (dialog->dialog, 350, 250);
+  gtk_widget_set_size_request (dialog->dialog, 425, 250);
 
   return dialog;
 }

Modified: xfce4-weather-plugin/trunk/panel-plugin/weather.c
===================================================================
--- xfce4-weather-plugin/trunk/panel-plugin/weather.c	2007-06-11 04:43:50 UTC (rev 2820)
+++ xfce4-weather-plugin/trunk/panel-plugin/weather.c	2007-06-11 07:27:40 UTC (rev 2821)
@@ -206,16 +206,34 @@
 static void
 set_icon_error (xfceweather_data *data)
 {
-  GdkPixbuf *icon;
-  gint       height;
+  GdkPixbuf   *icon;
+  gint         height;
+  gint         size;
+  gchar       *str;
+  const gchar *txtsize;
 
+  size = data->size;
+
   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>");
+  /* arbitrary, choose something that works */
+  if (size > 36)
+    txtsize = "medium";
+  else if (size > 30)
+    txtsize = "small";
+  else if (size > 24)
+    txtsize = "x-small";
+  else
+    txtsize = "xx-small";
+
+  str = g_strdup_printf ("<span size=\"%s\">No Data</span>", txtsize);
+  gtk_scrollbox_set_label (GTK_SCROLLBOX (data->scrollbox), -1, str);
+  g_free (str);
+
   gtk_scrollbox_enablecb  (GTK_SCROLLBOX (data->scrollbox), TRUE);
   
   gtk_widget_get_size_request (data->scrollbox, NULL, &height);


Property changes on: xfce4-weather-plugin/trunk/po
___________________________________________________________________
Name: svn:ignore
   + *gmo
Makefile.in
Makefile.in.in
stamp-it
Makefile
.intltool-merge-cache
POTFILES






More information about the Goodies-commits mailing list