[empathy/gnome-2-34] individual-view: use our own RESPONSE enum



commit 251967fd833d753f2f4b30afb437d9cbc43dd89a
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Mon Mar 14 14:58:55 2011 +0100

    individual-view: use our own RESPONSE enum
    
    This code was too confusing when using GTK_RESPONSE_*

 libempathy-gtk/empathy-individual-view.c |   22 ++++++++++++++++------
 1 files changed, 16 insertions(+), 6 deletions(-)
---
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c
index 3d8f00a..cb96d2e 100644
--- a/libempathy-gtk/empathy-individual-view.c
+++ b/libempathy-gtk/empathy-individual-view.c
@@ -2226,6 +2226,13 @@ empathy_individual_view_get_selected_group (EmpathyIndividualView *view,
   return name;
 }
 
+enum
+{
+  REMOVE_DIALOG_RESPONSE_CANCEL = 0,
+  REMOVE_DIALOG_RESPONSE_DELETE,
+  REMOVE_DIALOG_RESPONSE_DELETE_AND_BLOCK,
+};
+
 static int
 individual_view_remove_dialog_show (GtkWindow *parent,
     const gchar *message,
@@ -2248,14 +2255,15 @@ individual_view_remove_dialog_show (GtkWindow *parent,
           _("Delete and _Block"));
 
       gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button,
-          GTK_RESPONSE_REJECT);
+          REMOVE_DIALOG_RESPONSE_DELETE_AND_BLOCK);
 
       gtk_widget_show (button);
     }
 
   gtk_dialog_add_buttons (GTK_DIALOG (dialog),
-      GTK_STOCK_CANCEL, GTK_RESPONSE_NO,
-      GTK_STOCK_REMOVE, GTK_RESPONSE_YES, NULL);
+      GTK_STOCK_CANCEL, REMOVE_DIALOG_RESPONSE_CANCEL,
+      GTK_STOCK_DELETE, REMOVE_DIALOG_RESPONSE_DELETE, NULL);
+
   gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
       "%s", secondary_text);
 
@@ -2284,7 +2292,7 @@ individual_view_group_remove_activate_cb (GtkMenuItem *menuitem,
           group);
       parent = empathy_get_toplevel_window (GTK_WIDGET (view));
       if (individual_view_remove_dialog_show (parent, _("Removing group"),
-              text, FALSE) == GTK_RESPONSE_YES)
+              text, FALSE) == REMOVE_DIALOG_RESPONSE_DELETE)
         {
           EmpathyIndividualManager *manager =
               empathy_individual_manager_dup_singleton ();
@@ -2380,11 +2388,13 @@ individual_view_remove_activate_cb (GtkMenuItem *menuitem,
           folks_alias_details_get_alias (FOLKS_ALIAS_DETAILS (individual)));
       res = individual_view_remove_dialog_show (parent, _("Removing contact"),
               text, can_block);
-      if (res == GTK_RESPONSE_YES || res == GTK_RESPONSE_REJECT)
+
+      if (res == REMOVE_DIALOG_RESPONSE_DELETE ||
+          res == REMOVE_DIALOG_RESPONSE_DELETE_AND_BLOCK)
         {
           gboolean abusive;
 
-          if (res == GTK_RESPONSE_REJECT &&
+          if (res == REMOVE_DIALOG_RESPONSE_DELETE_AND_BLOCK &&
               empathy_block_individual_dialog_show (parent, individual,
                 &abusive))
             {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]