[gnome-initial-setup] Hook up the checkbox of the EULA page



commit 87666b1597104a876d60a01c7b0fd570f785f987
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu May 31 17:15:57 2012 -0400

    Hook up the checkbox of the EULA page

 gnome-initial-setup/gdm-initial-setup.c |   17 ++++++++++++++---
 gnome-initial-setup/setup.ui            |    5 +++++
 2 files changed, 19 insertions(+), 3 deletions(-)
---
diff --git a/gnome-initial-setup/gdm-initial-setup.c b/gnome-initial-setup/gdm-initial-setup.c
index fdff4df..0aa1c5e 100644
--- a/gnome-initial-setup/gdm-initial-setup.c
+++ b/gnome-initial-setup/gdm-initial-setup.c
@@ -194,6 +194,15 @@ build_eula_text_view (GFile *eula,
 }
 
 static void
+eula_checkbox_toggled (GtkToggleButton *checkbox,
+                       SetupData       *setup)
+{
+        gtk_assistant_set_page_complete (setup->assistant,
+                                         g_object_get_data (G_OBJECT (checkbox), "assistant-page"),
+                                         gtk_toggle_button_get_active (checkbox));
+}
+
+static void
 build_eula_page (SetupData *setup,
                  GFile     *eula)
 {
@@ -225,9 +234,14 @@ build_eula_page (SetupData *setup,
         /* XXX: 1 is the location after the welcome page.
          * Remove this hardcoded thing. */
         gtk_assistant_insert_page (setup->assistant, vbox, 1);
+        gtk_assistant_set_page_complete (setup->assistant, vbox, FALSE);
         gtk_assistant_set_page_title (setup->assistant, vbox, title);
 
         gtk_widget_show_all (GTK_WIDGET (vbox));
+        g_signal_connect (checkbox, "toggled",
+                          G_CALLBACK (eula_checkbox_toggled),
+                          setup);
+        g_object_set_data (G_OBJECT (checkbox), "assistant-page", vbox);
 }
 
 static void
@@ -2396,9 +2410,6 @@ prepare_cb (GtkAssistant *assi, GtkWidget *page, SetupData *setup)
 {
         g_debug ("Preparing page %s", gtk_widget_get_name (page));
 
-        if (page != WID("account-page"))
-                gtk_assistant_set_page_complete (assi, page, TRUE);
-
         save_account_data (setup);
 
         if (page == WID("summary-page"))
diff --git a/gnome-initial-setup/setup.ui b/gnome-initial-setup/setup.ui
index 6a254fd..93f495e 100644
--- a/gnome-initial-setup/setup.ui
+++ b/gnome-initial-setup/setup.ui
@@ -331,6 +331,7 @@
       </object>
       <packing>
         <property name="title" translatable="yes">Introduction</property>
+        <property name="complete">True</property>
         <property name="page-type">intro</property>
       </packing>
     </child>
@@ -445,6 +446,7 @@
       </object>
       <packing>
         <property name="title" translatable="yes">Network</property>
+        <property name="complete">True</property>
       </packing>
     </child>
     <child>
@@ -511,6 +513,7 @@
       </object>
       <packing>
         <property name="title" translatable="yes">Account</property>
+        <property name="complete">False</property>
       </packing>
     </child>
     <child>
@@ -638,6 +641,7 @@
       </object>
       <packing>
         <property name="title" translatable="yes">Location</property>
+        <property name="complete">True</property>
       </packing>
     </child>
     <child>
@@ -716,6 +720,7 @@
       </object>
       <packing>
         <property name="title" translatable="yes">Online Accounts</property>
+        <property name="complete">True</property>
       </packing>
     </child>
     <child>



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