From 81068bbf3ebd6c251f308d6d45e4dadf07432ea7 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 30 Nov 2010 11:24:20 +0100 Subject: move sound functions to EmpathySoundManager methods --- src/empathy-main-window.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/empathy-main-window.c') diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c index 8b9661838..db5818c0c 100644 --- a/src/empathy-main-window.c +++ b/src/empathy-main-window.c @@ -107,6 +107,7 @@ struct _EmpathyMainWindowPriv { TpAccountManager *account_manager; EmpathyChatroomManager *chatroom_manager; EmpathyEventManager *event_manager; + EmpathySoundManager *sound_mgr;; guint flash_timeout_id; gboolean flash_on; gboolean empty; @@ -639,6 +640,8 @@ main_window_connection_changed_cb (TpAccount *account, GHashTable *details, EmpathyMainWindow *window) { + EmpathyMainWindowPriv *priv = GET_PRIV (window); + main_window_update_status (window); if (current == TP_CONNECTION_STATUS_DISCONNECTED && @@ -647,12 +650,12 @@ main_window_connection_changed_cb (TpAccount *account, } if (current == TP_CONNECTION_STATUS_DISCONNECTED) { - empathy_sound_play (GTK_WIDGET (window), + empathy_sound_manager_play (priv->sound_mgr, GTK_WIDGET (window), EMPATHY_SOUND_ACCOUNT_DISCONNECTED); } if (current == TP_CONNECTION_STATUS_CONNECTED) { - empathy_sound_play (GTK_WIDGET (window), + empathy_sound_manager_play (priv->sound_mgr, GTK_WIDGET (window), EMPATHY_SOUND_ACCOUNT_CONNECTED); /* Account connected without error, remove error message if any */ @@ -706,6 +709,7 @@ empathy_main_window_finalize (GObject *window) g_object_unref (priv->account_manager); g_object_unref (priv->individual_store); g_object_unref (priv->contact_manager); + g_object_unref (priv->sound_mgr); g_hash_table_destroy (priv->errors); /* disconnect all handlers of status-changed signal */ @@ -1576,6 +1580,8 @@ empathy_main_window_init (EmpathyMainWindow *window) priv->gsettings_ui = g_settings_new (EMPATHY_PREFS_UI_SCHEMA); priv->gsettings_contacts = g_settings_new (EMPATHY_PREFS_CONTACTS_SCHEMA); + priv->sound_mgr = empathy_sound_manager_dup_singleton (); + gtk_window_set_title (GTK_WINDOW (window), _("Contact List")); gtk_window_set_role (GTK_WINDOW (window), "contact_list"); gtk_window_set_default_size (GTK_WINDOW (window), 225, 325); -- cgit v1.2.3