diff options
-rw-r--r-- | src/dbus-menu-manager.c | 2 | ||||
-rw-r--r-- | src/dbus-shared-names.h | 6 | ||||
-rw-r--r-- | src/indicator-sound.c | 35 | ||||
-rw-r--r-- | src/sound-service-dbus.c | 20 |
4 files changed, 34 insertions, 29 deletions
diff --git a/src/dbus-menu-manager.c b/src/dbus-menu-manager.c index e51db0d..92bfba5 100644 --- a/src/dbus-menu-manager.c +++ b/src/dbus-menu-manager.c @@ -68,7 +68,7 @@ DbusmenuMenuitem* dbus_menu_manager_setup() dbus_interface = g_object_new(SOUND_SERVICE_DBUS_TYPE, NULL); - DbusmenuServer *server = dbusmenu_server_new(INDICATOR_SOUND_DBUS_OBJECT); + DbusmenuServer *server = dbusmenu_server_new(INDICATOR_SOUND_MENU_DBUS_OBJECT_PATH); dbusmenu_server_set_root(server, root_menuitem); establish_pulse_activities(dbus_interface); return root_menuitem; diff --git a/src/dbus-shared-names.h b/src/dbus-shared-names.h index 1e117cf..bdc40cb 100644 --- a/src/dbus-shared-names.h +++ b/src/dbus-shared-names.h @@ -26,9 +26,9 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #define __DBUS_SHARED_NAMES_H__ 1 #define INDICATOR_SOUND_DBUS_NAME "com.canonical.indicators.sound" -#define INDICATOR_SOUND_DBUS_OBJECT "/com/canonical/indicators/sound/menu" -#define INDICATOR_SOUND_SERVICE_DBUS_OBJECT "/com/canonical/indicators/sound/service" -#define INDICATOR_SOUND_SERVICE_DBUS_INTERFACE "com.canonical.indicators.sound" +#define INDICATOR_SOUND_MENU_DBUS_OBJECT_PATH "/com/canonical/indicators/sound/menu" +#define INDICATOR_SOUND_SERVICE_DBUS_OBJECT_PATH "/com/canonical/indicators/sound/service" +#define INDICATOR_SOUND_DBUS_INTERFACE "com.canonical.indicators.sound" #define INDICATOR_SOUND_DBUS_VERSION 0 #define INDICATOR_SOUND_SIGNAL_SINK_INPUT_WHILE_MUTED "SinkInputWhileMuted" #define INDICATOR_SOUND_SIGNAL_SINK_MUTE_UPDATE "SinkMuteUpdate" diff --git a/src/indicator-sound.c b/src/indicator-sound.c index adccfdd..6512830 100644 --- a/src/indicator-sound.c +++ b/src/indicator-sound.c @@ -90,10 +90,10 @@ static void create_connection_to_service (GObject *source_object, static void connection_changed (IndicatorServiceManager * sm, gboolean connected, gpointer userdata); -static void g_signal_cb ( GDBusProxy *proxy, - const gchar *sender_name, - const gchar *signal_name, - GVariant *parameters, +static void g_signal_cb ( GDBusProxy* proxy, + gchar* sender_name, + gchar* signal_name, + GVariant* parameters, gpointer user_data); static void react_to_signal_sink_input_while_muted (gboolean value, @@ -242,7 +242,8 @@ get_icon (IndicatorObject * io) static GtkMenu * get_menu (IndicatorObject * io) { - DbusmenuGtkMenu* menu = dbusmenu_gtkmenu_new(INDICATOR_SOUND_DBUS_NAME, INDICATOR_SOUND_DBUS_OBJECT); + DbusmenuGtkMenu* menu = dbusmenu_gtkmenu_new(INDICATOR_SOUND_DBUS_NAME, + INDICATOR_SOUND_MENU_DBUS_OBJECT_PATH); DbusmenuGtkClient *client = dbusmenu_gtkmenu_get_client(menu); g_object_set_data (G_OBJECT (client), "indicator", io); @@ -404,9 +405,9 @@ connection_changed (IndicatorServiceManager * sm, if (interface_info == NULL) { interface_info = g_dbus_node_info_lookup_interface (node_info, - INDICATOR_SOUND_SERVICE_DBUS_INTERFACE); + INDICATOR_SOUND_DBUS_INTERFACE); if (interface_info == NULL) { - g_error("Unable to find interface '" INDICATOR_SOUND_SERVICE_DBUS_INTERFACE "'"); + g_error("Unable to find interface '" INDICATOR_SOUND_DBUS_INTERFACE "'"); } } @@ -414,8 +415,8 @@ connection_changed (IndicatorServiceManager * sm, G_DBUS_PROXY_FLAGS_NONE, interface_info, INDICATOR_SOUND_DBUS_NAME, - INDICATOR_SOUND_SERVICE_DBUS_OBJECT, - INDICATOR_SOUND_SERVICE_DBUS_INTERFACE, + INDICATOR_SOUND_MENU_DBUS_OBJECT_PATH, + INDICATOR_SOUND_DBUS_INTERFACE, NULL, create_connection_to_service, indicator ); @@ -439,8 +440,12 @@ static void create_connection_to_service (GObject *source_object, g_error_free(error); return; } - - g_signal_connect(priv->dbus_proxy, "g-signal", G_CALLBACK(g_signal_cb), self); + + g_debug ( "about to connect to g-signal "); + g_signal_connect(priv->dbus_proxy, "g-signal", + G_CALLBACK(g_signal_cb), self); + g_debug ( "after attempting to connect to g-signal "); + fetch_state (self); } @@ -688,10 +693,10 @@ reset_mute_blocking_animation() /*******************************************************************/ // DBUS Signal reactions /*******************************************************************/ -static void g_signal_cb ( GDBusProxy *proxy, - const gchar *sender_name, - const gchar *signal_name, - GVariant *parameters, +static void g_signal_cb ( GDBusProxy* proxy, + gchar* sender_name, + gchar* signal_name, + GVariant* parameters, gpointer user_data) { IndicatorSound *self = INDICATOR_SOUND(user_data); diff --git a/src/sound-service-dbus.c b/src/sound-service-dbus.c index d9db2b6..9490df8 100644 --- a/src/sound-service-dbus.c +++ b/src/sound-service-dbus.c @@ -93,10 +93,10 @@ sound_service_dbus_class_init (SoundServiceDbusClass *klass) if (interface_info == NULL) { interface_info = g_dbus_node_info_lookup_interface (node_info, - INDICATOR_SOUND_SERVICE_DBUS_INTERFACE); + INDICATOR_SOUND_DBUS_INTERFACE); if (interface_info == NULL) { - g_error("Unable to find interface '" INDICATOR_SOUND_SERVICE_DBUS_INTERFACE "'"); + g_error("Unable to find interface '" INDICATOR_SOUND_DBUS_INTERFACE "'"); } } } @@ -121,7 +121,7 @@ sound_service_dbus_init (SoundServiceDbus *self) } /* register the service on it */ g_dbus_connection_register_object (priv->connection, - INDICATOR_SOUND_SERVICE_DBUS_OBJECT, + INDICATOR_SOUND_SERVICE_DBUS_OBJECT_PATH, interface_info, &interface_table, self, @@ -195,9 +195,9 @@ void sound_service_dbus_sink_input_while_muted(SoundServiceDbus* obj, GError * error = NULL; g_dbus_connection_emit_signal( priv->connection, - INDICATOR_SOUND_DBUS_NAME, - INDICATOR_SOUND_DBUS_OBJECT, - INDICATOR_SOUND_SERVICE_DBUS_INTERFACE, + NULL, + INDICATOR_SOUND_MENU_DBUS_OBJECT_PATH, + INDICATOR_SOUND_DBUS_INTERFACE, INDICATOR_SOUND_SIGNAL_SINK_INPUT_WHILE_MUTED, v_output, &error ); @@ -219,8 +219,8 @@ void sound_service_dbus_update_sink_mute(SoundServiceDbus* obj, GError * error = NULL; g_dbus_connection_emit_signal( priv->connection, INDICATOR_SOUND_DBUS_NAME, - INDICATOR_SOUND_DBUS_OBJECT, - INDICATOR_SOUND_SERVICE_DBUS_INTERFACE, + INDICATOR_SOUND_MENU_DBUS_OBJECT_PATH, + INDICATOR_SOUND_DBUS_INTERFACE, INDICATOR_SOUND_SIGNAL_SINK_MUTE_UPDATE, v_output, &error ); @@ -243,8 +243,8 @@ void sound_service_dbus_update_sink_availability(SoundServiceDbus* obj, g_dbus_connection_emit_signal( priv->connection, INDICATOR_SOUND_DBUS_NAME, - INDICATOR_SOUND_DBUS_OBJECT, - INDICATOR_SOUND_SERVICE_DBUS_INTERFACE, + INDICATOR_SOUND_MENU_DBUS_OBJECT_PATH, + INDICATOR_SOUND_DBUS_INTERFACE, INDICATOR_SOUND_SIGNAL_SINK_AVAILABLE_UPDATE, v_output, &error ); |