From 1ff7c439e8442d51024fbfcde2b1c11b8b17cf4f Mon Sep 17 00:00:00 2001 From: Jonny Lamb Date: Fri, 21 Nov 2008 16:14:25 +0000 Subject: Added empathy_send_file_with_file_chooser_and_manager to make use of the file transfer manager. (Jonny Lamb) Signed-off-by: Jonny Lamb svn path=/trunk/; revision=1747 --- libempathy-gtk/empathy-contact-menu.c | 2 +- libempathy-gtk/empathy-ui-utils.c | 14 ++++++++++++++ libempathy-gtk/empathy-ui-utils.h | 2 ++ 3 files changed, 17 insertions(+), 1 deletion(-) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-contact-menu.c b/libempathy-gtk/empathy-contact-menu.c index a167a1798..dc004bea3 100644 --- a/libempathy-gtk/empathy-contact-menu.c +++ b/libempathy-gtk/empathy-contact-menu.c @@ -195,7 +195,7 @@ empathy_contact_log_menu_item_new (EmpathyContact *contact) static void contact_file_transfer_menu_item_activate_cb (EmpathyContact *contact) { - empathy_send_file_with_file_chooser (contact, NULL, NULL); + empathy_send_file_with_file_chooser_and_manager (contact); } GtkWidget * diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c index a794232c9..19bc078f2 100644 --- a/libempathy-gtk/empathy-ui-utils.c +++ b/libempathy-gtk/empathy-ui-utils.c @@ -1570,3 +1570,17 @@ empathy_send_file_with_file_chooser (EmpathyContact *contact, gtk_widget_show (widget); } +static void +add_file_to_manager (EmpathyFile *file, + EmpathyFTManager *ft_manager) +{ + empathy_ft_manager_add_file (ft_manager, file); +} + +void +empathy_send_file_with_file_chooser_and_manager (EmpathyContact *contact) +{ + empathy_send_file_with_file_chooser (contact, + (EmpathyFileChooserCallback) add_file_to_manager, + empathy_ft_manager_get_default ()); +} diff --git a/libempathy-gtk/empathy-ui-utils.h b/libempathy-gtk/empathy-ui-utils.h index 1bce31baa..bb1d45f92 100644 --- a/libempathy-gtk/empathy-ui-utils.h +++ b/libempathy-gtk/empathy-ui-utils.h @@ -41,6 +41,7 @@ #include #include "empathy-chat-view.h" +#include "empathy-ft-manager.h" G_BEGIN_DECLS @@ -120,6 +121,7 @@ typedef gboolean (*EmpathyFileChooserCallback) (EmpathyFile *file, void empathy_send_file_with_file_chooser (EmpathyContact *contact, EmpathyFileChooserCallback callback, gpointer user_data); +void empathy_send_file_with_file_chooser_and_manager (EmpathyContact *contact); G_END_DECLS -- cgit v1.2.3