Re: [Fwd: [Usability] No|Yes in logout]



Murray -

I applied your patch. I have two concerns.  

1. The order of the buttons with your patch becomes
[HELP][LOGOUT][CANCEL].  Shouldn't the order be [HELP][CANCEL][LOGOUT]? 
2. The [Logout] button does not have a mnemonic or an image, but the
[HELP] and [CANCEL] buttons do. 

Below I have added a modified patch to rearrange the order of the
buttons and add a mnemonic & image to the "Logout" button.

Thanks,
Dennis Cranston

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-session/gnome-session/ChangeLog,v
retrieving revision 1.269
diff -u -p -r1.269 ChangeLog
--- ChangeLog	2002/04/15 12:57:18	1.269
+++ ChangeLog	2002/04/17 06:11:51
@@ -1,3 +1,8 @@
+2002-04-16  Murray Cumming  <murrayc usa net>
+
+	* gnome-session/logout.c: Changed Logout dialog's
+	[No] [Yes] buttons to [Cancel] [Logout].
+
 2002-04-15  Mark McLoughlin  <mark skynet ie>
 
 	* save.c: (read_session): revert my previous fix.
Index: logout.c
===================================================================
RCS file: /cvs/gnome/gnome-session/gnome-session/logout.c,v
retrieving revision 1.27
diff -u -p -r1.27 logout.c
--- logout.c	2002/03/22 13:35:05	1.27
+++ logout.c	2002/04/17 06:11:55
@@ -195,6 +195,11 @@ display_gui (void)
   GtkWidget *halt = NULL;
   GtkWidget *reboot = NULL;
   GtkWidget *invisible;
+  GtkWidget *button;
+  GtkWidget *label;
+  GtkWidget *image;
+  GtkWidget *align;
+  GtkWidget *hbox;  
   gboolean   retval = FALSE;
 
   /* It's really bad here if someone else has the pointer
@@ -227,14 +232,33 @@ display_gui (void)
 
   box = gtk_message_dialog_new (NULL, 0,
 				GTK_MESSAGE_QUESTION,
-				GTK_BUTTONS_YES_NO,
+				GTK_BUTTONS_NONE,
 				_("Really log out?"));
 
+  gtk_dialog_add_button (GTK_DIALOG (box), GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL);
   gtk_dialog_add_button (GTK_DIALOG (box), GTK_STOCK_HELP,
GTK_RESPONSE_HELP);
+				
+  /* Add logout button with mnemonic and image */
+  button = gtk_button_new ();
+  label = gtk_label_new_with_mnemonic (_("_Logout"));
+  image = gtk_image_new_from_stock (GTK_STOCK_QUIT,
GTK_ICON_SIZE_BUTTON);
+  align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
+  hbox = gtk_hbox_new (FALSE, 2);
+  
+  gtk_label_set_mnemonic_widget (GTK_LABEL (label), GTK_WIDGET
(button));
+  gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
+  gtk_box_pack_end (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+  gtk_container_add (GTK_CONTAINER (button), align);
+  gtk_container_add (GTK_CONTAINER (align), hbox);
+  gtk_widget_show_all (align);
+    
+  gtk_dialog_add_action_widget (GTK_DIALOG (box), button,
GTK_RESPONSE_OK);
+  GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+  gtk_widget_show (button);
 		  	     
   g_object_set (G_OBJECT (box), "type", GTK_WINDOW_POPUP, NULL);
 
-  gtk_dialog_set_default_response (GTK_DIALOG (box), GTK_RESPONSE_NO);
+  gtk_dialog_set_default_response (GTK_DIALOG (box), GTK_RESPONSE_OK);
   gtk_window_set_position (GTK_WINDOW (box), GTK_WIN_POS_CENTER);
   gtk_window_set_policy (GTK_WINDOW (box), FALSE, FALSE, TRUE);
 
@@ -310,7 +334,7 @@ display_gui (void)
   gdk_flush ();
 
   switch (response) {
-    case GTK_RESPONSE_YES:
+    case GTK_RESPONSE_OK:
       /* We want to know if we should trash changes (and lose forever)
        * or save them */
       if(!autosave)
@@ -326,7 +350,7 @@ display_gui (void)
       retval = TRUE;
       break;
     default:
-    case GTK_RESPONSE_NO:
+    case GTK_RESPONSE_CANCEL:
       retval= FALSE;
       break;
     case GTK_RESPONSE_HELP:






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