Mercurial > pidgin
diff src/gtkconv.c @ 7621:bfe3a796b2c2
[gaim-migrate @ 8245]
Reverting the previous patch. Sorry, Juan.
committer: Tailor Script <tailor@pidgin.im>
| author | Christian Hammond <chipx86@chipx86.com> |
|---|---|
| date | Mon, 24 Nov 2003 03:05:16 +0000 |
| parents | 994b2d782711 |
| children | 1ffe44bb2573 |
line wrap: on
line diff
--- a/src/gtkconv.c Mon Nov 24 02:45:53 2003 +0000 +++ b/src/gtkconv.c Mon Nov 24 03:05:16 2003 +0000 @@ -895,6 +895,20 @@ } static void +menu_sendfile_cb(gpointer data, guint action, GtkWidget *widget) +{ + GaimConvWindow *win = (GaimConvWindow *)data; + GaimConversation *conv; + GaimConnection *gc; + + conv = gaim_conv_window_get_active_conversation(win); + + gc = gaim_conversation_get_gc(conv); + + gaim_prpl_ask_send_file (gc, gaim_conversation_get_name (conv)); +} + +static void menu_warn_cb(gpointer data, guint action, GtkWidget *widget) { GaimConvWindow *win = (GaimConvWindow *)data; @@ -2102,6 +2116,15 @@ gtk_widget_set_sensitive(gtkwin->menu.sendfile, FALSE); } + + if (gaim_prpl_has_send_file (gc, gaim_conversation_get_name(conv))) { + gtk_widget_show(gtkwin->menu.sendfile); + gtk_widget_set_sensitive(gtkwin->menu.sendfile, TRUE); + } else { + gtk_widget_hide(gtkwin->menu.sendfile); + gtk_widget_set_sensitive(gtkwin->menu.sendfile, FALSE); + } + /* Update the menubar */ if (gaim_conversation_get_type(conv) == GAIM_CONV_IM) { gtk_widget_show(gtkwin->menu.view_log); @@ -2963,6 +2986,9 @@ { N_("/Conversation/Send _File..."), NULL, menu_sendfile_cb, 0, "<StockItem>", GAIM_STOCK_INVITE }, + { N_("/Conversation/Send _File..."), NULL, menu_sendfile_cb, 0, + "<StockItem>", GAIM_STOCK_INVITE }, + { "/Conversation/sep2", NULL, NULL, 0, "<Separator>" }, { N_("/Conversation/Insert _URL..."), NULL, menu_insert_link_cb, 0, @@ -3055,6 +3081,10 @@ gtk_item_factory_get_widget(gtkwin->menu.item_factory, N_("/Conversation/Send File...")); + gtkwin->menu.sendfile = + gtk_item_factory_get_widget(gtkwin->menu.item_factory, + N_("/Conversation/Send File...")); + /* --- */ gtkwin->menu.insert_link =
