empathy r2028 - in trunk: libempathy-gtk src
- From: xclaesse svn gnome org
- To: svn-commits-list gnome org
- Subject: empathy r2028 - in trunk: libempathy-gtk src
- Date: Tue, 6 Jan 2009 16:46:11 +0000 (UTC)
Author: xclaesse
Date: Tue Jan 6 16:46:11 2009
New Revision: 2028
URL: http://svn.gnome.org/viewvc/empathy?rev=2028&view=rev
Log:
Only play logout sound if switching to Offline from Available.
Modified:
trunk/libempathy-gtk/empathy-ui-utils.c
trunk/src/empathy-main-window.c
Modified: trunk/libempathy-gtk/empathy-ui-utils.c
==============================================================================
--- trunk/libempathy-gtk/empathy-ui-utils.c (original)
+++ trunk/libempathy-gtk/empathy-ui-utils.c Tue Jan 6 16:46:11 2009
@@ -1513,7 +1513,6 @@
presence = empathy_idle_get_state (idle);
g_object_unref (idle);
-
if (presence != MC_PRESENCE_AVAILABLE &&
presence != MC_PRESENCE_UNSET) {
empathy_conf_get_bool (conf, EMPATHY_PREFS_SOUNDS_DISABLED_AWAY,
Modified: trunk/src/empathy-main-window.c
==============================================================================
--- trunk/src/empathy-main-window.c (original)
+++ trunk/src/empathy-main-window.c Tue Jan 6 16:46:11 2009
@@ -1116,7 +1116,9 @@
const gchar *unique_name,
EmpathyMainWindow *window)
{
- McAccount *account;
+ McAccount *account;
+ McPresence old_state;
+ EmpathyIdle *idle;
main_window_update_status (window);
@@ -1174,7 +1176,14 @@
main_window_error_display (window, account, message);
}
+ idle = empathy_idle_new ();
+ old_state = empathy_idle_get_state (idle);
+
+ /* play the sound only when the state changes from the current to
+ * UNSET, as we receive this signal two times when disconnecting.
+ */
if (status == TP_CONNECTION_STATUS_DISCONNECTED &&
+ old_state != MC_PRESENCE_UNSET &&
empathy_sound_pref_is_enabled (EMPATHY_PREFS_SOUNDS_SERVICE_LOGOUT)) {
ca_gtk_play_for_widget (GTK_WIDGET (window->window), 0,
CA_PROP_EVENT_ID, "service-logout",
@@ -1184,15 +1193,12 @@
if (status == TP_CONNECTION_STATUS_CONNECTED) {
GtkWidget *error_widget;
- EmpathyIdle *idle;
-
- idle = empathy_idle_new ();
/* emit the sound only on first connect, i.e. when the saved
* idle state is MC_PRESENCE_UNSET.
*/
- if (empathy_idle_get_state (idle) == MC_PRESENCE_UNSET &&
+ if (old_state == MC_PRESENCE_UNSET &&
empathy_sound_pref_is_enabled (EMPATHY_PREFS_SOUNDS_SERVICE_LOGIN)) {
ca_gtk_play_for_widget (GTK_WIDGET (window->window), 0,
CA_PROP_EVENT_ID, "service-login",
@@ -1200,8 +1206,6 @@
NULL);
}
- g_object_unref (idle);
-
/* Account connected without error, remove error message if any */
error_widget = g_hash_table_lookup (window->errors, account);
if (error_widget) {
@@ -1211,6 +1215,7 @@
}
g_object_unref (account);
+ g_object_unref (idle);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]