diff --git a/configure.ac b/configure.ac index 2a03c62c3ea598295d9571f582e20a311014f939..8116192347c43f39788666ac9507a64d7b45e44c 100644 --- a/configure.ac +++ b/configure.ac @@ -273,6 +273,12 @@ dnl Datadir directory sflphone_datadir=$datadir/sflphone 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 AC_MSG_CHECKING([whether to enable sflphoneqt]) AC_ARG_ENABLE(sflphoneqt, diff --git a/m4/dbus.m4 b/m4/dbus.m4 new file mode 100644 index 0000000000000000000000000000000000000000..0c71173933f8c7a9f6b95a272b97b97df24f99ee --- /dev/null +++ b/m4/dbus.m4 @@ -0,0 +1,40 @@ +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 +]) diff --git a/sflphone-gtk/src/Makefile.am b/sflphone-gtk/src/Makefile.am index 18c6871566b19e84b74c042c1ea4eff326c3993a..0e01d996751022c36ba354b1f3689442485f0206 100644 --- a/sflphone-gtk/src/Makefile.am +++ b/sflphone-gtk/src/Makefile.am @@ -18,9 +18,9 @@ sflphone_gtk_SOURCES = \ statusicon.c 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 -EXTRA_DIST = marshaller.list +EXTRA_DIST = marshaller.list sflphone_gtk_LDADD = $(DEPS_LIBS) AM_CPPFLAGS = $(DEPS_CFLAGS) \ diff --git a/sflphone-gtk/src/accountlist.c b/sflphone-gtk/src/accountlist.c index e48e8e5a3ddd3684b2e61e292abdb52f9c51fbd4..26c729a7d93d315a4bc9eb172196924cfca7fe32 100644 --- a/sflphone-gtk/src/accountlist.c +++ b/sflphone-gtk/src/accountlist.c @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by diff --git a/sflphone-gtk/src/accountlist.h b/sflphone-gtk/src/accountlist.h index be480f1a8e72ba35c371dc41dd6d0a868da9db5f..f6640868428a06e6f468662fa2b76c54b2e6a6d4 100644 --- a/sflphone-gtk/src/accountlist.h +++ b/sflphone-gtk/src/accountlist.h @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by diff --git a/sflphone-gtk/src/accountwindow.c b/sflphone-gtk/src/accountwindow.c index 37fd38a5c213ba2ad7469698a1af25079444681c..792ac7c87c2168a036c8c11de79b3d3421760b8b 100644 --- a/sflphone-gtk/src/accountwindow.c +++ b/sflphone-gtk/src/accountwindow.c @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by diff --git a/sflphone-gtk/src/accountwindow.h b/sflphone-gtk/src/accountwindow.h index 057e30c7360b1dc502bb66a03272145705e19a10..075f626652d61933188bd54b54ebb67dddaa3e68 100644 --- a/sflphone-gtk/src/accountwindow.h +++ b/sflphone-gtk/src/accountwindow.h @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by diff --git a/sflphone-gtk/src/actions.c b/sflphone-gtk/src/actions.c index 39362098d0891252f8dfa327f6334ca090ab6d07..593e8bfa13c755d7559f52c84c4dd0f8b7817fec 100644 --- a/sflphone-gtk/src/actions.c +++ b/sflphone-gtk/src/actions.c @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by @@ -30,6 +30,9 @@ #include <string.h> #include <glib/gprintf.h> #include <stdlib.h> +#include <sys/types.h> +#include <unistd.h> + void sflphone_notify_voice_mail (guint count) @@ -61,8 +64,10 @@ sflphone_quit () if (quit) { + dbus_unregister(getpid()); dbus_clean (); //call_list_clean(); TODO + //account_list_clean() gtk_main_quit (); } return quit; @@ -132,6 +137,7 @@ sflphone_fill_account_list() } + toolbar_update_buttons(); } gboolean @@ -146,6 +152,7 @@ sflphone_init() } else { + dbus_register(getpid(), "Gtk+ Client"); sflphone_fill_account_list(); return TRUE; } @@ -170,6 +177,9 @@ sflphone_hang_up() case CALL_STATE_INCOMING: dbus_refuse (selectedCall); break; + case CALL_STATE_TRANSFERT: + dbus_hang_up (selectedCall); + break; default: g_warning("Should not happen!"); break; @@ -195,6 +205,9 @@ sflphone_pick_up() case CALL_STATE_HOLD: dbus_unhold (selectedCall); break; + case CALL_STATE_TRANSFERT: + dbus_transfert (selectedCall); + break; default: g_warning("Should not happen!"); break; @@ -278,8 +291,23 @@ sflphone_set_transfert() update_call_tree(c); 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 sflphone_incoming_call (call_t * c) { @@ -431,7 +459,7 @@ sflphone_keypad( guint keyval, gchar * key) dbus_transfert(c); break; case 65307: /* ESCAPE */ - sflphone_current(c); // Quit transfert + sflphone_hang_up(c); break; default: // When a call is on transfert, typing new numbers will add it to c->to process_dialing(c, keyval, key); diff --git a/sflphone-gtk/src/actions.h b/sflphone-gtk/src/actions.h index a063fd92d29299544673cf88a8f443a26a35eb8c..8046925f974638b537fb37fadbcdc1a71dac7491 100644 --- a/sflphone-gtk/src/actions.h +++ b/sflphone-gtk/src/actions.h @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by @@ -52,6 +52,7 @@ void sflphone_off_hold (); call_t * sflphone_new_call(); void sflphone_notify_voice_mail (guint count); void sflphone_set_transfert(); +void sflphone_unset_transfert(); /** * Accept / dial the current call */ diff --git a/sflphone-gtk/src/calllist.c b/sflphone-gtk/src/calllist.c index 0cde618593750069b4d7cb1c114d0b8cf79d843b..4c86412f5ecab5d054bc187f3c915bf594c861f0 100644 --- a/sflphone-gtk/src/calllist.c +++ b/sflphone-gtk/src/calllist.c @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by diff --git a/sflphone-gtk/src/calllist.h b/sflphone-gtk/src/calllist.h index 5ee5f793e7a1b65b993eb36a074cfe9f1120d569..8492f4811b667f3bf0d886885844324839c043eb 100644 --- a/sflphone-gtk/src/calllist.h +++ b/sflphone-gtk/src/calllist.h @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by diff --git a/sflphone-gtk/src/calltree.c b/sflphone-gtk/src/calltree.c index 769a1b568a84eb9e800b63bc8a0b02a7ff743b1f..6415976ad1d6d72eee2aea495e5055f40fab13e1 100644 --- a/sflphone-gtk/src/calltree.c +++ b/sflphone-gtk/src/calltree.c @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by @@ -33,6 +33,7 @@ GtkToolItem * hangupButton; GtkToolItem * holdButton; GtkToolItem * transfertButton; GtkToolItem * unholdButton; +guint transfertButtonConnId; //The button toggled signal connection ID /** * Make a call @@ -74,9 +75,18 @@ hold( GtkWidget *widget, gpointer data ) * Transfert the line */ static void -transfert( GtkWidget *widget, gpointer data ) +transfert (GtkToggleToolButton *toggle_tool_button, + gpointer user_data) { - sflphone_set_transfert(); + gboolean up = gtk_toggle_tool_button_get_active(toggle_tool_button); + if(up) + { + sflphone_set_transfert(); + } + else + { + sflphone_unset_transfert(); + } } /** @@ -89,7 +99,7 @@ unhold( GtkWidget *widget, gpointer data ) } void -update_buttons () +toolbar_update_buttons () { gtk_widget_set_sensitive( GTK_WIDGET(callButton), FALSE); gtk_widget_set_sensitive( GTK_WIDGET(pickupButton), FALSE); @@ -103,6 +113,10 @@ update_buttons () gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(unholdButton)); 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(); if (selectedCall) { @@ -138,6 +152,16 @@ update_buttons () case CALL_STATE_FAILURE: 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; default: g_warning("Should not happen!"); break; @@ -145,7 +169,14 @@ update_buttons () } else { - gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE); + if( account_list_get_size() > 0 ) + { + 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 */ @@ -164,7 +195,7 @@ selected(GtkTreeSelection *sel, GtkTreeModel *model) call_select((call_t*) g_value_get_pointer(&val)); g_value_unset(&val); - update_buttons(); + toolbar_update_buttons(); } /* A row is activated when it is double clicked */ @@ -245,9 +276,11 @@ create_toolbar (){ gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(holdButton), -1); 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); - g_signal_connect (G_OBJECT (transfertButton), "clicked", + transfertButtonConnId = g_signal_connect (G_OBJECT (transfertButton), "toggled", G_CALLBACK (transfert), NULL); gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(transfertButton), -1); @@ -309,6 +342,8 @@ create_call_tree (){ gtk_widget_show(ret); + toolbar_update_buttons(); + return ret; } @@ -340,7 +375,7 @@ update_call_tree_remove (call_t * c) call_t * selectedCall = call_get_selected(); if(selectedCall == c) call_select(NULL); - update_buttons(); + toolbar_update_buttons(); } void @@ -430,7 +465,7 @@ update_call_tree (call_t * c) } } - update_buttons(); + toolbar_update_buttons(); //return row_ref; } @@ -486,6 +521,6 @@ update_call_tree_add (call_t * c) //g_free(markup); sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(view)); gtk_tree_selection_select_iter(GTK_TREE_SELECTION(sel), &iter); - update_buttons(); + toolbar_update_buttons(); //return row_ref; } diff --git a/sflphone-gtk/src/calltree.h b/sflphone-gtk/src/calltree.h index b1c66cd4b61f0964348955f8f8fd00a3698bfbe5..8f5120a03f29e2f1dbde1c8044993792e77287ce 100644 --- a/sflphone-gtk/src/calltree.h +++ b/sflphone-gtk/src/calltree.h @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by @@ -28,6 +28,8 @@ */ GtkWidget * create_call_tree(); +void toolbar_update_buttons(); + void update_call_tree_add (call_t * c); void update_call_tree (call_t * c); void update_call_tree_remove (call_t * c); diff --git a/sflphone-gtk/src/configwindow.c b/sflphone-gtk/src/configwindow.c index a85aec923029e707aa5aa9059ba1a058e1f72cf2..ef1260398dafd02d566903b9694cf9ccb97f4326 100644 --- a/sflphone-gtk/src/configwindow.c +++ b/sflphone-gtk/src/configwindow.c @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by diff --git a/sflphone-gtk/src/configwindow.h b/sflphone-gtk/src/configwindow.h index b341f4a00481c30a8af1128aa27973cba9fd8d9d..d22c997600a960e3e5258dc3b0393dc3e944e513 100644 --- a/sflphone-gtk/src/configwindow.h +++ b/sflphone-gtk/src/configwindow.h @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by diff --git a/sflphone-gtk/src/dbus.c b/sflphone-gtk/src/dbus.c index 5ea591b330f5e39a096b0945ebb465aae1635735..2801daa09621ac792de13d4e4a715ebc1febeb2e 100644 --- a/sflphone-gtk/src/dbus.c +++ b/sflphone-gtk/src/dbus.c @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by @@ -21,6 +21,7 @@ #include <calllist.h> #include <callmanager-glue.h> #include <configurationmanager-glue.h> +#include <instance-glue.h> #include <configwindow.h> #include <mainwindow.h> #include <marshaller.h> @@ -34,6 +35,7 @@ DBusGConnection * connection; DBusGProxy * callManagerProxy; DBusGProxy * configurationManagerProxy; +DBusGProxy * instanceProxy; static void incoming_call_cb (DBusGProxy *proxy, @@ -166,16 +168,26 @@ dbus_connect () /* 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/CallManager", - "org.sflphone.SFLphone.CallManager", - &error); - if (error) + "org.sflphone.SFLphone.CallManager"); + if (!callManagerProxy) { - g_printerr ("Failed to get proxy to CallManager: %s\n", - error->message); - g_error_free (error); + g_printerr ("Failed to get proxy to CallManagers\n"); return FALSE; } @@ -215,19 +227,16 @@ dbus_connect () dbus_g_proxy_connect_signal (callManagerProxy, "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/ConfigurationManager", - "org.sflphone.SFLphone.ConfigurationManager", - &error); - if (error) + "org.sflphone.SFLphone.ConfigurationManager"); + if (!configurationManagerProxy) { - g_printerr ("Failed to get proxy to ConfigurationManager: %s\n", - error->message); - g_error_free (error); + g_printerr ("Failed to get proxy to ConfigurationManager\n"); return FALSE; } - + g_print ("DBus connected to ConfigurationManager\n"); dbus_g_proxy_add_signal (configurationManagerProxy, "accountsChanged", G_TYPE_INVALID); dbus_g_proxy_connect_signal (configurationManagerProxy, @@ -375,12 +384,16 @@ dbus_place_call (const call_t * c) gchar ** dbus_account_list() { + g_print("Before"); + GError *error = NULL; char ** array; org_sflphone_SFLphone_ConfigurationManager_get_account_list ( configurationManagerProxy, &array, &error); + + g_print("After"); if (error) { g_printerr ("Failed to call get_account_list() on ConfigurationManager: %s\n", @@ -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"); + } +} diff --git a/sflphone-gtk/src/dbus.h b/sflphone-gtk/src/dbus.h index a80ccfc4b3223bac94e68299b86e09d259236686..a663ee7806459346a0a12ffacb10f5a6888929dd 100644 --- a/sflphone-gtk/src/dbus.h +++ b/sflphone-gtk/src/dbus.h @@ -1,6 +1,6 @@ /* * 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 * 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); gdouble dbus_get_volume(const gchar * device); void dbus_play_dtmf(const gchar * key); +/* Instance */ +void dbus_register( int pid, gchar * name); +void dbus_unregister(int pid); + + + #endif diff --git a/sflphone-gtk/src/dialpad.c b/sflphone-gtk/src/dialpad.c index 7c82739ca0ebdc48d130266e18a6a31d6c3d4067..cffeaa0999523bff07c52e1c90f3654c537de623 100644 --- a/sflphone-gtk/src/dialpad.c +++ b/sflphone-gtk/src/dialpad.c @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by diff --git a/sflphone-gtk/src/dialpad.h b/sflphone-gtk/src/dialpad.h index 82047abdda7eccc9a182006771f6a188db2f80de..2a600534f09ecf57dabb5cf1b74459f1230dbacd 100644 --- a/sflphone-gtk/src/dialpad.h +++ b/sflphone-gtk/src/dialpad.h @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by diff --git a/sflphone-gtk/src/main.c b/sflphone-gtk/src/main.c index 50812f5ca79cf1642a07dd15d613c94df7410790..d54bfcbf21da3ad6bce9ebcef51bf39fd132d31e 100644 --- a/sflphone-gtk/src/main.c +++ b/sflphone-gtk/src/main.c @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by diff --git a/sflphone-gtk/src/mainwindow.c b/sflphone-gtk/src/mainwindow.c index 9852a791a35936067987b51f4a2c2c0d57c7beb4..10b5deefeaf8f3ddf4ce3d35203c848750b143e1 100644 --- a/sflphone-gtk/src/mainwindow.c +++ b/sflphone-gtk/src/mainwindow.c @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by diff --git a/sflphone-gtk/src/mainwindow.h b/sflphone-gtk/src/mainwindow.h index 7e0f1265c44624c254cd0ece15333a4132799718..b9d9cebe3ee6c7294328f50faad7197bd4f0b02a 100644 --- a/sflphone-gtk/src/mainwindow.h +++ b/sflphone-gtk/src/mainwindow.h @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by diff --git a/sflphone-gtk/src/menus.c b/sflphone-gtk/src/menus.c index b63c39e057cb2cd1b6a51d58ecc69ed7e43731c9..1468f1208d4c181d6ef51aa1c40589edfa876ae8 100644 --- a/sflphone-gtk/src/menus.c +++ b/sflphone-gtk/src/menus.c @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by diff --git a/sflphone-gtk/src/menus.h b/sflphone-gtk/src/menus.h index dd24cf2a548d064df8da7495e39fb42891b05d51..e204ebe3239f09c8f854af2c30dd0c25f53cdeab 100644 --- a/sflphone-gtk/src/menus.h +++ b/sflphone-gtk/src/menus.h @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by diff --git a/sflphone-gtk/src/screen.c b/sflphone-gtk/src/screen.c index 4cb6a4d0704df7be44cc97322c5a03f39199487e..b5809fba72298b459287708257fd29b1690297bc 100644 --- a/sflphone-gtk/src/screen.c +++ b/sflphone-gtk/src/screen.c @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by diff --git a/sflphone-gtk/src/screen.h b/sflphone-gtk/src/screen.h index 5cc848e602a4799b20a5724a3cbc4bb36f371ed7..2e9c7852c5459337065c265a7b52dfd3cedc4672 100644 --- a/sflphone-gtk/src/screen.h +++ b/sflphone-gtk/src/screen.h @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by diff --git a/sflphone-gtk/src/sliders.c b/sflphone-gtk/src/sliders.c index 4bbc8e88a2d1d6cc079094ecf19ddcc189acbc21..5b6a497aa16d60c62830af48629b244ba50f1b70 100644 --- a/sflphone-gtk/src/sliders.c +++ b/sflphone-gtk/src/sliders.c @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by diff --git a/sflphone-gtk/src/sliders.h b/sflphone-gtk/src/sliders.h index a3ef0fcfb154771b1a7dbbf9a9481f02b2224e06..2a6f95dd5eeb5a6d4d2e3ca907faf84bdc22a442 100644 --- a/sflphone-gtk/src/sliders.h +++ b/sflphone-gtk/src/sliders.h @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by diff --git a/sflphone-gtk/src/statusicon.c b/sflphone-gtk/src/statusicon.c index 8848102723ccc188a454e8c919a15688b7a7e37a..c6c9f8c494e354fcdb9424d3c61ef630af167108 100644 --- a/sflphone-gtk/src/statusicon.c +++ b/sflphone-gtk/src/statusicon.c @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by diff --git a/sflphone-gtk/src/statusicon.h b/sflphone-gtk/src/statusicon.h index 04fea7a67fa08eb7b9015caaf7c7fb9782051bbf..47247c71ca49be3669c4d525971867bdcaaa27f8 100644 --- a/sflphone-gtk/src/statusicon.h +++ b/sflphone-gtk/src/statusicon.h @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by diff --git a/src/dbus/Makefile.am b/src/dbus/Makefile.am index f6d309e0bbe52ad537dacc95dddff16ccc10bef8..a4e411715bc109401eeaf3df5de59c2b564d48b0 100644 --- a/src/dbus/Makefile.am +++ b/src/dbus/Makefile.am @@ -5,8 +5,9 @@ EXTRA_DIST = *.xml README noinst_LTLIBRARIES = libdbus.la libdbus_la_SOURCES = \ - callmanager.cpp \ + callmanager.cpp \ configurationmanager.cpp \ + instance.cpp \ dbusmanagerimpl.cpp libdbus_la_CXXFLAGS = -DPREFIX=\"$(prefix)\" -DPROGSHAREDIR=\"${datadir}/sflphone\" @@ -17,5 +18,18 @@ noinst_HEADERS = \ callmanager-glue.h \ callmanager.h \ configurationmanager.h \ + configurationmanager-glue.h \ + instance.h \ + instance-glue.h \ dbusmanager.h \ dbusmanagerimpl.h + +# Dbus service file +servicedir = $(DBUS_SERVICES_DIR) +service_in_files = org.sflphone.SFLphone.service.in +service_DATA = $(service_in_files:.service.in=.service) + +# Rule to make the service file with bindir expanded +$(service_DATA): $(service_in_files) Makefile + sed -e "s|bindir|$(prefix)/libexec|" $<> $@ + diff --git a/src/dbus/callmanager.cpp b/src/dbus/callmanager.cpp index 70bdeabb3b69f26dbdd33bf4fef28d11f1682865..6e03ca8381e0ad2100472aa8c6f985aea86525f2 100644 --- a/src/dbus/callmanager.cpp +++ b/src/dbus/callmanager.cpp @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> + * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> * Author: Alexandre Bourget <alexandre.bourget@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify diff --git a/src/dbus/callmanager.h b/src/dbus/callmanager.h index f52d8ed6015bd929bae95d1e87bde76448f4af02..e55e2b6fe0329e7831aefbef3d9386f3e491d0e9 100644 --- a/src/dbus/callmanager.h +++ b/src/dbus/callmanager.h @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by diff --git a/src/dbus/configurationmanager.cpp b/src/dbus/configurationmanager.cpp index 1de8988827eb7c80f2bd9c976e3c0db488677146..601408a350b539b78f8ba584dea72e3efd2a3bed 100644 --- a/src/dbus/configurationmanager.cpp +++ b/src/dbus/configurationmanager.cpp @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by diff --git a/src/dbus/configurationmanager.h b/src/dbus/configurationmanager.h index 53b84ff39c7baaa88822e135927f068c1f4157af..394a319b92346b213792942a466c379f5a7b680c 100644 --- a/src/dbus/configurationmanager.h +++ b/src/dbus/configurationmanager.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2007 Savoir-Faire Linux inc. - * Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com> + * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> * Author: Alexandre Bourget <alexandre.bourget@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify diff --git a/src/dbus/dbusmanager.h b/src/dbus/dbusmanager.h index 2b096ac3fc2fbc086c6b9ba8ae2aea8d3e10950b..a4f847a613b1e761879caa610551dee3dbb0faa7 100644 --- a/src/dbus/dbusmanager.h +++ b/src/dbus/dbusmanager.h @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by diff --git a/src/dbus/dbusmanagerimpl.cpp b/src/dbus/dbusmanagerimpl.cpp index c5a2e50e68b0a86024526b7e8428eb317e542d5d..b0c6434b253505834f8dd0175ea4bdcc6c326503 100644 --- a/src/dbus/dbusmanagerimpl.cpp +++ b/src/dbus/dbusmanagerimpl.cpp @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by @@ -32,6 +32,7 @@ DBusManagerImpl::exec(){ _callManager = new CallManager(conn); _configurationManager = new ConfigurationManager(conn); + _instanceManager = new Instance(conn); // Register accounts Manager::instance().initRegisterAccounts(); //getEvents(); @@ -42,4 +43,9 @@ DBusManagerImpl::exec(){ return 1; } - +void +DBusManagerImpl::exit() +{ + _dispatcher.leave(); +} + diff --git a/src/dbus/dbusmanagerimpl.h b/src/dbus/dbusmanagerimpl.h index a08802afa5baa1485a9274eee78f4035d029ac20..0e5fd999dd5868efe51fb05c5768eb3e95e2a4ea 100644 --- a/src/dbus/dbusmanagerimpl.h +++ b/src/dbus/dbusmanagerimpl.h @@ -1,6 +1,6 @@ /* * 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 * it under the terms of the GNU General Public License as published by @@ -22,18 +22,21 @@ #include "callmanager.h" #include "configurationmanager.h" +#include "instance.h" class DBusManagerImpl { public: CallManager * getCallManager(){ return _callManager; }; ConfigurationManager * getConfigurationManager(){ return _configurationManager; }; int exec(); + void exit(); static const char* SERVER_NAME; private: - CallManager * _callManager; - ConfigurationManager * _configurationManager; - DBus::BusDispatcher _dispatcher; + CallManager* _callManager; + ConfigurationManager* _configurationManager; + Instance* _instanceManager; + DBus::BusDispatcher _dispatcher; }; #endif diff --git a/src/dbus/instance-glue.h b/src/dbus/instance-glue.h new file mode 100644 index 0000000000000000000000000000000000000000..5032d811b1361b70e019a891e8bdf26723e046f7 --- /dev/null +++ b/src/dbus/instance-glue.h @@ -0,0 +1,109 @@ + +/* + * This file was automatically generated by dbusxx-xml2cpp; DO NOT EDIT! + */ + +#ifndef __dbusxx__instance_glue_h__ADAPTOR_MARSHAL_H +#define __dbusxx__instance_glue_h__ADAPTOR_MARSHAL_H + +#include <dbus-c++/dbus.h> + +namespace org { +namespace sflphone { +namespace SFLphone { + +class Instance +: public ::DBus::InterfaceAdaptor +{ +public: + + Instance() + : ::DBus::InterfaceAdaptor("org.sflphone.SFLphone.Instance") + { + register_method(Instance, Register, _Register_stub); + register_method(Instance, Unregister, _Unregister_stub); + } + + ::DBus::IntrospectedInterface* const introspect() const + { + static ::DBus::IntrospectedArgument Register_args[] = + { + { "pid", "i", true }, + { "name", "s", true }, + { 0, 0, 0 } + }; + static ::DBus::IntrospectedArgument Unregister_args[] = + { + { "pid", "i", true }, + { 0, 0, 0 } + }; + static ::DBus::IntrospectedMethod Instance_methods[] = + { + { "Register", Register_args }, + { "Unregister", Unregister_args }, + { 0, 0 } + }; + static ::DBus::IntrospectedMethod Instance_signals[] = + { + { 0, 0 } + }; + static ::DBus::IntrospectedProperty Instance_properties[] = + { + { 0, 0, 0, 0 } + }; + static ::DBus::IntrospectedInterface Instance_interface = + { + "org.sflphone.SFLphone.Instance", + Instance_methods, + Instance_signals, + Instance_properties + }; + return &Instance_interface; + } + +public: + + /* properties exposed by this interface, use + * property() and property(value) to get and set a particular property + */ + +public: + + /* methods exported by this interface, + * you will have to implement them in your ObjectAdaptor + */ + virtual void Register( const ::DBus::Int32& pid, const ::DBus::String& name ) = 0; + virtual void Unregister( const ::DBus::Int32& pid ) = 0; + +public: + + /* signal emitters for this interface + */ + +private: + + /* unmarshalers (to unpack the DBus message before calling the actual interface method) + */ + ::DBus::Message _Register_stub( const ::DBus::CallMessage& call ) + { + ::DBus::MessageIter ri = call.reader(); + + ::DBus::Int32 argin1; ri >> argin1; + ::DBus::String argin2; ri >> argin2; + Register(argin1, argin2); + ::DBus::ReturnMessage reply(call); + return reply; + } + ::DBus::Message _Unregister_stub( const ::DBus::CallMessage& call ) + { + ::DBus::MessageIter ri = call.reader(); + + ::DBus::Int32 argin1; ri >> argin1; + Unregister(argin1); + ::DBus::ReturnMessage reply(call); + return reply; + } +}; + +} } } +#endif//__dbusxx__instance_glue_h__ADAPTOR_MARSHAL_H diff --git a/src/dbus/instance-introspec.xml b/src/dbus/instance-introspec.xml new file mode 100644 index 0000000000000000000000000000000000000000..404dff31f2abbdee63e28fb3b31730a77b6ad6f0 --- /dev/null +++ b/src/dbus/instance-introspec.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" ?> +<node name="/org/sflphone/SFLphone"> + <interface name="org.sflphone.SFLphone.Instance"> + + <method name="Register"> + <arg type="i" name="pid" direction="in"/> + <arg type="s" name="name" direction="in"/> + </method> + + <method name="Unregister"> + <arg type="i" name="pid" direction="in"/> + </method> + + </interface> +</node> diff --git a/src/dbus/instance.cpp b/src/dbus/instance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..62d72b4a64553e7400fdacef0aaaa858597ac98c --- /dev/null +++ b/src/dbus/instance.cpp @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2007 Savoir-Faire Linux inc. + * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#include <global.h> +#include <instance.h> +#include "../manager.h" + +const char* Instance::SERVER_PATH = "/org/sflphone/SFLphone/Instance"; + +Instance::Instance( DBus::Connection& connection ) +: DBus::ObjectAdaptor(connection, SERVER_PATH) +{ + count = 0; +} + +void +Instance::Register( const ::DBus::Int32& pid, + const ::DBus::String& name ) +{ + _debug("Instance::register received\n"); + count++; +} + + +void +Instance::Unregister( const ::DBus::Int32& pid ) +{ + _debug("Instance::unregister received\n"); + count --; + if(count <= 0) + { + _debug("0 client running, quitting..."); + DBusManager::instance().exit(); + } +} + + diff --git a/src/dbus/instance.h b/src/dbus/instance.h new file mode 100644 index 0000000000000000000000000000000000000000..65e53d06ff8a9aec17e3dc79b75ac2cc418d4b98 --- /dev/null +++ b/src/dbus/instance.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2007 Savoir-Faire Linux inc. + * Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info> + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef INSTANCE_H +#define INSTANCE_H + +#include "instance-glue.h" +#include <dbus-c++/dbus.h> + + +class Instance +: public org::sflphone::SFLphone::Instance, + public DBus::IntrospectableAdaptor, + public DBus::ObjectAdaptor +{ +private: + int count; + +public: + Instance(DBus::Connection& connection); + static const char* SERVER_PATH; + + void Register( const ::DBus::Int32& pid, const ::DBus::String& name ); + void Unregister( const ::DBus::Int32& pid ); + + +}; + + +#endif//INSTANCE_H diff --git a/src/dbus/org.sflphone.SFLphone.service.in b/src/dbus/org.sflphone.SFLphone.service.in new file mode 100644 index 0000000000000000000000000000000000000000..031173b777cc5a516d135beb81ebd312322f860e --- /dev/null +++ b/src/dbus/org.sflphone.SFLphone.service.in @@ -0,0 +1,3 @@ +[D-BUS Service] +Name=org.sflphone.SFLphone +Exec=bindir/sflphoned diff --git a/src/managerimpl.cpp b/src/managerimpl.cpp index 70bda7043309bd2400d5d8829dbb2278017579f6..d07b7d605dc0f31a9ce0002748ddbfec8ffa0c73 100644 --- a/src/managerimpl.cpp +++ b/src/managerimpl.cpp @@ -1758,6 +1758,10 @@ ManagerImpl::addAccount(const std::map< ::DBus::String, ::DBus::String >& detail _accountMap[newAccountID] = newAccount; setAccountDetails(accountID.str(), details); + + saveConfig(); + + if (_dbus) _dbus->getConfigurationManager()->accountsChanged(); } void @@ -1775,6 +1779,8 @@ ManagerImpl::removeAccount(const AccountID& accountID) _config.removeSection(accountID); saveConfig(); + + if (_dbus) _dbus->getConfigurationManager()->accountsChanged(); } //THREAD=Main diff --git a/src/sipvoiplink.cpp b/src/sipvoiplink.cpp index fa531eb28b14cc3a18df007ecd0ebede543799d9..9d1a0f5cf74d4310dd9af7fe82e6deef70ca5e59 100644 --- a/src/sipvoiplink.cpp +++ b/src/sipvoiplink.cpp @@ -69,8 +69,8 @@ SIPVoIPLink::SIPVoIPLink(const AccountID& accountID) SIPVoIPLink::~SIPVoIPLink() { - delete _evThread; _evThread = 0; terminate(); + delete _evThread; _evThread = 0; } bool