changeset 28937:3a055fbe806b

Kill the use of the GNOME document font and the prefs to override it. The font can be set via the theme control plugin. This makes the Themes and Sounds tabs the tallest, and I believe I've accomplished my initial goal of fitting on the shorter screens for netbooks.
author John Bailey <rekkanoryo@rekkanoryo.org>
date Sun, 15 Nov 2009 20:34:26 +0000
parents 1c892675f054
children 8aa202c3a5aa
files pidgin/gtkconv.c pidgin/gtkprefs.c pidgin/gtkutils.c
diffstat 3 files changed, 1 insertions(+), 51 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkconv.c	Thu Nov 12 04:09:36 2009 +0000
+++ b/pidgin/gtkconv.c	Sun Nov 15 20:34:26 2009 +0000
@@ -7931,9 +7931,6 @@
 	purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/tab_side", GTK_POS_TOP);
 	purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/scrollback_lines", 4000);
 
-	purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/use_theme_font", TRUE);
-	purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/custom_font", "");
-
 	/* Conversations -> Chat */
 	purple_prefs_add_none(PIDGIN_PREFS_ROOT "/conversations/chat");
 	purple_prefs_add_int(PIDGIN_PREFS_ROOT "/conversations/chat/entry_height", 54);
--- a/pidgin/gtkprefs.c	Thu Nov 12 04:09:36 2009 +0000
+++ b/pidgin/gtkprefs.c	Sun Nov 15 20:34:26 2009 +0000
@@ -1660,28 +1660,6 @@
 		PIDGIN_PREFS_ROOT "/conversations/minimum_entry_lines",
 		1, 8, NULL);
 
-#if GTK_CHECK_VERSION(2,4,0)
-	vbox = pidgin_make_frame(ret, _("Font"));
-	if (purple_running_gnome())
-		fontpref = pidgin_prefs_checkbox(_("Use document font from _theme"), PIDGIN_PREFS_ROOT "/conversations/use_theme_font", vbox);
-	else
-		fontpref = pidgin_prefs_checkbox(_("Use font from _theme"), PIDGIN_PREFS_ROOT "/conversations/use_theme_font", vbox);
-
-	font_name = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/custom_font");
-	if ((font_name == NULL) || (*font_name == '\0')) {
-		font_button = gtk_font_button_new();
-	} else {
-		font_button = gtk_font_button_new_with_font(font_name);
-	}
-
-	gtk_font_button_set_show_style(GTK_FONT_BUTTON(font_button), TRUE);
-	hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Conversation _font:"), NULL, font_button, FALSE, NULL);
-	if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/use_theme_font"))
-		gtk_widget_set_sensitive(hbox, FALSE);
-	g_signal_connect(G_OBJECT(fontpref), "clicked", G_CALLBACK(pidgin_toggle_sensitive), hbox);
-	g_signal_connect(G_OBJECT(font_button), "font-set", G_CALLBACK(pidgin_custom_font_set), NULL);
-#endif
-
 	vbox = pidgin_make_frame(ret, _("Default Formatting"));
 	gtk_box_set_child_packing(GTK_BOX(vbox->parent), vbox, TRUE, TRUE, 0, GTK_PACK_START);
 
@@ -3071,6 +3049,7 @@
 	purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_bgcolor");
 	purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_fgcolor");
 	purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_font");
+	purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/custom_font");
 	purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_size");
 	purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/old_tab_complete");
 	purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/tab_completion");
--- a/pidgin/gtkutils.c	Thu Nov 12 04:09:36 2009 +0000
+++ b/pidgin/gtkutils.c	Sun Nov 15 20:34:26 2009 +0000
@@ -105,7 +105,6 @@
 void
 pidgin_setup_imhtml(GtkWidget *imhtml)
 {
-	PangoFontDescription *desc = NULL;
 	g_return_if_fail(imhtml != NULL);
 	g_return_if_fail(GTK_IS_IMHTML(imhtml));
 
@@ -113,31 +112,6 @@
 
 	gtk_imhtml_set_funcs(GTK_IMHTML(imhtml), &gtkimhtml_cbs);
 
-	if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/use_theme_font")) {
-		const char *font = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/custom_font");
-		desc = pango_font_description_from_string(font);
-	} else if (purple_running_gnome()) {
-		/* Use the GNOME "document" font, if applicable */
-		char *path;
-
-		if ((path = g_find_program_in_path("gconftool-2"))) {
-			char *font = NULL;
-			char *err = NULL;
-			g_free(path);
-			if (g_spawn_command_line_sync(
-					"gconftool-2 -g /desktop/gnome/interface/document_font_name",
-					&font, &err, NULL, NULL)) {
-				desc = pango_font_description_from_string(font);
-			}
-			g_free(err);
-			g_free(font);
-		}
-	}
-
-	if (desc) {
-		gtk_widget_modify_font(imhtml, desc);
-		pango_font_description_free(desc);
-	}
 }
 
 static