[monkey-bubble: 706/753] the output of strftime is not in utf8 so convert it



commit 45f2d5198057a9c4dafd11bda3904b527199fddd
Author: George Lebl <jirka 5z com>
Date:   Thu Dec 27 01:27:07 2001 +0000

    the output of strftime is not in utf8 so convert it
    
    Wed Dec 26 17:56:25 2001  George Lebl <jirka 5z com>
    
    	* gnome-scroes.c, gnome-dateedit.c: the output of strftime is
    	  not in utf8 so convert it
    
    	* gnome-pixmap-entry.c: a bit of cleanup and remove race where
    	  you could get two preview frames if you pressed the browse
    	  button twice
    
    	* gnome-scores.c: when setting font use pango, we can't use
    	  gdk_fontset_load as that's deprecated, and this is non-deprecated
    	  api.
    
    	* Makefile.am, gnome-about.c, gnome-app-helper.c, gnome-app-util.c,
    	  gnome-color-picker.c, gnome-dateedit.c, gnome-dialog.c,
    	  gnome-druid-page-edge.c, gnome-druid-page-standard.c,
    	  gnome-file-entry.c, gnome-href.c, gnome-ice.c, gnome-icon-entry.c,
    	  gnome-icon-list.c, gnome-icon-sel.c, gnome-pixmap-entry.c,
    	  gnome-pixmap.c, gnome-scores.c, gnome-stock-icons.c,
    	  gnome-vfs-util.c:  Compile with G_DISABLE_DEPRECATED,
    	  GDK_DISABLE_DEPRECATED and GDK_PIXBUF_DISABLE_DEPRECATED, yay!

 libgnomeui/gnome-scores.c |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)
---
diff --git a/libgnomeui/gnome-scores.c b/libgnomeui/gnome-scores.c
index f7aeea8..f35ae74 100644
--- a/libgnomeui/gnome-scores.c
+++ b/libgnomeui/gnome-scores.c
@@ -178,6 +178,8 @@ gnome_scores_construct (  GnomeScores *gs,
 	gs->_priv->label_times  = g_malloc(sizeof(GtkWidget*) * n_scores);
 
 	for(i=0; i < n_scores; i++) {
+		char *str_utf8;
+
 		gs->_priv->label_names[i] = gtk_label_new ( names[i] );
 		gtk_widget_show ( gs->_priv->label_names[i] );
 		gtk_table_attach_defaults ( gs->_priv->table, gs->_priv->label_names[i], 0, 1, i+1, i+2);
@@ -202,7 +204,10 @@ gnome_scores_construct (  GnomeScores *gs,
 			strcpy(tmp2, "???");
 		}
 		tmp2[sizeof(tmp2)-1] = '\0'; /* just for sanity */
-		gs->_priv->label_times[i] = gtk_label_new ( tmp2 );
+
+		str_utf8 = g_locale_to_utf8 (tmp2, -1, NULL, NULL, NULL);
+		gs->_priv->label_times[i] = gtk_label_new (str_utf8 ? str_utf8 : "");
+		g_free (str_utf8);
 		gtk_widget_show ( gs->_priv->label_times[i] );
 		gtk_table_attach_defaults ( gs->_priv->table, gs->_priv->label_times[i], 2, 3, i+1, i+2);
   	}
@@ -387,8 +392,7 @@ gnome_scores_set_logo_label (GnomeScores *gs,
 {
 	GtkStyle *s = gtk_style_new(); /* i believe that i should copy the default style
 					  and change only the fg & font fields, how? */
-	GdkFont *f;
-	const gchar *fo;
+	PangoFontDescription *font_desc;
 
 	g_return_if_fail(gs != NULL);
 	g_return_if_fail(GNOME_IS_SCORES(gs));
@@ -401,13 +405,13 @@ gnome_scores_set_logo_label (GnomeScores *gs,
 	if(col)
 		s->fg[0] = *col;
 
-	if( font ) 
-		fo = font;
-	else 
-		fo = _("-freefont-garamond-*-*-*-*-30-170-*-*-*-*-*-*,*-r-*");
-
-	if(( f = gdk_fontset_load ( fo ) ))
-		gtk_style_set_font(s, f);
+	font_desc = NULL;
+	if (font != NULL)
+		font_desc = pango_font_description_from_string (font);
+	if (font_desc == NULL)
+		font_desc = pango_font_description_from_string (_("Sans 14"));
+	if (font_desc != NULL)
+		s->font_desc = font_desc;
 
 	gs->_priv->logo = gtk_label_new(txt);
 	gtk_widget_set_style(GTK_WIDGET(gs->_priv->logo), s);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]