]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-contact-list-view.c
Move the event manager to src/
[empathy.git] / libempathy-gtk / empathy-contact-list-view.c
index 60a4d845f4836dfa2cf4ec4970522af25525d37c..dd3dc54a6d5d5d682189711a42c6cd85e490c2fe 100644 (file)
@@ -53,9 +53,6 @@
 #define DEBUG_FLAG EMPATHY_DEBUG_CONTACT
 #include <libempathy/empathy-debug.h>
 
-/* Flashing delay for icons (milliseconds). */
-#define FLASH_TIMEOUT 500
-
 /* Active users are those which have recently changed state
  * (e.g. online, offline or from normal to a busy state).
  */
@@ -132,7 +129,7 @@ contact_list_view_query_tooltip_cb (EmpathyContactListView *view,
        GtkTreePath                *path;
 
        /* FIXME: We need GTK version >= 2.12.10. See GNOME bug #504087 */
-       if (100 * gtk_minor_version + gtk_micro_version < 1210) {
+       if (gtk_check_version (2, 12, 10)) {
                return FALSE;
        }
 
@@ -519,21 +516,22 @@ contact_list_view_row_activated_cb (EmpathyContactListView *view,
        GtkTreeModel               *model;
        GtkTreeIter                 iter;
 
-       if (!(priv->contact_features & EMPATHY_CONTACT_FEATURE_CHAT)) {
-               return;
-       }
-
-       model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
-
+       model = GTK_TREE_MODEL (priv->store);
        gtk_tree_model_get_iter (model, &iter, path);
        gtk_tree_model_get (model, &iter,
                            EMPATHY_CONTACT_LIST_STORE_COL_CONTACT, &contact,
                            -1);
 
-       if (contact) {
+       if (!contact) {
+               return;
+       }
+
+       /* There is no event for the contact, default action is starting a chat */
+       if (priv->contact_features & EMPATHY_CONTACT_FEATURE_CHAT) {
                empathy_dispatcher_chat_with_contact (contact);
-               g_object_unref (contact);
        }
+
+       g_object_unref (contact);
 }
 
 static void
@@ -951,7 +949,7 @@ contact_list_view_set_list_features (EmpathyContactListView         *view,
                                   G_N_ELEMENTS (drag_types_dest),
                                   GDK_ACTION_MOVE | GDK_ACTION_COPY);
        } else {
-               /* FIXME: URI could still be  droped depending on FT feature */
+               /* FIXME: URI could still be droped depending on FT feature */
                gtk_drag_dest_unset (GTK_WIDGET (view));
        }
 
@@ -1200,8 +1198,8 @@ contact_list_view_remove_dialog_show (GtkWindow   *parent,
        
        dialog = gtk_dialog_new_with_buttons (window_title, parent,
                                              GTK_DIALOG_MODAL,
+                                             GTK_STOCK_CANCEL, GTK_RESPONSE_NO,
                                              GTK_STOCK_DELETE, GTK_RESPONSE_YES,
-                                             GTK_STOCK_CANCEL, GTK_RESPONSE_NO,
                                              NULL);
        gtk_dialog_set_has_separator (GTK_DIALOG(dialog), FALSE);