[gnome-initial-setup] account: Use a toggle button for the enterprise login switcher



commit e6645a44794a698abbe133d748511446cb2b30ac
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Feb 25 12:58:15 2013 -0500

    account: Use a toggle button for the enterprise login switcher

 TODO                                               |    1 -
 .../pages/account/gis-account-page.c               |   17 +++++------------
 2 files changed, 5 insertions(+), 13 deletions(-)
---
diff --git a/TODO b/TODO
index 492ddf3..ba63bb4 100644
--- a/TODO
+++ b/TODO
@@ -6,7 +6,6 @@
 * Network
 **  need to check the connecting progress
 * Account
-**  just use the local account page by default, with a button for "use enterprise login instead" (design is 
required here)
 **  various alignment issues - text entry boxes need be longer
 **  password entry - inline error icon isn't good here; we need a better approach to password hints
 * Location
diff --git a/gnome-initial-setup/pages/account/gis-account-page.c 
b/gnome-initial-setup/pages/account/gis-account-page.c
index 032c9a3..c488098 100644
--- a/gnome-initial-setup/pages/account/gis-account-page.c
+++ b/gnome-initial-setup/pages/account/gis-account-page.c
@@ -198,11 +198,6 @@ set_mode (GisAccountPage *page,
 
   priv->mode = mode;
 
-  gtk_button_set_label (GTK_BUTTON (priv->action),
-                        mode == UM_LOCAL ? _("Use _Enterprise Login")
-                                         : _("_Use Local Login"));
-  gtk_button_set_use_underline (GTK_BUTTON (priv->action), TRUE);
-
   nb = WID("account-notebook");
   gtk_notebook_set_current_page (GTK_NOTEBOOK (nb), (mode == UM_LOCAL) ? 0 : 1);
 
@@ -878,13 +873,11 @@ on_entry_changed (GtkEditable *editable,
 }
 
 static void
-toggle_mode (GtkButton *button,
-             gpointer   user_data)
+toggle_mode (GtkToggleButton *button,
+             gpointer         user_data)
 {
   set_mode (GIS_ACCOUNT_PAGE (user_data),
-            GIS_ACCOUNT_PAGE (user_data)->priv->mode == UM_LOCAL
-            ? UM_ENTERPRISE
-            : UM_LOCAL);
+            gtk_toggle_button_get_active (button) ? UM_ENTERPRISE : UM_LOCAL);
 }
 
 static void
@@ -949,8 +942,8 @@ gis_account_page_constructed (GObject *object)
 
   priv->has_enterprise = FALSE;
 
-  priv->action = gtk_button_new_with_mnemonic ("_Use Enterprise Login");
-  g_signal_connect (priv->action, "clicked", G_CALLBACK (toggle_mode), page);
+  priv->action = gtk_toggle_button_new_with_mnemonic ("_Use Enterprise Login");
+  g_signal_connect (priv->action, "toggled", G_CALLBACK (toggle_mode), page);
   gtk_widget_show (priv->action);
   g_object_ref_sink (priv->action);
 


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