[gnome-initial-setup/youre-welcome: 3/5] Gut the language page
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-initial-setup/youre-welcome: 3/5] Gut the language page
- Date: Wed, 5 Aug 2020 22:38:18 +0000 (UTC)
commit 67360a38d231a7e6d77e5c29cac522a9ced8d5c2
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Aug 5 18:30:51 2020 -0400
Gut the language page
Remove the welcome widget and the magic skip-but-not
handling, and just make this page look similar to
the keyboard page.
We are going to add a new welcome page in front of it.
.../pages/language/gis-language-page.c | 56 +----
.../pages/language/gis-language-page.ui | 29 +--
.../pages/language/gis-welcome-widget.c | 245 ---------------------
.../pages/language/gis-welcome-widget.h | 56 -----
gnome-initial-setup/pages/language/meson.build | 2 -
5 files changed, 11 insertions(+), 377 deletions(-)
---
diff --git a/gnome-initial-setup/pages/language/gis-language-page.c
b/gnome-initial-setup/pages/language/gis-language-page.c
index 2e5ae025..09c2b988 100644
--- a/gnome-initial-setup/pages/language/gis-language-page.c
+++ b/gnome-initial-setup/pages/language/gis-language-page.c
@@ -31,9 +31,9 @@
#include "config.h"
#include "language-resources.h"
-#include "gis-welcome-widget.h"
#include "cc-language-chooser.h"
#include "gis-language-page.h"
+#include "gis-page-header.h"
#include <act/act-user-manager.h>
#include <polkit/polkit.h>
@@ -42,8 +42,6 @@
struct _GisLanguagePagePrivate
{
- GtkWidget *logo;
- GtkWidget *welcome_widget;
GtkWidget *language_chooser;
GDBusProxy *localed;
@@ -152,9 +150,6 @@ language_changed (CcLanguageChooser *chooser,
"notify::is-loaded",
G_CALLBACK (user_loaded),
g_strdup (priv->new_locale_id));
-
- gis_welcome_widget_show_locale (GIS_WELCOME_WIDGET (priv->welcome_widget),
- priv->new_locale_id);
}
static void
@@ -179,36 +174,6 @@ localed_proxy_ready (GObject *source,
priv->localed = proxy;
}
-static void
-update_distro_logo (GisLanguagePage *page)
-{
- GisLanguagePagePrivate *priv = gis_language_page_get_instance_private (page);
- g_autofree char *id = g_get_os_info (G_OS_INFO_KEY_ID);
- gsize i;
-
- static const struct {
- const char *id;
- const char *logo;
- } id_to_logo[] = {
- { "debian", "emblem-debian" },
- { "fedora", "fedora-logo-icon" },
- { "ubuntu", "ubuntu-logo-icon" },
- { "openSUSE Tumbleweed", "opensuse-logo-icon" },
- { "openSUSE Leap", "opensuse-logo-icon" },
- { "SLED", "suse-logo-icon" },
- { "SLES", "suse-logo-icon" },
- };
-
- for (i = 0; i < G_N_ELEMENTS (id_to_logo); i++)
- {
- if (g_strcmp0 (id, id_to_logo[i].id) == 0)
- {
- g_object_set (priv->logo, "icon-name", id_to_logo[i].logo, NULL);
- break;
- }
- }
-}
-
static void
language_confirmed (CcLanguageChooser *chooser,
GisLanguagePage *page)
@@ -227,8 +192,6 @@ gis_language_page_constructed (GObject *object)
G_OBJECT_CLASS (gis_language_page_parent_class)->constructed (object);
- update_distro_logo (page);
-
g_signal_connect (priv->language_chooser, "notify::language",
G_CALLBACK (language_changed), page);
g_signal_connect (priv->language_chooser, "confirm",
@@ -259,17 +222,7 @@ gis_language_page_constructed (GObject *object)
static void
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;
+ gis_page_set_title (GIS_PAGE (page), _("Language"));
}
static void
@@ -293,13 +246,10 @@ gis_language_page_class_init (GisLanguagePageClass *klass)
gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass),
"/org/gnome/initial-setup/gis-language-page.ui");
- gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisLanguagePage, welcome_widget);
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisLanguagePage, language_chooser);
- gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisLanguagePage, logo);
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;
}
@@ -308,7 +258,7 @@ static void
gis_language_page_init (GisLanguagePage *page)
{
g_resources_register (language_get_resource ());
- g_type_ensure (GIS_TYPE_WELCOME_WIDGET);
+ g_type_ensure (GIS_TYPE_PAGE_HEADER);
g_type_ensure (CC_TYPE_LANGUAGE_CHOOSER);
gtk_widget_init_template (GTK_WIDGET (page));
diff --git a/gnome-initial-setup/pages/language/gis-language-page.ui
b/gnome-initial-setup/pages/language/gis-language-page.ui
index 8f2a08cf..8980062b 100644
--- a/gnome-initial-setup/pages/language/gis-language-page.ui
+++ b/gnome-initial-setup/pages/language/gis-language-page.ui
@@ -7,33 +7,20 @@
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="halign">center</property>
+ <property name="valign">fill</property>
<child>
- <object class="GtkBox">
+ <object class="GisPageHeader" id="header">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="halign">center</property>
- <property name="valign">center</property>
- <property name="expand" bind-source="language_chooser" bind-property="visible"
bind-flags="invert-boolean|sync-create"/>
- <child>
- <object class="GtkImage" id="logo">
- <property name="visible" bind-source="GisLanguagePage" bind-property="small-screen"
bind-flags="invert-boolean|sync-create"/>
- <property name="can_focus">False</property>
- <property name="margin_top">24</property>
- <property name="pixel_size">96</property>
- <property name="icon_name">start-here-symbolic</property>
- </object>
- </child>
- <child>
- <object class="GisWelcomeWidget" id="welcome_widget">
- <property name="visible">True</property>
- <property name="margin_top">18</property>
- <property name="margin_bottom">40</property>
- </object>
- </child>
+ <property name="margin_top">24</property>
+ <property name="title" translatable="yes">Language</property>
+ <property name="subtitle" translatable="yes">Select your language.</property>
+ <property name="icon_name">preferences-desktop-locale-symbolic</property>
+ <property name="show_icon" bind-source="GisLanguagePage" bind-property="small-screen"
bind-flags="invert-boolean|sync-create"/>
</object>
</child>
<child>
<object class="CcLanguageChooser" id="language_chooser">
+ <property name="margin_top">18</property>
<property name="margin_bottom">18</property>
<property name="width_request">400</property>
<property name="visible">True</property>
diff --git a/gnome-initial-setup/pages/language/meson.build b/gnome-initial-setup/pages/language/meson.build
index ef6ba3f7..f3034480 100644
--- a/gnome-initial-setup/pages/language/meson.build
+++ b/gnome-initial-setup/pages/language/meson.build
@@ -9,8 +9,6 @@ sources += files(
'cc-language-chooser.h',
'cc-util.c',
'cc-util.h',
- 'gis-welcome-widget.c',
- 'gis-welcome-widget.h',
'gis-language-page.c',
'gis-language-page.h',
)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]