aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy.c
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimo.cecchi@collabora.co.uk>2009-02-18 23:41:12 +0800
committerCosimo Cecchi <cosimoc@gnome.org>2009-06-01 23:47:34 +0800
commit58d08cef143811d990218551a922451609978610 (patch)
treed90811a64a6135a048d3c90aee13654019089b5b /src/empathy.c
parent1e69ae50fa2a35ac4e54283d40e9d96777ff6e61 (diff)
downloadgsoc2013-empathy-58d08cef143811d990218551a922451609978610.tar
gsoc2013-empathy-58d08cef143811d990218551a922451609978610.tar.gz
gsoc2013-empathy-58d08cef143811d990218551a922451609978610.tar.bz2
gsoc2013-empathy-58d08cef143811d990218551a922451609978610.tar.lz
gsoc2013-empathy-58d08cef143811d990218551a922451609978610.tar.xz
gsoc2013-empathy-58d08cef143811d990218551a922451609978610.tar.zst
gsoc2013-empathy-58d08cef143811d990218551a922451609978610.zip
Rethink a bit the logic for an incoming transfer.
Now, a client should have to do the following, in order to receive a file transfer: - let the EmpathyFTFactory claim the EmpathyDispatchOperation - the factory will emit "new-incoming-transfer" when the handler is filled with the relevant properties - now you can choose a destination file, and then you should call _set_destination on EmpathyFTFactory passing the handler. - the factory will emit "new-ft-handler" as you're now ready to start the actual transfer.
Diffstat (limited to 'src/empathy.c')
-rw-r--r--src/empathy.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/empathy.c b/src/empathy.c
index c588fd9e7..705e6f0e5 100644
--- a/src/empathy.c
+++ b/src/empathy.c
@@ -133,7 +133,7 @@ dispatch_cb (EmpathyDispatcher *dispatcher,
EmpathyFTFactory *factory;
factory = empathy_ft_factory_dup_singleton ();
- empathy_ft_factory_claim_channel (factory, operation, NULL);
+ empathy_ft_factory_claim_channel (factory, operation);
}
}
@@ -405,6 +405,22 @@ show_version_cb (const char *option_name,
}
static void
+new_incoming_transfer_cb (EmpathyFTFactory *factory,
+ EmpathyFTHandler *handler,
+ gpointer user_data)
+{
+ empathy_receive_file_with_file_chooser (handler);
+}
+
+static void
+new_ft_handler_cb (EmpathyFTFactory *factory,
+ EmpathyFTHandler *handler,
+ gpointer user_data)
+{
+ /* TODO: add to FT window */
+}
+
+static void
new_call_handler_cb (EmpathyCallFactory *factory, EmpathyCallHandler *handler,
gboolean outgoing, gpointer user_data)
{
@@ -427,6 +443,7 @@ main (int argc, char *argv[])
EmpathyChatroomManager *chatroom_manager;
EmpathyFTManager *ft_manager;
EmpathyCallFactory *call_factory;
+ EmpathyFTFactory *ft_factory;
GtkWidget *window;
MissionControl *mc;
EmpathyIdle *idle;
@@ -581,6 +598,12 @@ main (int argc, char *argv[])
call_factory = empathy_call_factory_initialise ();
g_signal_connect (G_OBJECT (call_factory), "new-call-handler",
G_CALLBACK (new_call_handler_cb), NULL);
+ /* Create the FT factory */
+ ft_factory = empathy_ft_factory_dup_singleton ();
+ g_signal_connect (ft_factory, "new-ft-handler",
+ G_CALLBACK (new_ft_handler_cb), NULL);
+ g_signal_connect (ft_factory, "new-incoming-transfer",
+ G_CALLBACK (new_incoming_transfer_cb), NULL);
/* Location mananger */
#if HAVE_GEOCLUE
@@ -601,6 +624,7 @@ main (int argc, char *argv[])
#if HAVE_GEOCLUE
g_object_unref (location_manager);
#endif
+ g_object_unref (ft_factory);
notify_uninit ();