Skip to content
Snippets Groups Projects
Commit 36745247 authored by Alexandre Bourget's avatar Alexandre Bourget
Browse files

Merge commit 'origin/master'

parents 67c9e135 8bf6ad03
Branches
Tags
No related merge requests found
Showing
with 222 additions and 45 deletions
...@@ -273,6 +273,12 @@ dnl Datadir directory ...@@ -273,6 +273,12 @@ dnl Datadir directory
sflphone_datadir=$datadir/sflphone sflphone_datadir=$datadir/sflphone
AC_SUBST(sflphone_datadir) AC_SUBST(sflphone_datadir)
dnl Dbus Service activation part
DBUS_SERVICES_DIR="$datadir/dbus-1/services"
AC_SUBST(DBUS_SERVICES_DIR)
AC_DEFINE_UNQUOTED(DBUS_SERVICES_DIR, "$DBUS_SERVICES_DIR", [Where services dir for DBUS is])
dnl QT interface dnl QT interface
AC_MSG_CHECKING([whether to enable sflphoneqt]) AC_MSG_CHECKING([whether to enable sflphoneqt])
AC_ARG_ENABLE(sflphoneqt, AC_ARG_ENABLE(sflphoneqt,
... ...
......
dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
dnl
dnl example
dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
AC_DEFUN([AS_AC_EXPAND],
[
EXP_VAR=[$1]
FROM_VAR=[$2]
dnl first expand prefix and exec_prefix if necessary
prefix_save=$prefix
exec_prefix_save=$exec_prefix
dnl if no prefix given, then use /usr/local, the default prefix
if test "x$prefix" = "xNONE"; then
prefix=$ac_default_prefix
fi
dnl if no exec_prefix given, then use prefix
if test "x$exec_prefix" = "xNONE"; then
exec_prefix=$prefix
fi
full_var="$FROM_VAR"
dnl loop until it doesn't change anymore
while true; do
new_full_var="`eval echo $full_var`"
if test "x$new_full_var"="x$full_var"; then break; fi
full_var=$new_full_var
done
dnl clean up
full_var=$new_full_var
AC_SUBST([$1], "$full_var")
dnl restore prefix and exec_prefix
prefix=$prefix_save
exec_prefix=$exec_prefix_save
])
...@@ -18,7 +18,7 @@ sflphone_gtk_SOURCES = \ ...@@ -18,7 +18,7 @@ sflphone_gtk_SOURCES = \
statusicon.c statusicon.c
noinst_HEADERS = actions.h dbus.h mainwindow.h calllist.h dialpad.h \ noinst_HEADERS = actions.h dbus.h mainwindow.h calllist.h dialpad.h \
callmanager-glue.h menus.h calltree.h screen.h configwindow.h \ callmanager-glue.h configurationmanager-glue.h instance-glue.h menus.h calltree.h screen.h configwindow.h \
accountlist.h accountwindow.h marshaller.h sliders.h statusicon.h accountlist.h accountwindow.h marshaller.h sliders.h statusicon.h
EXTRA_DIST = marshaller.list EXTRA_DIST = marshaller.list
sflphone_gtk_LDADD = $(DEPS_LIBS) sflphone_gtk_LDADD = $(DEPS_LIBS)
... ...
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
... ...
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
... ...
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
... ...
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
... ...
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -30,6 +30,9 @@ ...@@ -30,6 +30,9 @@
#include <string.h> #include <string.h>
#include <glib/gprintf.h> #include <glib/gprintf.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
void void
sflphone_notify_voice_mail (guint count) sflphone_notify_voice_mail (guint count)
...@@ -61,8 +64,10 @@ sflphone_quit () ...@@ -61,8 +64,10 @@ sflphone_quit ()
if (quit) if (quit)
{ {
dbus_unregister(getpid());
dbus_clean (); dbus_clean ();
//call_list_clean(); TODO //call_list_clean(); TODO
//account_list_clean()
gtk_main_quit (); gtk_main_quit ();
} }
return quit; return quit;
...@@ -132,6 +137,7 @@ sflphone_fill_account_list() ...@@ -132,6 +137,7 @@ sflphone_fill_account_list()
} }
toolbar_update_buttons();
} }
gboolean gboolean
...@@ -146,6 +152,7 @@ sflphone_init() ...@@ -146,6 +152,7 @@ sflphone_init()
} }
else else
{ {
dbus_register(getpid(), "Gtk+ Client");
sflphone_fill_account_list(); sflphone_fill_account_list();
return TRUE; return TRUE;
} }
...@@ -170,6 +177,9 @@ sflphone_hang_up() ...@@ -170,6 +177,9 @@ sflphone_hang_up()
case CALL_STATE_INCOMING: case CALL_STATE_INCOMING:
dbus_refuse (selectedCall); dbus_refuse (selectedCall);
break; break;
case CALL_STATE_TRANSFERT:
dbus_hang_up (selectedCall);
break;
default: default:
g_warning("Should not happen!"); g_warning("Should not happen!");
break; break;
...@@ -195,6 +205,9 @@ sflphone_pick_up() ...@@ -195,6 +205,9 @@ sflphone_pick_up()
case CALL_STATE_HOLD: case CALL_STATE_HOLD:
dbus_unhold (selectedCall); dbus_unhold (selectedCall);
break; break;
case CALL_STATE_TRANSFERT:
dbus_transfert (selectedCall);
break;
default: default:
g_warning("Should not happen!"); g_warning("Should not happen!");
break; break;
...@@ -278,8 +291,23 @@ sflphone_set_transfert() ...@@ -278,8 +291,23 @@ sflphone_set_transfert()
update_call_tree(c); update_call_tree(c);
update_menus(); update_menus();
} }
toolbar_update_buttons();
} }
void
sflphone_unset_transfert()
{
call_t * c = call_get_selected();
if(c)
{
c->state = CALL_STATE_CURRENT;
c->to = g_strdup("");
screen_set_call(c);
update_call_tree(c);
update_menus();
}
toolbar_update_buttons();
}
void void
sflphone_incoming_call (call_t * c) sflphone_incoming_call (call_t * c)
{ {
...@@ -431,7 +459,7 @@ sflphone_keypad( guint keyval, gchar * key) ...@@ -431,7 +459,7 @@ sflphone_keypad( guint keyval, gchar * key)
dbus_transfert(c); dbus_transfert(c);
break; break;
case 65307: /* ESCAPE */ case 65307: /* ESCAPE */
sflphone_current(c); // Quit transfert sflphone_hang_up(c);
break; break;
default: // When a call is on transfert, typing new numbers will add it to c->to default: // When a call is on transfert, typing new numbers will add it to c->to
process_dialing(c, keyval, key); process_dialing(c, keyval, key);
... ...
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -52,6 +52,7 @@ void sflphone_off_hold (); ...@@ -52,6 +52,7 @@ void sflphone_off_hold ();
call_t * sflphone_new_call(); call_t * sflphone_new_call();
void sflphone_notify_voice_mail (guint count); void sflphone_notify_voice_mail (guint count);
void sflphone_set_transfert(); void sflphone_set_transfert();
void sflphone_unset_transfert();
/** /**
* Accept / dial the current call * Accept / dial the current call
*/ */
... ...
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
... ...
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
... ...
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -33,6 +33,7 @@ GtkToolItem * hangupButton; ...@@ -33,6 +33,7 @@ GtkToolItem * hangupButton;
GtkToolItem * holdButton; GtkToolItem * holdButton;
GtkToolItem * transfertButton; GtkToolItem * transfertButton;
GtkToolItem * unholdButton; GtkToolItem * unholdButton;
guint transfertButtonConnId; //The button toggled signal connection ID
/** /**
* Make a call * Make a call
...@@ -74,10 +75,19 @@ hold( GtkWidget *widget, gpointer data ) ...@@ -74,10 +75,19 @@ hold( GtkWidget *widget, gpointer data )
* Transfert the line * Transfert the line
*/ */
static void static void
transfert( GtkWidget *widget, gpointer data ) transfert (GtkToggleToolButton *toggle_tool_button,
gpointer user_data)
{
gboolean up = gtk_toggle_tool_button_get_active(toggle_tool_button);
if(up)
{ {
sflphone_set_transfert(); sflphone_set_transfert();
} }
else
{
sflphone_unset_transfert();
}
}
/** /**
* Unhold call * Unhold call
...@@ -89,7 +99,7 @@ unhold( GtkWidget *widget, gpointer data ) ...@@ -89,7 +99,7 @@ unhold( GtkWidget *widget, gpointer data )
} }
void void
update_buttons () toolbar_update_buttons ()
{ {
gtk_widget_set_sensitive( GTK_WIDGET(callButton), FALSE); gtk_widget_set_sensitive( GTK_WIDGET(callButton), FALSE);
gtk_widget_set_sensitive( GTK_WIDGET(pickupButton), FALSE); gtk_widget_set_sensitive( GTK_WIDGET(pickupButton), FALSE);
...@@ -103,6 +113,10 @@ update_buttons () ...@@ -103,6 +113,10 @@ update_buttons ()
gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(unholdButton)); gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(unholdButton));
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), holdButton, 3); gtk_toolbar_insert(GTK_TOOLBAR(toolbar), holdButton, 3);
gtk_signal_handler_block(GTK_OBJECT(transfertButton),transfertButtonConnId);
gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(transfertButton), FALSE);
gtk_signal_handler_unblock(transfertButton, transfertButtonConnId);
call_t * selectedCall = call_get_selected(); call_t * selectedCall = call_get_selected();
if (selectedCall) if (selectedCall)
{ {
...@@ -137,6 +151,16 @@ update_buttons () ...@@ -137,6 +151,16 @@ update_buttons ()
case CALL_STATE_BUSY: case CALL_STATE_BUSY:
case CALL_STATE_FAILURE: case CALL_STATE_FAILURE:
gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE);
break;
case CALL_STATE_TRANSFERT:
gtk_signal_handler_block(GTK_OBJECT(transfertButton),transfertButtonConnId);
gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(transfertButton), TRUE);
gtk_signal_handler_unblock(transfertButton, transfertButtonConnId);
gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE);
gtk_widget_set_sensitive( GTK_WIDGET(pickupButton), TRUE);
gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE);
gtk_widget_set_sensitive( GTK_WIDGET(holdButton), TRUE);
gtk_widget_set_sensitive( GTK_WIDGET(transfertButton), TRUE);
break; break;
default: default:
g_warning("Should not happen!"); g_warning("Should not happen!");
...@@ -144,9 +168,16 @@ update_buttons () ...@@ -144,9 +168,16 @@ update_buttons ()
} }
} }
else else
{
if( account_list_get_size() > 0 )
{ {
gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE); gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE);
} }
else
{
gtk_widget_set_sensitive( GTK_WIDGET(callButton), FALSE);
}
}
} }
/* Call back when the user click on a call in the list */ /* Call back when the user click on a call in the list */
static void static void
...@@ -164,7 +195,7 @@ selected(GtkTreeSelection *sel, GtkTreeModel *model) ...@@ -164,7 +195,7 @@ selected(GtkTreeSelection *sel, GtkTreeModel *model)
call_select((call_t*) g_value_get_pointer(&val)); call_select((call_t*) g_value_get_pointer(&val));
g_value_unset(&val); g_value_unset(&val);
update_buttons(); toolbar_update_buttons();
} }
/* A row is activated when it is double clicked */ /* A row is activated when it is double clicked */
...@@ -245,9 +276,11 @@ create_toolbar (){ ...@@ -245,9 +276,11 @@ create_toolbar (){
gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(holdButton), -1); gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(holdButton), -1);
image = gtk_image_new_from_file( ICONS_DIR "/transfert.svg"); image = gtk_image_new_from_file( ICONS_DIR "/transfert.svg");
transfertButton = gtk_tool_button_new (image, "Transfert"); transfertButton = gtk_toggle_tool_button_new ();
gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(transfertButton), image);
gtk_tool_button_set_label(GTK_TOOL_BUTTON(transfertButton), "Transfert");
gtk_widget_set_state( GTK_WIDGET(transfertButton), GTK_STATE_INSENSITIVE); gtk_widget_set_state( GTK_WIDGET(transfertButton), GTK_STATE_INSENSITIVE);
g_signal_connect (G_OBJECT (transfertButton), "clicked", transfertButtonConnId = g_signal_connect (G_OBJECT (transfertButton), "toggled",
G_CALLBACK (transfert), NULL); G_CALLBACK (transfert), NULL);
gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(transfertButton), -1); gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(transfertButton), -1);
...@@ -309,6 +342,8 @@ create_call_tree (){ ...@@ -309,6 +342,8 @@ create_call_tree (){
gtk_widget_show(ret); gtk_widget_show(ret);
toolbar_update_buttons();
return ret; return ret;
} }
...@@ -340,7 +375,7 @@ update_call_tree_remove (call_t * c) ...@@ -340,7 +375,7 @@ update_call_tree_remove (call_t * c)
call_t * selectedCall = call_get_selected(); call_t * selectedCall = call_get_selected();
if(selectedCall == c) if(selectedCall == c)
call_select(NULL); call_select(NULL);
update_buttons(); toolbar_update_buttons();
} }
void void
...@@ -430,7 +465,7 @@ update_call_tree (call_t * c) ...@@ -430,7 +465,7 @@ update_call_tree (call_t * c)
} }
} }
update_buttons(); toolbar_update_buttons();
//return row_ref; //return row_ref;
} }
...@@ -486,6 +521,6 @@ update_call_tree_add (call_t * c) ...@@ -486,6 +521,6 @@ update_call_tree_add (call_t * c)
//g_free(markup); //g_free(markup);
sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(view)); sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
gtk_tree_selection_select_iter(GTK_TREE_SELECTION(sel), &iter); gtk_tree_selection_select_iter(GTK_TREE_SELECTION(sel), &iter);
update_buttons(); toolbar_update_buttons();
//return row_ref; //return row_ref;
} }
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
*/ */
GtkWidget * create_call_tree(); GtkWidget * create_call_tree();
void toolbar_update_buttons();
void update_call_tree_add (call_t * c); void update_call_tree_add (call_t * c);
void update_call_tree (call_t * c); void update_call_tree (call_t * c);
void update_call_tree_remove (call_t * c); void update_call_tree_remove (call_t * c);
... ...
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
... ...
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
... ...
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <calllist.h> #include <calllist.h>
#include <callmanager-glue.h> #include <callmanager-glue.h>
#include <configurationmanager-glue.h> #include <configurationmanager-glue.h>
#include <instance-glue.h>
#include <configwindow.h> #include <configwindow.h>
#include <mainwindow.h> #include <mainwindow.h>
#include <marshaller.h> #include <marshaller.h>
...@@ -34,6 +35,7 @@ ...@@ -34,6 +35,7 @@
DBusGConnection * connection; DBusGConnection * connection;
DBusGProxy * callManagerProxy; DBusGProxy * callManagerProxy;
DBusGProxy * configurationManagerProxy; DBusGProxy * configurationManagerProxy;
DBusGProxy * instanceProxy;
static void static void
incoming_call_cb (DBusGProxy *proxy, incoming_call_cb (DBusGProxy *proxy,
...@@ -166,16 +168,26 @@ dbus_connect () ...@@ -166,16 +168,26 @@ dbus_connect ()
/* Create a proxy object for the "bus driver" (name "org.freedesktop.DBus") */ /* Create a proxy object for the "bus driver" (name "org.freedesktop.DBus") */
callManagerProxy = dbus_g_proxy_new_for_name_owner (connection, instanceProxy = dbus_g_proxy_new_for_name (connection,
"org.sflphone.SFLphone",
"/org/sflphone/SFLphone/Instance",
"org.sflphone.SFLphone.Instance");
if (!instanceProxy)
{
g_printerr ("Failed to get proxy to Instance\n");
return FALSE;
}
g_print ("DBus connected to Instance\n");
callManagerProxy = dbus_g_proxy_new_for_name (connection,
"org.sflphone.SFLphone", "org.sflphone.SFLphone",
"/org/sflphone/SFLphone/CallManager", "/org/sflphone/SFLphone/CallManager",
"org.sflphone.SFLphone.CallManager", "org.sflphone.SFLphone.CallManager");
&error); if (!callManagerProxy)
if (error)
{ {
g_printerr ("Failed to get proxy to CallManager: %s\n", g_printerr ("Failed to get proxy to CallManagers\n");
error->message);
g_error_free (error);
return FALSE; return FALSE;
} }
...@@ -215,19 +227,16 @@ dbus_connect () ...@@ -215,19 +227,16 @@ dbus_connect ()
dbus_g_proxy_connect_signal (callManagerProxy, dbus_g_proxy_connect_signal (callManagerProxy,
"volumeChanged", G_CALLBACK(volume_changed_cb), NULL, NULL); "volumeChanged", G_CALLBACK(volume_changed_cb), NULL, NULL);
configurationManagerProxy = dbus_g_proxy_new_for_name_owner (connection, configurationManagerProxy = dbus_g_proxy_new_for_name (connection,
"org.sflphone.SFLphone", "org.sflphone.SFLphone",
"/org/sflphone/SFLphone/ConfigurationManager", "/org/sflphone/SFLphone/ConfigurationManager",
"org.sflphone.SFLphone.ConfigurationManager", "org.sflphone.SFLphone.ConfigurationManager");
&error); if (!configurationManagerProxy)
if (error)
{ {
g_printerr ("Failed to get proxy to ConfigurationManager: %s\n", g_printerr ("Failed to get proxy to ConfigurationManager\n");
error->message);
g_error_free (error);
return FALSE; return FALSE;
} }
g_print ("DBus connected to ConfigurationManager\n");
dbus_g_proxy_add_signal (configurationManagerProxy, dbus_g_proxy_add_signal (configurationManagerProxy,
"accountsChanged", G_TYPE_INVALID); "accountsChanged", G_TYPE_INVALID);
dbus_g_proxy_connect_signal (configurationManagerProxy, dbus_g_proxy_connect_signal (configurationManagerProxy,
...@@ -375,12 +384,16 @@ dbus_place_call (const call_t * c) ...@@ -375,12 +384,16 @@ dbus_place_call (const call_t * c)
gchar ** gchar **
dbus_account_list() dbus_account_list()
{ {
g_print("Before");
GError *error = NULL; GError *error = NULL;
char ** array; char ** array;
org_sflphone_SFLphone_ConfigurationManager_get_account_list ( org_sflphone_SFLphone_ConfigurationManager_get_account_list (
configurationManagerProxy, configurationManagerProxy,
&array, &array,
&error); &error);
g_print("After");
if (error) if (error)
{ {
g_printerr ("Failed to call get_account_list() on ConfigurationManager: %s\n", g_printerr ("Failed to call get_account_list() on ConfigurationManager: %s\n",
...@@ -556,3 +569,49 @@ dbus_play_dtmf(const gchar * key) ...@@ -556,3 +569,49 @@ dbus_play_dtmf(const gchar * key)
} }
} }
void
dbus_register(int pid, gchar * name)
{
GError *error = NULL;
org_sflphone_SFLphone_Instance_register(
instanceProxy,
pid,
name,
&error);
if (error)
{
g_printerr ("Failed to call register() on instanceProxy: %s\n",
error->message);
g_error_free (error);
}
else
{
g_print ("DBus called register() on instanceProxy\n");
}
}
void
dbus_unregister(int pid)
{
GError *error = NULL;
org_sflphone_SFLphone_Instance_unregister(
instanceProxy,
pid,
&error);
if (error)
{
g_printerr ("Failed to call unregister() on instanceProxy: %s\n",
error->message);
g_error_free (error);
}
else
{
g_print ("DBus called unregister() on instanceProxy\n");
}
}
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -51,4 +51,10 @@ void dbus_set_volume(const gchar * device, gdouble value); ...@@ -51,4 +51,10 @@ void dbus_set_volume(const gchar * device, gdouble value);
gdouble dbus_get_volume(const gchar * device); gdouble dbus_get_volume(const gchar * device);
void dbus_play_dtmf(const gchar * key); void dbus_play_dtmf(const gchar * key);
/* Instance */
void dbus_register( int pid, gchar * name);
void dbus_unregister(int pid);
#endif #endif
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
... ...
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
... ...
......
/* /*
* Copyright (C) 2007 Savoir-Faire Linux inc. * Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment