From a7630dc453ae60fde8191beca2003b5427743b7d Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Tue, 3 Feb 2009 09:02:51 +0000 Subject: Toss out the old EmpathyCallWindow initialise the CallFactory and hook into its signals Signed-off-by: Sjoerd Simons svn path=/trunk/; revision=2383 --- src/empathy.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'src/empathy.c') diff --git a/src/empathy.c b/src/empathy.c index dce928701..a7311ebec 100644 --- a/src/empathy.c +++ b/src/empathy.c @@ -40,6 +40,7 @@ #include #include +#include #include #include #include @@ -110,14 +111,10 @@ dispatch_cb (EmpathyDispatcher *dispatcher, empathy_dispatch_operation_claim (operation); } else if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_STREAMED_MEDIA) { - EmpathyTpCall *call; + EmpathyCallFactory *factory; - call = EMPATHY_TP_CALL ( - empathy_dispatch_operation_get_channel_wrapper (operation)); - - empathy_dispatch_operation_claim (operation); - - empathy_call_window_new (call); + factory = empathy_call_factory_get (); + empathy_call_factory_claim_channel (factory, operation); } else if (channel_type == EMP_IFACE_QUARK_CHANNEL_TYPE_FILE_TRANSFER) { EmpathyFTManager *ft_manager; EmpathyTpFile *tp_file; @@ -397,6 +394,16 @@ show_version_cb (const char *option_name, return FALSE; } +static void +new_call_handler_cb (EmpathyCallFactory *factory, EmpathyCallHandler *handler, + gboolean outgoing, gpointer user_data) +{ + EmpathyCallWindow *window; + + window = empathy_call_window_new (handler); + gtk_widget_show (GTK_WIDGET (window)); +} + int main (int argc, char *argv[]) { @@ -404,6 +411,7 @@ main (int argc, char *argv[]) EmpathyStatusIcon *icon; EmpathyDispatcher *dispatcher; EmpathyChatroomManager *chatroom_manager; + EmpathyCallFactory *call_factory; GtkWidget *window; MissionControl *mc; EmpathyIdle *idle; @@ -543,6 +551,10 @@ main (int argc, char *argv[]) empathy_chatroom_manager_observe (chatroom_manager, dispatcher); notify_init (_(PACKAGE_NAME)); + /* Create the call factory */ + call_factory = empathy_call_factory_initialise (); + g_signal_connect (G_OBJECT (call_factory), "new-call-handler", + G_CALLBACK (new_call_handler_cb), NULL); gtk_main (); -- cgit v1.2.3