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



This is my patch modified to use the wording "Log Out".

Thanks,
Dennis 

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 16:09:20
@@ -1,3 +1,10 @@
+2002-04-16  Dennis Cranston  <dennis_cranston yahoo com>
+
+	* gnome-session/logout.c: Applied modified patch
+	from Murray Cumming <murrayc usa net> to change 
+	logout dialog's [No] [Yes] buttons to 
+	[Cancel] [Log Out].
+
 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 16:09:23
@@ -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 (_("_Log Out"));
+  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);
 
@@ -271,7 +295,7 @@ display_gui (void)
       action_vbox = gtk_vbox_new (FALSE, 0);
       gtk_container_add (GTK_CONTAINER (frame), action_vbox);
 
-      r = gtk_radio_button_new_with_label (NULL, _("Logout"));
+      r = gtk_radio_button_new_with_label (NULL, _("Log Out"));
       gtk_box_pack_start (GTK_BOX (action_vbox), r, FALSE, FALSE, 0);
 
       r = halt = gtk_radio_button_new_with_label_from_widget
(GTK_RADIO_BUTTON (r), _("Shut Down"));
@@ -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]