diff options
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-chat-window.c | 55 | ||||
-rw-r--r-- | libempathy-gtk/empathy-chat.c | 4 | ||||
-rw-r--r-- | libempathy-gtk/empathy-contact-list-store.c | 20 | ||||
-rw-r--r-- | libempathy-gtk/empathy-contact-list-view.c | 3 | ||||
-rw-r--r-- | libempathy-gtk/empathy-contact-widget.c | 10 | ||||
-rw-r--r-- | libempathy-gtk/empathy-main-window.c | 6 | ||||
-rw-r--r-- | libempathy-gtk/empathy-presence-chooser.c | 6 |
7 files changed, 30 insertions, 74 deletions
diff --git a/libempathy-gtk/empathy-chat-window.c b/libempathy-gtk/empathy-chat-window.c index 6535500de..54e896263 100644 --- a/libempathy-gtk/empathy-chat-window.c +++ b/libempathy-gtk/empathy-chat-window.c @@ -60,8 +60,6 @@ #define DEBUG_DOMAIN "ChatWindow" -#define URGENCY_TIMEOUT 60*1000 - struct _EmpathyChatWindowPriv { EmpathyChatroomManager *chatroom_manager; GList *chats; @@ -73,8 +71,6 @@ struct _EmpathyChatWindowPriv { gboolean page_added; gboolean dnd_same_window; - guint urgency_timeout_id; - GtkWidget *dialog; GtkWidget *notebook; @@ -510,10 +506,6 @@ empathy_chat_window_finalize (GObject *object) g_source_remove (priv->save_geometry_id); } - if (priv->urgency_timeout_id != 0) { - g_source_remove (priv->urgency_timeout_id); - } - chat_windows = g_list_remove (chat_windows, window); gtk_widget_destroy (priv->dialog); g_object_unref (priv->tooltips); @@ -954,9 +946,9 @@ chat_window_configure_event_cb (GtkWidget *widget, } priv->save_geometry_id = - g_timeout_add (500, - (GSourceFunc) chat_window_save_geometry_timeout_cb, - window); + g_timeout_add_seconds (1, + (GSourceFunc) chat_window_save_geometry_timeout_cb, + window); return FALSE; } @@ -1690,21 +1682,6 @@ chat_window_drag_data_received (GtkWidget *widget, } } -static gboolean -chat_window_urgency_timeout_func (EmpathyChatWindow *window) -{ - EmpathyChatWindowPriv *priv; - - priv = GET_PRIV (window); - - empathy_debug (DEBUG_DOMAIN, "Turning off urgency hint"); - gtk_window_set_urgency_hint (GTK_WINDOW (priv->dialog), FALSE); - - priv->urgency_timeout_id = 0; - - return FALSE; -} - static void chat_window_set_urgency_hint (EmpathyChatWindow *window, gboolean urgent) @@ -1713,29 +1690,9 @@ chat_window_set_urgency_hint (EmpathyChatWindow *window, priv = GET_PRIV (window); - if (!urgent) { - /* Remove any existing hint and timeout. */ - if (priv->urgency_timeout_id) { - empathy_debug (DEBUG_DOMAIN, "Turning off urgency hint"); - gtk_window_set_urgency_hint (GTK_WINDOW (priv->dialog), FALSE); - g_source_remove (priv->urgency_timeout_id); - priv->urgency_timeout_id = 0; - } - return; - } - - /* Add a new hint and renew any exising timeout or add a new one. */ - if (priv->urgency_timeout_id) { - g_source_remove (priv->urgency_timeout_id); - } else { - empathy_debug (DEBUG_DOMAIN, "Turning on urgency hint"); - gtk_window_set_urgency_hint (GTK_WINDOW (priv->dialog), TRUE); - } - - priv->urgency_timeout_id = g_timeout_add ( - URGENCY_TIMEOUT, - (GSourceFunc) chat_window_urgency_timeout_func, - window); + empathy_debug (DEBUG_DOMAIN, "Turning %s urgency hint", + urgent ? "on" : "off"); + gtk_window_set_urgency_hint (GTK_WINDOW (priv->dialog), urgent); } EmpathyChatWindow * diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c index c98cc12df..f68a82826 100644 --- a/libempathy-gtk/empathy-chat.c +++ b/libempathy-gtk/empathy-chat.c @@ -1029,8 +1029,8 @@ chat_composing_start (EmpathyChat *chat) TP_CHANNEL_CHAT_STATE_COMPOSING); } - priv->composing_stop_timeout_id = g_timeout_add ( - 1000 * COMPOSING_STOP_TIMEOUT, + priv->composing_stop_timeout_id = g_timeout_add_seconds ( + COMPOSING_STOP_TIMEOUT, (GSourceFunc) chat_composing_stop_timeout_cb, chat); } diff --git a/libempathy-gtk/empathy-contact-list-store.c b/libempathy-gtk/empathy-contact-list-store.c index 6ca5c60a1..8638ce12e 100644 --- a/libempathy-gtk/empathy-contact-list-store.c +++ b/libempathy-gtk/empathy-contact-list-store.c @@ -43,11 +43,11 @@ * (e.g. online, offline or from normal to a busy state). */ -/* Time user is shown as active */ -#define ACTIVE_USER_SHOW_TIME 7000 +/* Time in seconds user is shown as active */ +#define ACTIVE_USER_SHOW_TIME 7 -/* Time after connecting which we wait before active users are enabled */ -#define ACTIVE_USER_WAIT_TO_ENABLE_TIME 5000 +/* Time in seconds after connecting which we wait before active users are enabled */ +#define ACTIVE_USER_WAIT_TO_ENABLE_TIME 5 #define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_CONTACT_LIST_STORE, EmpathyContactListStorePriv)) @@ -220,9 +220,9 @@ empathy_contact_list_store_init (EmpathyContactListStore *store) priv = GET_PRIV (store); priv->show_avatars = TRUE; - priv->inhibit_active = g_timeout_add (ACTIVE_USER_WAIT_TO_ENABLE_TIME, - (GSourceFunc) contact_list_store_inibit_active_cb, - store); + priv->inhibit_active = g_timeout_add_seconds (ACTIVE_USER_WAIT_TO_ENABLE_TIME, + (GSourceFunc) contact_list_store_inibit_active_cb, + store); } static void @@ -984,9 +984,9 @@ contact_list_store_contact_update (EmpathyContactListStore *store, if (do_set_active) { data = contact_list_store_contact_active_new (store, contact, do_remove); - g_timeout_add (ACTIVE_USER_SHOW_TIME, - (GSourceFunc) contact_list_store_contact_active_cb, - data); + g_timeout_add_seconds (ACTIVE_USER_SHOW_TIME, + (GSourceFunc) contact_list_store_contact_active_cb, + data); } } diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c index e3816dda7..a30298e3a 100644 --- a/libempathy-gtk/empathy-contact-list-view.c +++ b/libempathy-gtk/empathy-contact-list-view.c @@ -891,8 +891,7 @@ contact_list_view_drag_motion (GtkWidget *widget, dm->view = EMPATHY_CONTACT_LIST_VIEW (widget); dm->path = gtk_tree_path_copy (path); - dm->timeout_id = g_timeout_add ( - 1500, + dm->timeout_id = g_timeout_add_seconds (1, (GSourceFunc) contact_list_view_drag_motion_cb, dm); } diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c index afd434f3f..34a8023fe 100644 --- a/libempathy-gtk/empathy-contact-widget.c +++ b/libempathy-gtk/empathy-contact-widget.c @@ -42,8 +42,8 @@ #include "empathy-avatar-image.h" #include "empathy-ui-utils.h" -/* Delay before updating the widget when the id entry changed (ms) */ -#define ID_CHANGED_TIMEOUT 500 +/* Delay before updating the widget when the id entry changed (seconds) */ +#define ID_CHANGED_TIMEOUT 1 typedef struct { EmpathyContactFactory *factory; @@ -329,9 +329,9 @@ contact_widget_id_changed_cb (GtkEntry *entry, } self->widget_id_timeout = - g_timeout_add (ID_CHANGED_TIMEOUT, - (GSourceFunc) contact_widget_id_activate_timeout, - self); + g_timeout_add_seconds (ID_CHANGED_TIMEOUT, + (GSourceFunc) contact_widget_id_activate_timeout, + self); } static void diff --git a/libempathy-gtk/empathy-main-window.c b/libempathy-gtk/empathy-main-window.c index 7543c456e..8883fa306 100644 --- a/libempathy-gtk/empathy-main-window.c +++ b/libempathy-gtk/empathy-main-window.c @@ -868,9 +868,9 @@ main_window_configure_event_cb (GtkWidget *widget, g_source_remove (window->size_timeout_id); } - window->size_timeout_id = g_timeout_add (500, - (GSourceFunc) main_window_configure_event_timeout_cb, - window); + window->size_timeout_id = g_timeout_add_seconds (1, + (GSourceFunc) main_window_configure_event_timeout_cb, + window); return FALSE; } diff --git a/libempathy-gtk/empathy-presence-chooser.c b/libempathy-gtk/empathy-presence-chooser.c index f3097abce..53993eaa3 100644 --- a/libempathy-gtk/empathy-presence-chooser.c +++ b/libempathy-gtk/empathy-presence-chooser.c @@ -367,9 +367,9 @@ presence_chooser_scroll_event_cb (EmpathyPresenceChooser *chooser, priv->scroll_state = sas->state; priv->scroll_timeout_id = - g_timeout_add (500, - (GSourceFunc) presence_chooser_scroll_timeout_cb, - chooser); + g_timeout_add_seconds (1, + (GSourceFunc) presence_chooser_scroll_timeout_cb, + chooser); presence_chooser_flash_stop (chooser, sas->state); gtk_label_set_text (GTK_LABEL (priv->label), sas->status); |