comparison src/gtkconv.c @ 7619:994b2d782711

[gaim-migrate @ 8243] Juan Pablo Mendoza made file sending a little more generic, UI-wise, and added drag-and-drop file sending, as well as a Send File in the conversation menu. Congrats Juan on the $400 bounty. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 24 Nov 2003 02:35:27 +0000
parents 59c1cee97cbb
children bfe3a796b2c2
comparison
equal deleted inserted replaced
7618:53e38b1ce00a 7619:994b2d782711
879 879
880 invite_cb(NULL, conv); 880 invite_cb(NULL, conv);
881 } 881 }
882 882
883 static void 883 static void
884 menu_sendfile_cb(gpointer data, guint action, GtkWidget *widget)
885 {
886 GaimConvWindow *win = (GaimConvWindow *)data;
887 GaimConversation *conv;
888 GaimConnection *gc;
889
890 conv = gaim_conv_window_get_active_conversation(win);
891
892 gc = gaim_conversation_get_gc(conv);
893
894 gaim_prpl_ask_send_file (gc, gaim_conversation_get_name (conv));
895 }
896
897 static void
884 menu_warn_cb(gpointer data, guint action, GtkWidget *widget) 898 menu_warn_cb(gpointer data, guint action, GtkWidget *widget)
885 { 899 {
886 GaimConvWindow *win = (GaimConvWindow *)data; 900 GaimConvWindow *win = (GaimConvWindow *)data;
887 GaimConversation *conv; 901 GaimConversation *conv;
888 902
2077 if (gc != NULL) { 2091 if (gc != NULL) {
2078 gtk_widget_set_sensitive(gtkwin->menu.insert_link, TRUE); 2092 gtk_widget_set_sensitive(gtkwin->menu.insert_link, TRUE);
2079 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); 2093 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl);
2080 } 2094 }
2081 2095
2096
2097 if (gaim_prpl_has_send_file (gc, gaim_conversation_get_name(conv))) {
2098 gtk_widget_show(gtkwin->menu.sendfile);
2099 gtk_widget_set_sensitive(gtkwin->menu.sendfile, TRUE);
2100 } else {
2101 gtk_widget_hide(gtkwin->menu.sendfile);
2102 gtk_widget_set_sensitive(gtkwin->menu.sendfile, FALSE);
2103 }
2104
2082 /* Update the menubar */ 2105 /* Update the menubar */
2083 if (gaim_conversation_get_type(conv) == GAIM_CONV_IM) { 2106 if (gaim_conversation_get_type(conv) == GAIM_CONV_IM) {
2084 gtk_widget_show(gtkwin->menu.view_log); 2107 gtk_widget_show(gtkwin->menu.view_log);
2085 2108
2086 if (gc && prpl_info->options & OPT_PROTO_IM_IMAGE) { 2109 if (gc && prpl_info->options & OPT_PROTO_IM_IMAGE) {
2935 { N_("/Conversation/_Get Info..."), NULL, menu_get_info_cb, 0, 2958 { N_("/Conversation/_Get Info..."), NULL, menu_get_info_cb, 0,
2936 "<StockItem>", GAIM_STOCK_INFO }, 2959 "<StockItem>", GAIM_STOCK_INFO },
2937 { N_("/Conversation/In_vite..."), NULL, menu_invite_cb, 0, 2960 { N_("/Conversation/In_vite..."), NULL, menu_invite_cb, 0,
2938 "<StockItem>", GAIM_STOCK_INVITE }, 2961 "<StockItem>", GAIM_STOCK_INVITE },
2939 2962
2963 { N_("/Conversation/Send _File..."), NULL, menu_sendfile_cb, 0,
2964 "<StockItem>", GAIM_STOCK_INVITE },
2965
2940 { "/Conversation/sep2", NULL, NULL, 0, "<Separator>" }, 2966 { "/Conversation/sep2", NULL, NULL, 0, "<Separator>" },
2941 2967
2942 { N_("/Conversation/Insert _URL..."), NULL, menu_insert_link_cb, 0, 2968 { N_("/Conversation/Insert _URL..."), NULL, menu_insert_link_cb, 0,
2943 "<StockItem>", GAIM_STOCK_LINK }, 2969 "<StockItem>", GAIM_STOCK_LINK },
2944 { N_("/Conversation/Insert _Image..."), NULL, menu_insert_image_cb, 0, 2970 { N_("/Conversation/Insert _Image..."), NULL, menu_insert_image_cb, 0,
3022 N_("/Conversation/Get Info...")); 3048 N_("/Conversation/Get Info..."));
3023 3049
3024 gtkwin->menu.invite = 3050 gtkwin->menu.invite =
3025 gtk_item_factory_get_widget(gtkwin->menu.item_factory, 3051 gtk_item_factory_get_widget(gtkwin->menu.item_factory,
3026 N_("/Conversation/Invite...")); 3052 N_("/Conversation/Invite..."));
3053
3054 gtkwin->menu.sendfile =
3055 gtk_item_factory_get_widget(gtkwin->menu.item_factory,
3056 N_("/Conversation/Send File..."));
3027 3057
3028 /* --- */ 3058 /* --- */
3029 3059
3030 gtkwin->menu.insert_link = 3060 gtkwin->menu.insert_link =
3031 gtk_item_factory_get_widget(gtkwin->menu.item_factory, 3061 gtk_item_factory_get_widget(gtkwin->menu.item_factory,