Mercurial > pidgin
comparison src/gtkimhtml.c @ 13335:d04cfb5fa85b
[gaim-migrate @ 15705]
add a "Clear formatting" option to the right-click menu of IMHTMLs
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Mon, 27 Feb 2006 15:58:27 +0000 |
parents | 2f6c932e5742 |
children | d46a27d29eed |
comparison
equal
deleted
inserted
replaced
13334:99d081c638f6 | 13335:d04cfb5fa85b |
---|---|
807 | 807 |
808 gtk_clipboard_request_text(clipboard, paste_plaintext_received_cb, imhtml); | 808 gtk_clipboard_request_text(clipboard, paste_plaintext_received_cb, imhtml); |
809 | 809 |
810 } | 810 } |
811 | 811 |
812 | 812 static void clear_formatting_cb(GtkMenuItem *menu, GtkIMHtml *imhtml) |
813 { | |
814 gtk_imhtml_clear_formatting(imhtml); | |
815 } | |
813 | 816 |
814 static void hijack_menu_cb(GtkIMHtml *imhtml, GtkMenu *menu, gpointer data) | 817 static void hijack_menu_cb(GtkIMHtml *imhtml, GtkMenu *menu, gpointer data) |
815 { | 818 { |
816 GtkWidget *menuitem; | 819 GtkWidget *menuitem; |
817 | 820 |
824 /* put it after "Paste" */ | 827 /* put it after "Paste" */ |
825 gtk_menu_shell_insert(GTK_MENU_SHELL(menu), menuitem, 3); | 828 gtk_menu_shell_insert(GTK_MENU_SHELL(menu), menuitem, 3); |
826 | 829 |
827 g_signal_connect(G_OBJECT(menuitem), "activate", | 830 g_signal_connect(G_OBJECT(menuitem), "activate", |
828 G_CALLBACK(paste_unformatted_cb), imhtml); | 831 G_CALLBACK(paste_unformatted_cb), imhtml); |
832 | |
833 /* XXX: make this new with mnemonic, and HIG-happy after string thaw */ | |
834 menuitem = gtk_menu_item_new_with_label(_("Clear formatting")); | |
835 gtk_widget_show(menuitem); | |
836 /* put it after Delete */ | |
837 gtk_menu_shell_insert(GTK_MENU_SHELL(menu), menuitem, 5); | |
838 | |
839 g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(clear_formatting_cb), imhtml); | |
829 } | 840 } |
830 | 841 |
831 static char * | 842 static char * |
832 ucs2_order(gboolean swap) | 843 ucs2_order(gboolean swap) |
833 { | 844 { |