aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimo.cecchi@collabora.co.uk>2009-02-17 19:03:58 +0800
committerCosimo Cecchi <cosimoc@gnome.org>2009-06-01 23:46:05 +0800
commit92778cc0fa77a252763dee87ed1f95f9c7e95cb1 (patch)
tree72912595c76168526d34caa82537395f7ed42171 /libempathy-gtk
parent98284c362f9bea1558a0b0c89f8f8d6a93c63074 (diff)
downloadgsoc2013-empathy-92778cc0fa77a252763dee87ed1f95f9c7e95cb1.tar
gsoc2013-empathy-92778cc0fa77a252763dee87ed1f95f9c7e95cb1.tar.gz
gsoc2013-empathy-92778cc0fa77a252763dee87ed1f95f9c7e95cb1.tar.bz2
gsoc2013-empathy-92778cc0fa77a252763dee87ed1f95f9c7e95cb1.tar.lz
gsoc2013-empathy-92778cc0fa77a252763dee87ed1f95f9c7e95cb1.tar.xz
gsoc2013-empathy-92778cc0fa77a252763dee87ed1f95f9c7e95cb1.tar.zst
gsoc2013-empathy-92778cc0fa77a252763dee87ed1f95f9c7e95cb1.zip
W.I.P. for heavy lifting on EmpathyTpFile.
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-ui-utils.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index 3f3961fea..23b382d30 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -51,6 +51,8 @@
#include <libempathy/empathy-dispatcher.h>
#include <libempathy/empathy-idle.h>
#include <libempathy/empathy-tp-file.h>
+#include <libempathy/empathy-ft-factory.h>
+#include <libempathy/empathy-ft-handler.h>
#define SCHEMES "(https?|s?ftps?|nntp|news|javascript|about|ghelp|apt|telnet|"\
"file|webcal|mailto)"
@@ -1403,7 +1405,7 @@ empathy_toggle_button_set_state_quietly (GtkWidget *widget,
}
/* Sending files with the file chooser */
-
+#if 0
static void
file_manager_send_file_request_cb (EmpathyDispatchOperation *operation,
const GError *error, gpointer user_data)
@@ -1426,12 +1428,24 @@ file_manager_send_file_request_cb (EmpathyDispatchOperation *operation,
g_object_unref (file);
}
+#endif
+
+static void
+new_ft_handler_cb (EmpathyFTFactory *factory,
+ EmpathyFTHandler *handler,
+ gboolean direction,
+ gpointer user_data)
+{
+ empathy_ft_handler_start_transfer (handler, g_cancellable_new ());
+}
static void
file_manager_send_file_response_cb (GtkDialog *widget,
gint response_id,
EmpathyContact *contact)
{
+ EmpathyFTFactory *factory;
+
if (response_id == GTK_RESPONSE_OK) {
GSList *list;
GSList *l;
@@ -1467,12 +1481,16 @@ file_manager_send_file_response_cb (GtkDialog *widget,
DEBUG ("\t%s", uri);
filename = g_file_get_basename (gfile);
g_file_info_get_modification_time (info, &mtime);
-
+#if 0
empathy_dispatcher_send_file_to_contact (contact,
filename, g_file_info_get_size (info), mtime.tv_sec,
g_file_info_get_content_type (info),
file_manager_send_file_request_cb, gfile);
-
+#endif
+ factory = empathy_ft_factory_dup_singleton ();
+ g_signal_connect (factory, "new-ft-handler",
+ G_CALLBACK (new_ft_handler_cb), NULL);
+ empathy_ft_factory_new_transfer (factory, contact, gfile);
g_free (filename);
g_object_unref (info);