Author: nick Date: 2008-07-18 11:23:58 +0000 (Fri, 18 Jul 2008) New Revision: 27336
Modified: xfce4-settings/trunk/ChangeLog xfce4-settings/trunk/dialogs/appearance-settings/main.c xfce4-settings/trunk/dialogs/keyboard-settings/main.c xfce4-settings/trunk/dialogs/mouse-settings/main.c Log: * dialogs/mouse-settings/main.c, dialogs/appearance-settings/main.c: Escape the tooltip string, since Gtk+ 2.12 tree tooltips support markup which results in errors with tips like <default pointer>. * dialogs/keyboard-settings/main.c: Drop unused variables. Modified: xfce4-settings/trunk/ChangeLog =================================================================== --- xfce4-settings/trunk/ChangeLog 2008-07-18 10:30:44 UTC (rev 27335) +++ xfce4-settings/trunk/ChangeLog 2008-07-18 11:23:58 UTC (rev 27336) @@ -1,5 +1,12 @@ 2008-07-18 Nick Schermer <[EMAIL PROTECTED]> + * dialogs/mouse-settings/main.c, dialogs/appearance-settings/main.c: + Escape the tooltip string, since Gtk+ 2.12 tree tooltips support + markup which results in errors with tips like <default pointer>. + * dialogs/keyboard-settings/main.c: Drop unused variables. + +2008-07-18 Nick Schermer <[EMAIL PROTECTED]> + * xfce4-settings-helper/accessibility.c: Improve the code a bit and calculate the max_speed and time_to_max using the interval, so the user can set a speed in pixels/sec and time in msec. Modified: xfce4-settings/trunk/dialogs/appearance-settings/main.c =================================================================== --- xfce4-settings/trunk/dialogs/appearance-settings/main.c 2008-07-18 10:30:44 UTC (rev 27335) +++ xfce4-settings/trunk/dialogs/appearance-settings/main.c 2008-07-18 11:23:58 UTC (rev 27336) @@ -216,6 +216,7 @@ gchar *index_filename; const gchar *theme_name; const gchar *theme_comment; + gchar *comment_escaped; gchar *active_theme_name; gint i; GSList *check_list = NULL; @@ -264,13 +265,19 @@ theme_name = xfce_rc_read_entry (index_file, "Name", file); theme_comment = xfce_rc_read_entry (index_file, "Comment", NULL); + /* Escape the comment, since tooltips are markup, not text */ + comment_escaped = theme_comment ? g_markup_escape_text (theme_comment, -1) : NULL; + /* Append icon theme to the list store */ gtk_list_store_append (list_store, &iter); gtk_list_store_set (list_store, &iter, COLUMN_THEME_NAME, file, COLUMN_THEME_DISPLAY_NAME, theme_name, - COLUMN_THEME_COMMENT, theme_comment, -1); + COLUMN_THEME_COMMENT, comment_escaped, -1); + /* Cleanup */ + g_free (comment_escaped); + /* Check if this is the active theme, if so, select it */ if (G_UNLIKELY (g_utf8_collate (theme_name, active_theme_name) == 0)) { @@ -322,6 +329,7 @@ const gchar *theme_comment; gchar *active_theme_name; gchar *gtkrc_filename; + gchar *comment_escaped; gint i; GSList *check_list = NULL; @@ -367,6 +375,9 @@ /* Get translated ui theme name and comment */ theme_name = xfce_rc_read_entry (index_file, "Name", file); theme_comment = xfce_rc_read_entry (index_file, "Comment", NULL); + + /* Escape the comment because tooltips are markup, not text */ + comment_escaped = theme_comment ? g_markup_escape_text (theme_comment, -1) : NULL; /* Close theme index file */ xfce_rc_close (index_file); @@ -375,7 +386,7 @@ { /* Set defaults */ theme_name = file; - theme_comment = NULL; + comment_escaped = NULL; } /* Append ui theme to the list store */ @@ -383,7 +394,10 @@ gtk_list_store_set (list_store, &iter, COLUMN_THEME_NAME, file, COLUMN_THEME_DISPLAY_NAME, theme_name, - COLUMN_THEME_COMMENT, theme_comment, -1); + COLUMN_THEME_COMMENT, comment_escaped, -1); + + /* Cleanup */ + g_free (comment_escaped); /* Check if this is the active theme, if so, select it */ if (G_UNLIKELY (g_utf8_collate (theme_name, active_theme_name) == 0)) Modified: xfce4-settings/trunk/dialogs/keyboard-settings/main.c =================================================================== --- xfce4-settings/trunk/dialogs/keyboard-settings/main.c 2008-07-18 10:30:44 UTC (rev 27335) +++ xfce4-settings/trunk/dialogs/keyboard-settings/main.c 2008-07-18 11:23:58 UTC (rev 27336) @@ -155,12 +155,9 @@ const gchar *shortcut, struct TreeViewInfo *info) { - GtkTreeSelection *selection; - GtkTreeModel *model; - GtkTreeIter iter; - gboolean shortcut_accepted = TRUE; - gchar *current_shortcut; - gchar *property; + gboolean shortcut_accepted = TRUE; + gchar *current_shortcut; + gchar *property; /* Ignore raw 'Return' and 'space' since that may have been used to activate the shortcut row */ if (G_UNLIKELY (g_utf8_collate (shortcut, "Return") == 0 || g_utf8_collate (shortcut, "space") == 0)) Modified: xfce4-settings/trunk/dialogs/mouse-settings/main.c =================================================================== --- xfce4-settings/trunk/dialogs/mouse-settings/main.c 2008-07-18 10:30:44 UTC (rev 27335) +++ xfce4-settings/trunk/dialogs/mouse-settings/main.c 2008-07-18 11:23:58 UTC (rev 27336) @@ -819,8 +819,8 @@ /* filter out the pointer devices */ if (device_info->use == IsXExtensionPointer) { - /* get the device name */ - display_name = g_strdup (device_info->name); + /* get the device name, escaped */ + display_name = g_markup_escape_text (device_info->name, -1); /* get rid of usb crap in the name */ if ((usb = strstr (display_name, "-usb")) != NULL) _______________________________________________ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits