[gnome-initial-setup/wip/pwithnall/misc-fixes: 15/70] pages: Don't show some pages on live sessions




commit a8cb7fab88f902fa92aa49a56484af08be62b7bd
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Tue Sep 27 14:35:14 2016 -0300

    pages: Don't show some pages on live sessions
    
    Disables the accounts, goa, password, and timezone pages on a live
    session.
    
    The Accounts page is not meant to be displayed on a Live USB session,
    since the account is created automagically from the Live Chooser page.
    For the same reason, the Password page is hidden as well.
    
    The Online Accounts credentials would all be lost after a reboot so it
    seems cruel to encourage users to configure them.
    
    The reason for hiding the Timezone page is that when we're on a live
    session, we should use the NTP daemon to detect the date and timezone,
    but disable updating the hardware clock to avoid messing with the system
    configuration. However, the page changes the hardware clock if possible
    through the localed daemon, so we skip it.
    
    https://phabricator.endlessm.com/T12547

 gnome-initial-setup/pages/account/gis-account-pages.c  | 3 +++
 gnome-initial-setup/pages/goa/gis-goa-page.c           | 3 +++
 gnome-initial-setup/pages/password/gis-password-page.c | 3 +++
 gnome-initial-setup/pages/timezone/gis-timezone-page.c | 3 +++
 4 files changed, 12 insertions(+)
---
diff --git a/gnome-initial-setup/pages/account/gis-account-pages.c 
b/gnome-initial-setup/pages/account/gis-account-pages.c
index d9cc8d9f..7f117375 100644
--- a/gnome-initial-setup/pages/account/gis-account-pages.c
+++ b/gnome-initial-setup/pages/account/gis-account-pages.c
@@ -26,6 +26,9 @@
 GisPage *
 gis_prepare_account_page (GisDriver *driver)
 {
+  if (gis_driver_is_live_session (driver))
+    return NULL;
+
   return g_object_new (GIS_TYPE_ACCOUNT_PAGE,
                        "driver", driver,
                        NULL);
diff --git a/gnome-initial-setup/pages/goa/gis-goa-page.c b/gnome-initial-setup/pages/goa/gis-goa-page.c
index 87341c41..fa419d62 100644
--- a/gnome-initial-setup/pages/goa/gis-goa-page.c
+++ b/gnome-initial-setup/pages/goa/gis-goa-page.c
@@ -385,6 +385,9 @@ gis_goa_page_init (GisGoaPage *page)
 GisPage *
 gis_prepare_goa_page (GisDriver *driver)
 {
+  if (gis_driver_is_live_session (driver))
+    return NULL;
+
   return g_object_new (GIS_TYPE_GOA_PAGE,
                        "driver", driver,
                        NULL);
diff --git a/gnome-initial-setup/pages/password/gis-password-page.c 
b/gnome-initial-setup/pages/password/gis-password-page.c
index e0962f33..8cc28fba 100644
--- a/gnome-initial-setup/pages/password/gis-password-page.c
+++ b/gnome-initial-setup/pages/password/gis-password-page.c
@@ -514,6 +514,9 @@ gis_password_page_init (GisPasswordPage *page)
 GisPage *
 gis_prepare_password_page (GisDriver *driver)
 {
+  if (gis_driver_is_live_session (driver))
+    return NULL;
+
   return g_object_new (GIS_TYPE_PASSWORD_PAGE,
                        "driver", driver,
                        NULL);
diff --git a/gnome-initial-setup/pages/timezone/gis-timezone-page.c 
b/gnome-initial-setup/pages/timezone/gis-timezone-page.c
index 8a5187c5..855cb484 100644
--- a/gnome-initial-setup/pages/timezone/gis-timezone-page.c
+++ b/gnome-initial-setup/pages/timezone/gis-timezone-page.c
@@ -519,6 +519,9 @@ gis_timezone_page_init (GisTimezonePage *page)
 GisPage *
 gis_prepare_timezone_page (GisDriver *driver)
 {
+  if (gis_driver_is_live_session (driver))
+    return NULL;
+
   return g_object_new (GIS_TYPE_TIMEZONE_PAGE,
                        "driver", driver,
                        NULL);


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