[PATCH] gsm logout.c



Hi,
I've written a patch for logout.c in the session management, that doesn't add
anything, but just "neatens" it up a bit. Instead of having a checkbox (which
doesn't really act like a checkbox) for "Save current setup" I've moved it down
to make a 3rd button - "Save setup and logout". I've also changed the captions
on the buttons to "Save setup and logout", "Logout" and "Cancel logout", which
has been meantioned before as being better UI design than simple "Yes", "No"
buttons. It's patched against Gnome-core 1.1.0

Iain

diff -u2 projects/gsm/ChangeLog /usr/local/src/gnome/gnome-core-1.1.0/gsm/ChangeLog
--- projects/gsm/ChangeLog	Sun Oct 31 20:44:33 1999
+++ /usr/local/src/gnome/gnome-core-1.1.0/gsm/ChangeLog	Sun Oct 31 21:19:19 1999
@@ -1,2 +1,8 @@
+1999-10-31  Iain Holmes <u07ih@abdn.ac.uk>
+
+	* logout.c (display_gui): change logout gui to have a "Save setup and logout" button
+	instead of using a checkbox. Also changed wording from "Yes", "No" to "Logout" and 
+	"Cancel logout".
+
 1999-10-22  Jacob Berkman  <jberkman@andrew.cmu.edu>
 
diff -u2 projects/gsm/logout.c /usr/local/src/gnome/gnome-core-1.1.0/gsm/logout.c
--- projects/gsm/logout.c	Sun Oct 31 20:44:33 1999
+++ /usr/local/src/gnome/gnome-core-1.1.0/gsm/logout.c	Sun Oct 31 21:03:03 1999
@@ -199,6 +199,4 @@
   box = gnome_message_box_new (_("Really log out?"),
 			       GNOME_MESSAGE_BOX_QUESTION,
-			       GNOME_STOCK_BUTTON_YES,
-			       GNOME_STOCK_BUTTON_NO,
 			       NULL);
 
@@ -218,11 +216,16 @@
   if (trashing)
     {
-      toggle_button = gtk_check_button_new_with_label (_("Save current setup"));
-      gtk_widget_show (toggle_button);
-      gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (box)->vbox),
-			  toggle_button,
-			  FALSE, TRUE, 0);
+      gnome_dialog_append_button_with_pixmap (GNOME_DIALOG (box),
+					      _("Logout and save setup"),
+					      GNOME_STOCK_BUTTON_YES);
     }
 
+  gnome_dialog_append_button_with_pixmap (GNOME_DIALOG (box),
+					  _("Logout"),
+					  GNOME_STOCK_BUTTON_YES);
+  gnome_dialog_append_button_with_pixmap (GNOME_DIALOG (box),
+					  _("Cancel logout"),
+					  GNOME_STOCK_BUTTON_NO);
+
   /* Red Hat specific code to check if the user has a
    * good chance of being able to shutdown the system,
@@ -273,20 +276,39 @@
   gdk_flush ();
 
-  if (result != 0)
-    return FALSE;
-  else
+  if (trashing)
     {
-      /* This is only called when we are going to exit, so it is ok to
-	 change `trashing'.  */
-      if (trashing)
-	set_trash_mode (! GTK_TOGGLE_BUTTON (toggle_button)->active);
-
-      if (halt)
+      if (result == 2)
+	return FALSE;
+      else
 	{
-	  if (GTK_TOGGLE_BUTTON (halt)->active)
-	    action = HALT;
-	  else if (GTK_TOGGLE_BUTTON (reboot)->active)
-	    action = REBOOT;
+	  /* This is only called when we are going to exit, so it is ok to
+	     change `trashing'.  */
+	  if (result == 0)
+	    set_trash_mode (FALSE);
+	  else
+	    set_trash_mode (TRUE);
+
+	  if (halt)
+	    {
+	      if (GTK_TOGGLE_BUTTON (halt)->active)
+		action = HALT;
+	      else if (GTK_TOGGLE_BUTTON (reboot)->active)
+		action = REBOOT;
+	    }
+	  return TRUE;
 	}
+    }
+  else
+    {
+      if (result == 1)
+	return FALSE;
+      else
+	if (halt)
+	  {
+	    if (GTK_TOGGLE_BUTTON (halt)->active)
+	      action = HALT;
+	    else if (GTK_TOGGLE_BUTTON (reboot)->active)
+	      action = REBOOT;
+	  }
       return TRUE;
     }



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