changeset 12836:339d61ebca8a

[gaim-migrate @ 15184] Revert the extra portion of my last commit that snuck in because I committed from the wrong tree. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Wed, 11 Jan 2006 23:18:52 +0000
parents 6a81da55d4d4
children 1096bdfef887
files src/gtkimhtml.c
diffstat 1 files changed, 4 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkimhtml.c	Wed Jan 11 22:55:38 2006 +0000
+++ b/src/gtkimhtml.c	Wed Jan 11 23:18:52 2006 +0000
@@ -809,42 +809,18 @@
 
 }
 
-static void fix_popup_menu_item_cb(GtkWidget *widget, gpointer data)
-{
-	gpointer *more_data = data;
-	int *count = more_data[0];
-	GtkIMHtml *imhtml = more_data[1];
-
-	/* Destroy all items except Copy and Select All, if the text isn't editable. */
-	if (!imhtml->editable && *count != 1 && *count != 5)
-	{
-		gtk_widget_destroy(widget);
-	}
-	else if (*count == 5 && gtk_text_buffer_get_char_count(imhtml->text_buffer) == 0)
-	{
-		/* There is no text in the buffer, so Select All should be insensitive. */
-		gtk_widget_set_sensitive(widget, FALSE);
-	}
-
-	(*count)++;
-}
+
 
 static void hijack_menu_cb(GtkIMHtml *imhtml, GtkMenu *menu, gpointer data)
 {
-	int count = 0;
-	gpointer more_data[2] = {&count, imhtml};
 	GtkWidget *menuitem;
 
-	gtk_container_foreach(GTK_CONTAINER(menu), fix_popup_menu_item_cb, more_data);
-
-	if (!imhtml->editable)
-		return;
-
 	menuitem = gtk_menu_item_new_with_mnemonic(_("Paste as Plain _Text"));
 	gtk_widget_show(menuitem);
 	gtk_widget_set_sensitive(menuitem,
-	                         (gtk_clipboard_wait_is_text_available(
-	                          gtk_widget_get_clipboard(GTK_WIDGET(imhtml), GDK_SELECTION_CLIPBOARD))));
+	                        (imhtml->editable &&
+	                        gtk_clipboard_wait_is_text_available(
+	                        gtk_widget_get_clipboard(GTK_WIDGET(imhtml), GDK_SELECTION_CLIPBOARD))));
 	/* put it after "Paste" */
 	gtk_menu_shell_insert(GTK_MENU_SHELL(menu), menuitem, 3);