changeset 22861:5451ce45eeb3

merge of 'ab4c3777bebccd93ded5d7e6886514e95603f51a' and 'cc84ce5643c451b4a6d379e839e7c7531cabd9ee'
author Richard Laager <rlaager@wiktel.com>
date Sat, 10 May 2008 09:24:58 +0000
parents a85fcc0c0248 (current diff) 36c3f901480d (diff)
children f5d39c44465a 5513f1f5f4bc 2c6fb4d5cea2
files
diffstat 2 files changed, 4 insertions(+), 52 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat May 10 08:49:22 2008 +0000
+++ b/ChangeLog	Sat May 10 09:24:58 2008 +0000
@@ -39,9 +39,6 @@
 	  lines.
 	* Moved the "Local alias" field in the Modify Account dialog to be below
 	  the "User Options" heading on the "Basic" tab.
-	* The formatting toolbar will now respect your system-wide GTK+ toolbar
-	  setting (to the extent possible with our two choices).  You can still
-	  override it by right-clicking on the formatting toolbar.
 
 	General:
 	* The configure script now dies on more absent dependencies.  The
--- a/pidgin/gtkimhtmltoolbar.c	Sat May 10 08:49:22 2008 +0000
+++ b/pidgin/gtkimhtmltoolbar.c	Sat May 10 09:24:58 2008 +0000
@@ -42,48 +42,11 @@
 #include <gdk/gdkkeysyms.h>
 
 static GtkHBoxClass *parent_class = NULL;
-static GtkSettings *settings = NULL;
 
 static void toggle_button_set_active_block(GtkToggleButton *button,
 										   gboolean is_active,
 										   GtkIMHtmlToolbar *toolbar);
 
-static gboolean get_gtk_wide(void);
-
-/* If we're not overriding GTK+, grab its potentially new default and use that. */
-static void toolbar_style_changed_cb(GObject *obj, GParamSpec *pspec, gpointer data)
-{
-	/* If we're not overriding GTK+, grab its potentially new default and use that.
-	 * Otherwise, if the potentially new default matches the user's setting, we
-	 * no longer want to override. */
-        if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/toolbar/override_gtk"))
-        {
-                purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/toolbar/wide",
-                                get_gtk_wide());
-        }
-	else
-	{
-		gboolean gtk_wide = get_gtk_wide();
-		gboolean pidgin_wide = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/toolbar/wide");
-		purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/toolbar/override_gtk", (gtk_wide != pidgin_wide));
-	}
-}
-
-static gboolean get_gtk_wide()
-{
-	gint style;
-
-	if (settings == NULL)
-	{
-		settings = gtk_settings_get_default();
-		g_signal_connect(settings, "notify::gtk-toolbar-style",
-		                 G_CALLBACK(toolbar_style_changed_cb), NULL);
-	}
-
-	g_object_get(settings, "gtk-toolbar-style", &style, NULL);
-
-	return (style == GTK_TOOLBAR_ICONS);
-}
 
 static void do_bold(GtkWidget *bold, GtkIMHtmlToolbar *toolbar)
 {
@@ -1070,16 +1033,10 @@
 }
 
 static void
-switch_toolbar_view(GtkWidget *item, gpointer data)
+switch_toolbar_view(GtkWidget *item, GtkIMHtmlToolbar *toolbar)
 {
-	gboolean gtk_wide;    /* The current GTK+ default. */
-	gboolean pidgin_wide; /* The desired Pidgin setting. */
-
-	gtk_wide = get_gtk_wide();
-	pidgin_wide = !purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/toolbar/wide");
-
-	purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/toolbar/override_gtk", (gtk_wide != pidgin_wide));
-	purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/toolbar/wide", pidgin_wide);
+	purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/toolbar/wide",
+			!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/toolbar/wide"));
 }
 
 static gboolean
@@ -1096,7 +1053,7 @@
 
 	menu = gtk_menu_new();
 	item = gtk_menu_item_new_with_mnemonic(wide ? _("Group Items") : _("Ungroup Items"));
-	g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(switch_toolbar_view), NULL);
+	g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(switch_toolbar_view), toolbar);
 	gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
 	gtk_widget_show(item);
 
@@ -1117,7 +1074,6 @@
 
 	purple_prefs_add_none(PIDGIN_PREFS_ROOT "/conversations/toolbar");
 	purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/toolbar/wide", FALSE);
-	purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/toolbar/override_gtk", FALSE);
 }
 
 static void gtk_imhtmltoolbar_create_old_buttons(GtkIMHtmlToolbar *toolbar)
@@ -1357,7 +1313,6 @@
 	g_object_set_data(G_OBJECT(hbox), "lean-view", box);
 	gtk_widget_show(box);
 
-	toolbar_style_changed_cb(NULL, NULL, NULL);
 	purple_prefs_connect_callback(toolbar, PIDGIN_PREFS_ROOT "/conversations/toolbar/wide",
 			imhtmltoolbar_view_pref_changed, toolbar);
 	g_signal_connect_data(G_OBJECT(toolbar), "realize",