[gnome-initial-setup] Show welcome screen if language page is skipped
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-initial-setup] Show welcome screen if language page is skipped
- Date: Mon, 2 Apr 2018 16:28:28 +0000 (UTC)
commit 7bc7c50c8b4822cef4d10e42787095331b44169d
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Thu Feb 15 21:08:38 2018 -0600
Show welcome screen if language page is skipped
We can't *really* skip the language page, because we need to display some
sort of welcome screen. In this case, let's just hide the language
selection element. To make this look decent, we need to center everything.
Turns out, these changes look fine even when the language page is not
skipped, so they don't need to be conditional on that.
gis_page_skip() will now return TRUE to indicate that the skipped page
should be enqueued for destruction, and FALSE to indicate that it should
be run normally anyway.
https://bugzilla.gnome.org/show_bug.cgi?id=793501
gnome-initial-setup/gis-page.c | 2 +-
gnome-initial-setup/gnome-initial-setup.c | 6 ++----
.../pages/language/gis-language-page.c | 15 ++++++++++++++-
.../pages/language/gis-language-page.ui | 4 ++--
4 files changed, 19 insertions(+), 8 deletions(-)
---
diff --git a/gnome-initial-setup/gis-page.c b/gnome-initial-setup/gis-page.c
index 39fe613..8564935 100644
--- a/gnome-initial-setup/gis-page.c
+++ b/gnome-initial-setup/gis-page.c
@@ -388,5 +388,5 @@ gis_page_skip (GisPage *page)
{
if (GIS_PAGE_GET_CLASS (page)->skip)
return GIS_PAGE_GET_CLASS (page)->skip (page);
- return FALSE;
+ return TRUE;
}
diff --git a/gnome-initial-setup/gnome-initial-setup.c b/gnome-initial-setup/gnome-initial-setup.c
index 8a54e44..594c11e 100644
--- a/gnome-initial-setup/gnome-initial-setup.c
+++ b/gnome-initial-setup/gnome-initial-setup.c
@@ -199,12 +199,10 @@ rebuild_pages_cb (GisDriver *driver)
if (!page)
continue;
- if (skipped) {
- gis_page_skip (page);
+ if (skipped && gis_page_skip (page))
g_ptr_array_add (skipped_pages, page);
- } else {
+ else
gis_driver_add_page (driver, page);
- }
}
g_strfreev (skip_pages);
diff --git a/gnome-initial-setup/pages/language/gis-language-page.c
b/gnome-initial-setup/pages/language/gis-language-page.c
index b8b0e7f..c5f895c 100644
--- a/gnome-initial-setup/pages/language/gis-language-page.c
+++ b/gnome-initial-setup/pages/language/gis-language-page.c
@@ -267,6 +267,8 @@ gis_language_page_constructed (GObject *object)
update_distro_logo (page);
+ gtk_widget_show (priv->language_chooser);
+
g_signal_connect (priv->language_chooser, "notify::language",
G_CALLBACK (language_changed), page);
g_signal_connect (priv->language_chooser, "confirm",
@@ -288,7 +290,7 @@ gis_language_page_constructed (GObject *object)
(GAsyncReadyCallback) localed_proxy_ready,
object);
g_object_unref (bus);
- }
+ }
gis_page_set_complete (GIS_PAGE (page), TRUE);
gtk_widget_show (GTK_WIDGET (page));
@@ -300,6 +302,16 @@ gis_language_page_locale_changed (GisPage *page)
gis_page_set_title (GIS_PAGE (page), _("Welcome"));
}
+static gboolean
+gis_language_page_skip (GisPage *page)
+{
+ GisLanguagePagePrivate *priv = gis_language_page_get_instance_private (GIS_LANGUAGE_PAGE (page));
+
+ gtk_widget_hide (priv->language_chooser);
+
+ return FALSE;
+}
+
static void
gis_language_page_dispose (GObject *object)
{
@@ -327,6 +339,7 @@ gis_language_page_class_init (GisLanguagePageClass *klass)
page_class->page_id = PAGE_ID;
page_class->locale_changed = gis_language_page_locale_changed;
+ page_class->skip = gis_language_page_skip;
object_class->constructed = gis_language_page_constructed;
object_class->dispose = gis_language_page_dispose;
}
diff --git a/gnome-initial-setup/pages/language/gis-language-page.ui
b/gnome-initial-setup/pages/language/gis-language-page.ui
index 1b98a6d..d5e962a 100644
--- a/gnome-initial-setup/pages/language/gis-language-page.ui
+++ b/gnome-initial-setup/pages/language/gis-language-page.ui
@@ -7,7 +7,7 @@
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="halign">center</property>
- <property name="valign">fill</property>
+ <property name="valign">center</property>
<child>
<object class="GtkImage" id="logo">
<property name="visible" bind-source="GisLanguagePage" bind-property="small-screen"
bind-flags="invert-boolean|sync-create"/>
@@ -30,7 +30,7 @@
<object class="CcLanguageChooser" id="language_chooser">
<property name="margin_bottom">18</property>
<property name="width_request">400</property>
- <property name="visible">True</property>
+ <property name="visible">False</property>
<property name="valign">start</property>
</object>
</child>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]