diff src/gtkconv.c @ 10377:a7a4db67040c

[gaim-migrate @ 11602] Removed "Show formatting toolbar," making the conversation menu affect the global pref. Use this and let me know if it makes sense or not. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Wed, 15 Dec 2004 02:17:59 +0000
parents f608b72a7611
children 9f50c31a41f9
line wrap: on
line diff
--- a/src/gtkconv.c	Wed Dec 15 01:56:10 2004 +0000
+++ b/src/gtkconv.c	Wed Dec 15 02:17:59 2004 +0000
@@ -150,8 +150,7 @@
 {
 	GaimGtkConversation *gtkconv;
 	GaimConvWindow *win = gaim_conversation_get_window(conv);
-	gboolean saveheight;
-
+	
 	if (!GTK_WIDGET_VISIBLE(w))
 		return FALSE;
 
@@ -160,9 +159,6 @@
 
 	gtkconv = GAIM_GTK_CONVERSATION(conv);
 
-	/* we only save the new height if the formatting toolbar visibility matches the pref */
-	saveheight = (gtkconv->show_formatting_toolbar == gaim_prefs_get_bool("/gaim/gtk/conversations/show_formatting_toolbar"));
-
 	/* I find that I resize the window when it has a bunch of conversations in it, mostly so that the tab bar
 	 * will fit, but then I don't want new windows taking up the entire screen.  I check to see if there is only one
 	 * conversation in the window.  This way we'll be setting new windows to the size of the last resized new window. */
@@ -172,8 +168,7 @@
 		if (w == gtkconv->imhtml && (gaim_conv_window_get_conversation_count(win) == 1))
 		{
 			gaim_prefs_set_int("/gaim/gtk/conversations/im/default_width", allocation->width);
-			if (saveheight)
-				gaim_prefs_set_int("/gaim/gtk/conversations/im/default_height", allocation->height);
+			gaim_prefs_set_int("/gaim/gtk/conversations/im/default_height", allocation->height);
 		}
 		if (w == gtkconv->entry)
 			gaim_prefs_set_int("/gaim/gtk/conversations/im/entry_height", allocation->height);
@@ -183,8 +178,7 @@
 		if (w == gtkconv->imhtml && (gaim_conv_window_get_conversation_count(win) == 1))
 		{
 			gaim_prefs_set_int("/gaim/gtk/conversations/chat/default_width", allocation->width);
-			if (saveheight)
-				gaim_prefs_set_int("/gaim/gtk/conversations/chat/default_height", allocation->height);
+			gaim_prefs_set_int("/gaim/gtk/conversations/chat/default_height", allocation->height);
 		}
 		if (w == gtkconv->entry)
 			gaim_prefs_set_int("/gaim/gtk/conversations/chat/entry_height", allocation->height);
@@ -1200,13 +1194,8 @@
 
 	gtkconv = GAIM_GTK_CONVERSATION(conv);
 
-	gtkconv->show_formatting_toolbar =
-		gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget));
-
-	if (gtkconv->show_formatting_toolbar)
-		gtk_widget_show(gtkconv->toolbar);
-	else
-		gtk_widget_hide(gtkconv->toolbar);
+	gaim_prefs_set_bool("/gaim/gtk/conversations/show_formatting_toolbar",
+			    gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget)));
 }
 
 static void
@@ -2855,7 +2844,7 @@
 
 	gtk_check_menu_item_set_active(
 			GTK_CHECK_MENU_ITEM(gtkwin->menu.show_formatting_toolbar),
-			gtkconv->show_formatting_toolbar);
+			gaim_prefs_get_bool("/gaim/gtk/conversations/show_formatting_toolbar"));
 
 	gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtkwin->menu.show_timestamps),
 				       gtkconv->show_timestamps);
@@ -3539,7 +3528,7 @@
 	{ N_("/_Options"), NULL, NULL, 0, "<Branch>" },
 	{ N_("/Options/Enable _Logging"), NULL, menu_logging_cb, 0, "<CheckItem>" },
 	{ N_("/Options/Enable _Sounds"), NULL, menu_sounds_cb, 0, "<CheckItem>" },
-	{ N_("/Options/Show Formatting _Toolbar"), NULL, menu_toolbar_cb, 0, "<CheckItem>" },
+	{ N_("/Options/Show Formatting _Toolbars"), NULL, menu_toolbar_cb, 0, "<CheckItem>" },
 	{ N_("/Options/Show T_imestamps"), "F2", menu_timestamps_cb, 0, "<CheckItem>" },
 };
 
@@ -3647,7 +3636,7 @@
 									N_("/Options/Enable Sounds"));
 	gtkwin->menu.show_formatting_toolbar =
 		gtk_item_factory_get_widget(gtkwin->menu.item_factory,
-									N_("/Options/Show Formatting Toolbar"));
+									N_("/Options/Show Formatting Toolbars"));
 	gtkwin->menu.show_timestamps =
 		gtk_item_factory_get_widget(gtkwin->menu.item_factory,
 									N_("/Options/Show Timestamps"));
@@ -4361,10 +4350,7 @@
 
 		gtkconv->make_sound = TRUE;
 
-		gtkconv->show_formatting_toolbar = gaim_prefs_get_bool(
-				"/gaim/gtk/conversations/show_formatting_toolbar");
-
-		if (gtkconv->show_formatting_toolbar)
+		if (gaim_prefs_get_bool("/gaim/gtk/conversations/show_formatting_toolbar"))
 			gtk_widget_show(gtkconv->toolbar);
 		else
 			gtk_widget_hide(gtkconv->toolbar);
@@ -5770,12 +5756,11 @@
 		win     = gaim_conversation_get_window(conv);
 		gtkwin  = GAIM_GTK_WINDOW(win);
 
-		gtkconv->show_formatting_toolbar = (gboolean)GPOINTER_TO_INT(value);
 		gtk_check_menu_item_set_active(
 				GTK_CHECK_MENU_ITEM(gtkwin->menu.show_formatting_toolbar),
-				gtkconv->show_formatting_toolbar);
-
-		if (gtkconv->show_formatting_toolbar)
+				(gboolean)GPOINTER_TO_INT(value));
+
+		if ((gboolean)GPOINTER_TO_INT(value))
 			gtk_widget_show(gtkconv->toolbar);
 		else
 			gtk_widget_hide(gtkconv->toolbar);