[gnome-initial-setup/wip/rancell/ubuntu-welcome] Add Ubuntu mode with special pages
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-initial-setup/wip/rancell/ubuntu-welcome] Add Ubuntu mode with special pages
- Date: Wed, 4 Apr 2018 00:00:03 +0000 (UTC)
commit 6edecd4b6d6d7ece05d190af42ac9ae5968f59d3
Author: Robert Ancell <robert ancell canonical com>
Date: Tue Mar 20 11:51:30 2018 +1300
Add Ubuntu mode with special pages
.gitignore | 4 +
configure.ac | 9 +-
gnome-initial-setup/Makefile.am | 4 +
gnome-initial-setup/gnome-initial-setup.c | 16 +-
gnome-initial-setup/pages/Makefile.am | 6 +-
gnome-initial-setup/pages/apps/Makefile.am | 21 ++
gnome-initial-setup/pages/apps/apps.gresource.xml | 7 +
gnome-initial-setup/pages/apps/gis-apps-page.c | 305 ++++++++++++++++++++
gnome-initial-setup/pages/apps/gis-apps-page.h | 52 ++++
gnome-initial-setup/pages/apps/gis-apps-page.ui | 79 +++++
gnome-initial-setup/pages/livepatch/Makefile.am | 21 ++
.../pages/livepatch/gis-livepatch-page.c | 95 ++++++
.../pages/livepatch/gis-livepatch-page.h | 52 ++++
.../pages/livepatch/gis-livepatch-page.ui | 56 ++++
.../pages/livepatch/livepatch.gresource.xml | 7 +
.../pages/privacy/gis-privacy-page.c | 2 +-
.../pages/ubuntu-changes/Makefile.am | 21 ++
.../pages/ubuntu-changes/gis-ubuntu-changes-page.c | 106 +++++++
.../pages/ubuntu-changes/gis-ubuntu-changes-page.h | 52 ++++
.../ubuntu-changes/gis-ubuntu-changes-page.ui | 60 ++++
.../ubuntu-changes/ubuntu-changes.gresource.xml | 8 +
.../pages/ubuntu-changes/ubuntu-changes.png | Bin 0 -> 18322 bytes
.../pages/ubuntu-report/Makefile.am | 21 ++
.../pages/ubuntu-report/gis-ubuntu-report-page.c | 168 +++++++++++
.../pages/ubuntu-report/gis-ubuntu-report-page.h | 52 ++++
.../pages/ubuntu-report/gis-ubuntu-report-page.ui | 130 +++++++++
.../ubuntu-report/ubuntu-report.gresource.xml | 7 +
po/POTFILES.in | 8 +
28 files changed, 1364 insertions(+), 5 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 3844b01..bd87941 100644
--- a/.gitignore
+++ b/.gitignore
@@ -65,6 +65,10 @@ gnome-initial-setup/pages/account/account-resources.[ch]
gnome-initial-setup/pages/account/um-realm-generated.[ch]
gnome-initial-setup/pages/software/software-resources.[ch]
gnome-initial-setup/pages/summary/summary-resources.[ch]
+gnome-initial-setup/pages/ubuntu-report/ubuntu-report-resources.[ch]
+gnome-initial-setup/pages/livepatch/livepatch-resources.[ch]
+gnome-initial-setup/pages/ubuntu-changes/ubuntu-changes-resources.[ch]
+gnome-initial-setup/pages/apps/apps-resources.[ch]
gnome-initial-setup-first-login.desktop
gnome-initial-setup.desktop
diff --git a/configure.ac b/configure.ac
index ce17c55..45288c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,7 +61,10 @@ PKG_CHECK_MODULES(INITIAL_SETUP,
json-glib-1.0
libsecret-1
pwquality
- webkit2gtk-4.0)
+ webkit2gtk-4.0
+ snapd-glib
+ libsoup-2.4
+ sysmetrics)
INITIAL_SETUP_CFLAGS="$INITIAL_SETUP_CFLAGS -DNM_VERSION_MIN_REQUIRED=NM_VERSION_1_2"
INITIAL_SETUP_CFLAGS="$INITIAL_SETUP_CFLAGS -DNM_VERSION_MAX_ALLOWED=NM_VERSION_1_2"
@@ -157,6 +160,10 @@ gnome-initial-setup/pages/account/Makefile
gnome-initial-setup/pages/password/Makefile
gnome-initial-setup/pages/software/Makefile
gnome-initial-setup/pages/summary/Makefile
+gnome-initial-setup/pages/ubuntu-report/Makefile
+gnome-initial-setup/pages/livepatch/Makefile
+gnome-initial-setup/pages/ubuntu-changes/Makefile
+gnome-initial-setup/pages/apps/Makefile
po/Makefile.in
])
AC_OUTPUT
diff --git a/gnome-initial-setup/Makefile.am b/gnome-initial-setup/Makefile.am
index c04f1e4..6c36682 100644
--- a/gnome-initial-setup/Makefile.am
+++ b/gnome-initial-setup/Makefile.am
@@ -44,6 +44,10 @@ gnome_initial_setup_LDADD = \
pages/password/libgispassword.la \
pages/software/libgissoftware.la \
pages/summary/libgissummary.la \
+ pages/ubuntu-report/libgisubuntu-report.la \
+ pages/livepatch/libgislivepatch.la \
+ pages/ubuntu-changes/libgisubuntu-changes.la \
+ pages/apps/libgisapps.la \
$(INITIAL_SETUP_LIBS) \
-lm
diff --git a/gnome-initial-setup/gnome-initial-setup.c b/gnome-initial-setup/gnome-initial-setup.c
index 5671cae..ce9cad2 100644
--- a/gnome-initial-setup/gnome-initial-setup.c
+++ b/gnome-initial-setup/gnome-initial-setup.c
@@ -48,6 +48,10 @@
#include "pages/account/gis-account-pages.h"
#include "pages/password/gis-password-page.h"
#include "pages/summary/gis-summary-page.h"
+#include "pages/ubuntu-report/gis-ubuntu-report-page.h"
+#include "pages/livepatch/gis-livepatch-page.h"
+#include "pages/ubuntu-changes/gis-ubuntu-changes-page.h"
+#include "pages/apps/gis-apps-page.h"
#define VENDOR_PAGES_GROUP "pages"
#define VENDOR_PAGES_SKIP_KEY "skip"
@@ -80,6 +84,14 @@ static PageData page_table[] = {
{ NULL },
};
+static PageData ubuntu_page_table[] = {
+/* PAGE (ubuntu_changes, FALSE), */
+ PAGE (livepatch, FALSE),
+ PAGE (ubuntu_report, FALSE),
+ PAGE (apps, FALSE),
+ { NULL },
+};
+
#undef PAGE
static gboolean
@@ -169,12 +181,12 @@ rebuild_pages_cb (GisDriver *driver)
skip_pages = pages_to_skip_from_file ();
- page_data = page_table;
+ page_data = ubuntu_page_table; // FIXME: conditional
if (current_page != NULL) {
destroy_pages_after (assistant, current_page);
- for (page_data = page_table; page_data->page_id != NULL; ++page_data)
+ for (page_data = ubuntu_page_table; page_data->page_id != NULL; ++page_data) // FIXME conditional
if (g_str_equal (page_data->page_id, GIS_PAGE_GET_CLASS (current_page)->page_id))
break;
diff --git a/gnome-initial-setup/pages/Makefile.am b/gnome-initial-setup/pages/Makefile.am
index e5182a7..551c5a4 100644
--- a/gnome-initial-setup/pages/Makefile.am
+++ b/gnome-initial-setup/pages/Makefile.am
@@ -11,4 +11,8 @@ SUBDIRS = \
account \
password \
summary \
- software
+ software \
+ ubuntu-report \
+ livepatch \
+ ubuntu-changes \
+ apps
diff --git a/gnome-initial-setup/pages/apps/Makefile.am b/gnome-initial-setup/pages/apps/Makefile.am
new file mode 100644
index 0000000..8badc4d
--- /dev/null
+++ b/gnome-initial-setup/pages/apps/Makefile.am
@@ -0,0 +1,21 @@
+
+noinst_LTLIBRARIES = libgisapps.la
+
+BUILT_SOURCES =
+
+resource_files = $(shell glib-compile-resources --sourcedir=$(srcdir) --generate-dependencies
$(srcdir)/apps.gresource.xml)
+apps-resources.c: apps.gresource.xml $(resource_files)
+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $<
+apps-resources.h: apps.gresource.xml $(resource_files)
+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-header $<
+BUILT_SOURCES += apps-resources.c apps-resources.h
+
+libgisapps_la_SOURCES = \
+ gis-apps-page.c gis-apps-page.h \
+ $(BUILT_SOURCES)
+
+libgisapps_la_CFLAGS = $(INITIAL_SETUP_CFLAGS) -I "$(srcdir)/../.." -I "$(top_srcdir)" -I "$(top_builddir)"
+libgisapps_la_LIBADD = $(INITIAL_SETUP_LIBS)
+libgisapps_la_LDFLAGS = -export_dynamic -avoid-version -module -no-undefined
+
+EXTRA_DIST = apps.gresource.xml $(resource_files)
diff --git a/gnome-initial-setup/pages/apps/apps.gresource.xml
b/gnome-initial-setup/pages/apps/apps.gresource.xml
new file mode 100644
index 0000000..7d14caf
--- /dev/null
+++ b/gnome-initial-setup/pages/apps/apps.gresource.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+ <gresource prefix="/org/gnome/initial-setup">
+ <file preprocess="xml-stripblanks" alias="gis-apps-page.ui">gis-apps-page.ui</file>
+ </gresource>
+</gresources>
+
diff --git a/gnome-initial-setup/pages/apps/gis-apps-page.c b/gnome-initial-setup/pages/apps/gis-apps-page.c
new file mode 100644
index 0000000..ad599d7
--- /dev/null
+++ b/gnome-initial-setup/pages/apps/gis-apps-page.c
@@ -0,0 +1,305 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/*
+ * Copyright (C) 2018 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* Get more apps page {{{1 */
+
+#define PAGE_ID "apps"
+
+#include "config.h"
+#include "gis-apps-page.h"
+#include "apps-resources.h"
+
+#include <glib/gi18n.h>
+#include <gio/gio.h>
+#include <snapd-glib/snapd-glib.h>
+#include <libsoup/soup.h>
+
+struct _GisAppsPagePrivate {
+ SoupSession *soup_session;
+ GtkWidget *installed_grid;
+ GtkWidget *featured_grid;
+};
+typedef struct _GisAppsPagePrivate GisAppsPagePrivate;
+
+G_DEFINE_TYPE_WITH_PRIVATE (GisAppsPage, gis_apps_page, GIS_TYPE_PAGE);
+
+static void
+gis_apps_page_constructed (GObject *object)
+{
+ GisAppsPage *page = GIS_APPS_PAGE (object);
+ GisAppsPagePrivate *priv = gis_apps_page_get_instance_private (page);
+
+ G_OBJECT_CLASS (gis_apps_page_parent_class)->constructed (object);
+
+ gis_page_set_skippable (GIS_PAGE (page), TRUE);
+
+ gis_page_set_complete (GIS_PAGE (page), TRUE);
+ gtk_widget_show (GTK_WIDGET (page));
+}
+
+static void
+gis_apps_page_dispose (GObject *object)
+{
+ GisAppsPage *page = GIS_APPS_PAGE (object);
+ GisAppsPagePrivate *priv = gis_apps_page_get_instance_private (page);
+
+ g_clear_object (&priv->soup_session);
+
+ G_OBJECT_CLASS (gis_apps_page_parent_class)->dispose (object);
+}
+
+static void
+open_software (GtkButton *button,
+ const gchar *uri,
+ GisAppsPage *page)
+{
+ g_autoptr(GAppInfo) info = NULL;
+ g_autoptr(GError) error = NULL;
+
+ info = g_app_info_create_from_commandline ("gnome-software", NULL, G_APP_INFO_CREATE_NONE, &error);
+ if (info == NULL) {
+ g_warning ("Failed to get launch information from gnome-software: %s", error->message);
+ return;
+ }
+ if (!g_app_info_launch (info, NULL, NULL, &error)) {
+ g_warning ("Failed to launch gnome-software: %s", error->message);
+ return;
+ }
+}
+
+static void
+gis_apps_page_locale_changed (GisPage *page)
+{
+ gis_page_set_title (GIS_PAGE (page), _("Welcome to Ubuntu"));
+}
+
+static void
+gis_apps_page_class_init (GisAppsPageClass *klass)
+{
+ GisPageClass *page_class = GIS_PAGE_CLASS (klass);
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass),
"/org/gnome/initial-setup/gis-apps-page.ui");
+ gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisAppsPage, installed_grid);
+ gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisAppsPage, featured_grid);
+ gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (klass), open_software);
+
+ page_class->page_id = PAGE_ID;
+ page_class->locale_changed = gis_apps_page_locale_changed;
+ object_class->constructed = gis_apps_page_constructed;
+ object_class->dispose = gis_apps_page_dispose;
+}
+
+static GdkPixbuf *
+load_desktop_icon (SnapdSnap *snap)
+{
+ GPtrArray *apps;
+ guint i;
+
+ apps = snapd_snap_get_apps (snap);
+ for (i = 0; i < apps->len; i++) {
+ SnapdApp *app = g_ptr_array_index (apps, i);
+ const gchar *desktop_file_path;
+ g_autoptr(GKeyFile) desktop_file = NULL;
+ g_autoptr(GError) error = NULL;
+ g_autofree gchar *icon = NULL;
+
+ desktop_file_path = snapd_app_get_desktop_file (app);
+ if (desktop_file_path == NULL)
+ continue;
+
+ desktop_file = g_key_file_new ();
+ if (!g_key_file_load_from_file (desktop_file, desktop_file_path, G_KEY_FILE_NONE, &error)) {
+ g_warning ("Failed to load desktop file %s: %s", desktop_file_path, error->message);
+ continue;
+ }
+
+ icon = g_key_file_get_string (desktop_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_ICON,
&error);
+ if (icon == NULL) {
+ g_warning ("Failed to get desktop file icon %s: %s", desktop_file_path, error->message);
+ continue;
+ }
+
+ if (g_str_has_prefix (icon, "/")) {
+ g_autoptr(GdkPixbuf) pixbuf = NULL;
+
+ pixbuf = gdk_pixbuf_new_from_file_at_scale (icon, 48, 48, TRUE, &error);
+ if (pixbuf == NULL) {
+ g_warning ("Failed to load icon %s: %s", icon, error->message);
+ continue;
+ }
+
+ return g_steal_pointer (&pixbuf);
+ }
+ else {
+ g_autoptr(GdkPixbuf) pixbuf = NULL;
+
+ pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (), icon, 48, 0, &error);
+ if (pixbuf == NULL) {
+ g_warning ("Failed to load icon %s: %s", icon, error->message);
+ continue;
+ }
+
+ return g_steal_pointer (&pixbuf);
+ }
+ }
+
+ return NULL;
+}
+
+static void
+icon_cb (GObject *object, GAsyncResult *result, gpointer user_data)
+{
+ GtkWidget *image = user_data;
+ g_autoptr(GInputStream) stream = NULL;
+ g_autoptr(GdkPixbuf) pixbuf = NULL;
+ g_autoptr(GError) error = NULL;
+
+ stream = soup_session_send_finish (SOUP_SESSION (object), result, &error);
+ if (stream == NULL) {
+ g_warning ("Failed to download icon: %s", error->message);
+ return;
+ }
+
+ pixbuf = gdk_pixbuf_new_from_stream_at_scale (stream, 48, 48, TRUE, NULL, &error);
+ if (pixbuf == NULL) {
+ g_warning ("Failed to load icon: %s", error->message);
+ return;
+ }
+
+ gtk_image_set_from_pixbuf (GTK_IMAGE (image), pixbuf);
+}
+
+static void
+load_store_icon (GisAppsPage *page, GtkWidget *image, SnapdSnap *snap)
+{
+ GisAppsPagePrivate *priv = gis_apps_page_get_instance_private (page);
+ const gchar *url;
+ g_autoptr(SoupMessage) message = NULL;
+
+ url = snapd_snap_get_icon (snap);
+ if (url == NULL || !(g_str_has_prefix (url, "http://") || g_str_has_prefix (url, "https://")))
+ return;
+
+ message = soup_message_new ("GET", url);
+ soup_session_send_async (priv->soup_session, message, NULL, icon_cb, image);
+}
+
+static void
+load_icon (GisAppsPage *page, GtkWidget *image, SnapdSnap *snap)
+{
+ GisAppsPagePrivate *priv = gis_apps_page_get_instance_private (page);
+ g_autoptr(GdkPixbuf) pixbuf = NULL;
+
+ pixbuf = load_desktop_icon (snap);
+ if (pixbuf != NULL) {
+ gtk_image_set_from_pixbuf (GTK_IMAGE (image), pixbuf);
+ return;
+ }
+
+ // FIXME: Add placeholder icon
+ load_store_icon (page, image, snap);
+}
+
+static GtkWidget *
+snap_tile_new (GisAppsPage *page, SnapdSnap *snap)
+{
+ GisAppsPagePrivate *priv = gis_apps_page_get_instance_private (page);
+ GtkWidget *box, *icon, *label;
+ const gchar *title;
+
+ box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+
+ icon = gtk_image_new ();
+ gtk_widget_show (icon);
+ gtk_box_pack_start (GTK_BOX (box), icon, FALSE, TRUE, 0);
+
+ title = snapd_snap_get_title (snap);
+ if (title == NULL)
+ title = snapd_snap_get_name (snap);
+ label = gtk_label_new (title);
+ gtk_widget_show (label);
+ gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+ gtk_label_set_xalign (GTK_LABEL (label), 0);
+ gtk_box_pack_start (GTK_BOX (box), label, TRUE, TRUE, 0);
+
+ load_icon (page, icon, snap);
+
+ return box;
+}
+
+static void
+gis_apps_page_init (GisAppsPage *page)
+{
+ GisAppsPagePrivate *priv = gis_apps_page_get_instance_private (page);
+ g_autoptr(SnapdClient) client = NULL;
+ g_autoptr(GPtrArray) installed_snaps = NULL;
+ g_autoptr(GPtrArray) featured_snaps = NULL;
+ g_autoptr(GError) error = NULL;
+
+ g_resources_register (apps_get_resource ());
+
+ gtk_widget_init_template (GTK_WIDGET (page));
+
+ priv->soup_session = soup_session_new ();
+
+ client = snapd_client_new ();
+
+ installed_snaps = snapd_client_list_sync (client, NULL, &error);
+ if (installed_snaps != NULL) {
+ guint i, count = 0;
+ for (i = 0; i < installed_snaps->len; i++) {
+ SnapdSnap *snap = g_ptr_array_index (installed_snaps, i);
+ GtkWidget *tile;
+
+ if (snapd_snap_get_snap_type (snap) != SNAPD_SNAP_TYPE_APP)
+ continue;
+
+ tile = snap_tile_new (page, snap);
+ gtk_widget_show (tile);
+ gtk_grid_attach (GTK_GRID (priv->installed_grid), tile, count % 4, count / 4, 1, 1);
+ count++;
+ }
+ }
+ else
+ g_warning ("Failed to get installed snaps: %s", error->message);
+
+ featured_snaps = snapd_client_find_section_sync (client, SNAPD_FIND_FLAGS_NONE, "featured", NULL, NULL,
NULL, &error);
+ if (featured_snaps != NULL) {
+ guint i;
+ for (i = 0; i < featured_snaps->len; i++) {
+ SnapdSnap *snap = g_ptr_array_index (featured_snaps, i);
+ GtkWidget *tile;
+
+ tile = snap_tile_new (page, snap);
+ gtk_widget_show (tile);
+ gtk_grid_attach (GTK_GRID (priv->featured_grid), tile, i % 4, i / 4, 1, 1);
+ }
+ }
+ else
+ g_warning ("Failed to get featured snaps: %s", error->message);
+}
+
+void
+gis_prepare_apps_page (GisDriver *driver)
+{
+ gis_driver_add_page (driver,
+ g_object_new (GIS_TYPE_APPS_PAGE,
+ "driver", driver,
+ NULL));
+}
diff --git a/gnome-initial-setup/pages/apps/gis-apps-page.h b/gnome-initial-setup/pages/apps/gis-apps-page.h
new file mode 100644
index 0000000..347dcbc
--- /dev/null
+++ b/gnome-initial-setup/pages/apps/gis-apps-page.h
@@ -0,0 +1,52 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/*
+ * Copyright (C) 2018 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GIS_APPS_PAGE_H__
+#define __GIS_APPS_PAGE_H__
+
+#include "gnome-initial-setup.h"
+
+G_BEGIN_DECLS
+
+#define GIS_TYPE_APPS_PAGE (gis_apps_page_get_type ())
+#define GIS_APPS_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIS_TYPE_APPS_PAGE, GisAppsPage))
+#define GIS_APPS_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIS_TYPE_APPS_PAGE,
GisAppsPageClass))
+#define GIS_IS_APPS_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIS_TYPE_APPS_PAGE))
+#define GIS_IS_APPS_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIS_TYPE_APPS_PAGE))
+#define GIS_APPS_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIS_TYPE_APPS_PAGE,
GisAppsPageClass))
+
+typedef struct _GisAppsPage GisAppsPage;
+typedef struct _GisAppsPageClass GisAppsPageClass;
+
+struct _GisAppsPage
+{
+ GisPage parent;
+};
+
+struct _GisAppsPageClass
+{
+ GisPageClass parent_class;
+};
+
+GType gis_apps_page_get_type (void);
+
+void gis_prepare_apps_page (GisDriver *driver);
+
+G_END_DECLS
+
+#endif /* __GIS_APPS_PAGE_H__ */
diff --git a/gnome-initial-setup/pages/apps/gis-apps-page.ui b/gnome-initial-setup/pages/apps/gis-apps-page.ui
new file mode 100644
index 0000000..925b33d
--- /dev/null
+++ b/gnome-initial-setup/pages/apps/gis-apps-page.ui
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <template class="GisAppsPage" parent="GisPage">
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">center</property>
+ <property name="valign">fill</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel" id="title">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">center</property>
+ <property name="valign">start</property>
+ <property name="margin_top">18</property>
+ <property name="label" translatable="yes">Get more apps</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ <attribute name="scale" value="1.8"/>
+ </attributes>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="margin_top">18</property>
+ <property name="label" translatable="yes">Your Ubuntu system has these apps already:</property>
+ <property name="wrap">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkGrid" id="installed_grid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row-homogeneous">True</property>
+ <property name="column-homogeneous">True</property>
+ <property name="row-spacing">10</property>
+ <property name="column-spacing">10</property>
+ <property name="margin_top">18</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="margin_top">18</property>
+ <property name="label" translatable="yes">You can use “Software” to install apps like
these:</property>
+ <property name="wrap">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkGrid" id="featured_grid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row-homogeneous">True</property>
+ <property name="column-homogeneous">True</property>
+ <property name="row-spacing">10</property>
+ <property name="column-spacing">10</property>
+ <property name="margin_top">18</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkButton">
+ <property name="visible">True</property>
+ <property name="margin_top">18</property>
+ <property name="label" translatable="yes">Open “Software” now</property>
+ <signal name="clicked" handler="open_software"/>
+ </object>
+ </child>
+ </object>
+ </child>
+ </template>
+</interface>
diff --git a/gnome-initial-setup/pages/livepatch/Makefile.am b/gnome-initial-setup/pages/livepatch/Makefile.am
new file mode 100644
index 0000000..e40c6dc
--- /dev/null
+++ b/gnome-initial-setup/pages/livepatch/Makefile.am
@@ -0,0 +1,21 @@
+
+noinst_LTLIBRARIES = libgislivepatch.la
+
+BUILT_SOURCES =
+
+resource_files = $(shell glib-compile-resources --sourcedir=$(srcdir) --generate-dependencies
$(srcdir)/livepatch.gresource.xml)
+livepatch-resources.c: livepatch.gresource.xml $(resource_files)
+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $<
+livepatch-resources.h: livepatch.gresource.xml $(resource_files)
+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-header $<
+BUILT_SOURCES += livepatch-resources.c livepatch-resources.h
+
+libgislivepatch_la_SOURCES = \
+ gis-livepatch-page.c gis-livepatch-page.h \
+ $(BUILT_SOURCES)
+
+libgislivepatch_la_CFLAGS = $(INITIAL_SETUP_CFLAGS) -I "$(srcdir)/../.." -I "$(top_srcdir)" -I
"$(top_builddir)"
+libgislivepatch_la_LIBADD = $(INITIAL_SETUP_LIBS)
+libgislivepatch_la_LDFLAGS = -export_dynamic -avoid-version -module -no-undefined
+
+EXTRA_DIST = livepatch.gresource.xml $(resource_files)
diff --git a/gnome-initial-setup/pages/livepatch/gis-livepatch-page.c
b/gnome-initial-setup/pages/livepatch/gis-livepatch-page.c
new file mode 100644
index 0000000..60b7b41
--- /dev/null
+++ b/gnome-initial-setup/pages/livepatch/gis-livepatch-page.c
@@ -0,0 +1,95 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/*
+ * Copyright (C) 2018 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* Canonical Livepatch page {{{1 */
+
+#define PAGE_ID "livepatch"
+
+#include "config.h"
+#include "gis-livepatch-page.h"
+#include "livepatch-resources.h"
+
+#include <glib/gi18n.h>
+#include <gio/gio.h>
+
+struct _GisLivepatchPagePrivate {
+ int dummy;
+};
+typedef struct _GisLivepatchPagePrivate GisLivepatchPagePrivate;
+
+G_DEFINE_TYPE_WITH_PRIVATE (GisLivepatchPage, gis_livepatch_page, GIS_TYPE_PAGE);
+
+static void
+gis_livepatch_page_constructed (GObject *object)
+{
+ GisLivepatchPage *page = GIS_LIVEPATCH_PAGE (object);
+ GisLivepatchPagePrivate *priv = gis_livepatch_page_get_instance_private (page);
+
+ G_OBJECT_CLASS (gis_livepatch_page_parent_class)->constructed (object);
+
+ gis_page_set_skippable (GIS_PAGE (page), TRUE);
+
+ gis_page_set_complete (GIS_PAGE (page), TRUE);
+ gtk_widget_show (GTK_WIDGET (page));
+}
+
+static void
+gis_livepatch_page_dispose (GObject *object)
+{
+ GisLivepatchPage *page = GIS_LIVEPATCH_PAGE (object);
+ GisLivepatchPagePrivate *priv = gis_livepatch_page_get_instance_private (page);
+
+ G_OBJECT_CLASS (gis_livepatch_page_parent_class)->dispose (object);
+}
+
+static void
+gis_livepatch_page_locale_changed (GisPage *page)
+{
+ gis_page_set_title (GIS_PAGE (page), _("Welcome to Ubuntu"));
+}
+
+static void
+gis_livepatch_page_class_init (GisLivepatchPageClass *klass)
+{
+ GisPageClass *page_class = GIS_PAGE_CLASS (klass);
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass),
"/org/gnome/initial-setup/gis-livepatch-page.ui");
+
+ page_class->page_id = PAGE_ID;
+ page_class->locale_changed = gis_livepatch_page_locale_changed;
+ object_class->constructed = gis_livepatch_page_constructed;
+ object_class->dispose = gis_livepatch_page_dispose;
+}
+
+static void
+gis_livepatch_page_init (GisLivepatchPage *page)
+{
+ g_resources_register (livepatch_get_resource ());
+
+ gtk_widget_init_template (GTK_WIDGET (page));
+}
+
+void
+gis_prepare_livepatch_page (GisDriver *driver)
+{
+ gis_driver_add_page (driver,
+ g_object_new (GIS_TYPE_LIVEPATCH_PAGE,
+ "driver", driver,
+ NULL));
+}
diff --git a/gnome-initial-setup/pages/livepatch/gis-livepatch-page.h
b/gnome-initial-setup/pages/livepatch/gis-livepatch-page.h
new file mode 100644
index 0000000..eed18e5
--- /dev/null
+++ b/gnome-initial-setup/pages/livepatch/gis-livepatch-page.h
@@ -0,0 +1,52 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/*
+ * Copyright (C) 2018 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GIS_LIVEPATCH_PAGE_H__
+#define __GIS_LIVEPATCH_PAGE_H__
+
+#include "gnome-initial-setup.h"
+
+G_BEGIN_DECLS
+
+#define GIS_TYPE_LIVEPATCH_PAGE (gis_livepatch_page_get_type ())
+#define GIS_LIVEPATCH_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIS_TYPE_LIVEPATCH_PAGE,
GisLivepatchPage))
+#define GIS_LIVEPATCH_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIS_TYPE_LIVEPATCH_PAGE,
GisLivepatchPageClass))
+#define GIS_IS_LIVEPATCH_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIS_TYPE_LIVEPATCH_PAGE))
+#define GIS_IS_LIVEPATCH_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIS_TYPE_LIVEPATCH_PAGE))
+#define GIS_LIVEPATCH_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIS_TYPE_LIVEPATCH_PAGE,
GisLivepatchPageClass))
+
+typedef struct _GisLivepatchPage GisLivepatchPage;
+typedef struct _GisLivepatchPageClass GisLivepatchPageClass;
+
+struct _GisLivepatchPage
+{
+ GisPage parent;
+};
+
+struct _GisLivepatchPageClass
+{
+ GisPageClass parent_class;
+};
+
+GType gis_livepatch_page_get_type (void);
+
+void gis_prepare_livepatch_page (GisDriver *driver);
+
+G_END_DECLS
+
+#endif /* __GIS_LIVEPATCH_PAGE_H__ */
diff --git a/gnome-initial-setup/pages/livepatch/gis-livepatch-page.ui
b/gnome-initial-setup/pages/livepatch/gis-livepatch-page.ui
new file mode 100644
index 0000000..0a22b79
--- /dev/null
+++ b/gnome-initial-setup/pages/livepatch/gis-livepatch-page.ui
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <template class="GisLivepatchPage" parent="GisPage">
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">center</property>
+ <property name="valign">fill</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel" id="title">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">center</property>
+ <property name="valign">start</property>
+ <property name="margin_top">18</property>
+ <property name="label" translatable="yes">Livepatch</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ <attribute name="scale" value="1.8"/>
+ </attributes>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="max-width-chars">50</property>
+ <property name="xalign">0</property>
+ <property name="halign">start</property>
+ <property name="margin_top">18</property>
+ <property name="label" translatable="yes">Canonical Livepatch helps keep your computer safe, by
applying some updates that would normally require restarting.</property>
+ <property name="wrap">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="margin_top">18</property>
+ <property name="label" translatable="yes">Would you like to set up Livepatch now?</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkButton">
+ <property name="visible">True</property>
+ <property name="margin_top">18</property>
+ <property name="label" translatable="yes">Set Up Livepatch…</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </template>
+</interface>
diff --git a/gnome-initial-setup/pages/livepatch/livepatch.gresource.xml
b/gnome-initial-setup/pages/livepatch/livepatch.gresource.xml
new file mode 100644
index 0000000..54141df
--- /dev/null
+++ b/gnome-initial-setup/pages/livepatch/livepatch.gresource.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+ <gresource prefix="/org/gnome/initial-setup">
+ <file preprocess="xml-stripblanks" alias="gis-livepatch-page.ui">gis-livepatch-page.ui</file>
+ </gresource>
+</gresources>
+
diff --git a/gnome-initial-setup/pages/privacy/gis-privacy-page.c
b/gnome-initial-setup/pages/privacy/gis-privacy-page.c
index f2af372..30e76e3 100644
--- a/gnome-initial-setup/pages/privacy/gis-privacy-page.c
+++ b/gnome-initial-setup/pages/privacy/gis-privacy-page.c
@@ -289,7 +289,7 @@ activate_link (GtkLabel *label,
static void
gis_privacy_page_locale_changed (GisPage *page)
{
- gis_page_set_title (GIS_PAGE (page), _("Privacy"));
+ gis_page_set_title (GIS_PAGE (page), _("Welcome to Ubuntu"));
}
static void
diff --git a/gnome-initial-setup/pages/ubuntu-changes/Makefile.am
b/gnome-initial-setup/pages/ubuntu-changes/Makefile.am
new file mode 100644
index 0000000..f7da724
--- /dev/null
+++ b/gnome-initial-setup/pages/ubuntu-changes/Makefile.am
@@ -0,0 +1,21 @@
+
+noinst_LTLIBRARIES = libgisubuntu-changes.la
+
+BUILT_SOURCES =
+
+resource_files = $(shell glib-compile-resources --sourcedir=$(srcdir) --generate-dependencies
$(srcdir)/ubuntu-changes.gresource.xml)
+ubuntu-changes-resources.c: ubuntu-changes.gresource.xml $(resource_files)
+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $<
+ubuntu-changes-resources.h: ubuntu-changes.gresource.xml $(resource_files)
+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-header $<
+BUILT_SOURCES += ubuntu-changes-resources.c ubuntu-changes-resources.h
+
+libgisubuntu_changes_la_SOURCES = \
+ gis-ubuntu-changes-page.c gis-ubuntu-changes-page.h \
+ $(BUILT_SOURCES)
+
+libgisubuntu_changes_la_CFLAGS = $(INITIAL_SETUP_CFLAGS) -I "$(srcdir)/../.." -I "$(top_srcdir)" -I
"$(top_builddir)"
+libgisubuntu_changes_la_LIBADD = $(INITIAL_SETUP_LIBS)
+libgisubuntu_changes_la_LDFLAGS = -export_dynamic -avoid-version -module -no-undefined
+
+EXTRA_DIST = ubuntu-changes.gresource.xml $(resource_files)
diff --git a/gnome-initial-setup/pages/ubuntu-changes/gis-ubuntu-changes-page.c
b/gnome-initial-setup/pages/ubuntu-changes/gis-ubuntu-changes-page.c
new file mode 100644
index 0000000..5295825
--- /dev/null
+++ b/gnome-initial-setup/pages/ubuntu-changes/gis-ubuntu-changes-page.c
@@ -0,0 +1,106 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/*
+ * Copyright (C) 2018 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* Ubuntu changes page {{{1 */
+
+#define PAGE_ID "ubuntu-changes"
+
+#include "config.h"
+#include "gis-ubuntu-changes-page.h"
+#include "ubuntu-changes-resources.h"
+
+#include <glib/gi18n.h>
+#include <gio/gio.h>
+
+struct _GisUbuntuChangesPagePrivate {
+ int dummy;
+};
+typedef struct _GisUbuntuChangesPagePrivate GisUbuntuChangesPagePrivate;
+
+G_DEFINE_TYPE_WITH_PRIVATE (GisUbuntuChangesPage, gis_ubuntu_changes_page, GIS_TYPE_PAGE);
+
+static void
+gis_ubuntu_changes_page_constructed (GObject *object)
+{
+ GisUbuntuChangesPage *page = GIS_UBUNTU_CHANGES_PAGE (object);
+ GisUbuntuChangesPagePrivate *priv = gis_ubuntu_changes_page_get_instance_private (page);
+
+ G_OBJECT_CLASS (gis_ubuntu_changes_page_parent_class)->constructed (object);
+
+ gis_page_set_skippable (GIS_PAGE (page), TRUE);
+
+ gis_page_set_complete (GIS_PAGE (page), TRUE);
+ gtk_widget_show (GTK_WIDGET (page));
+}
+
+static void
+gis_ubuntu_changes_page_dispose (GObject *object)
+{
+ GisUbuntuChangesPage *page = GIS_UBUNTU_CHANGES_PAGE (object);
+ GisUbuntuChangesPagePrivate *priv = gis_ubuntu_changes_page_get_instance_private (page);
+
+ G_OBJECT_CLASS (gis_ubuntu_changes_page_parent_class)->dispose (object);
+}
+
+static gboolean
+activate_link (GtkLabel *label,
+ const gchar *uri,
+ GisUbuntuChangesPage *page)
+{
+ /* FIXME: Show changes */
+
+ return TRUE;
+}
+
+static void
+gis_ubuntu_changes_page_locale_changed (GisPage *page)
+{
+ gis_page_set_title (GIS_PAGE (page), _("Welcome to Ubuntu"));
+}
+
+static void
+gis_ubuntu_changes_page_class_init (GisUbuntuChangesPageClass *klass)
+{
+ GisPageClass *page_class = GIS_PAGE_CLASS (klass);
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass),
"/org/gnome/initial-setup/gis-ubuntu-changes-page.ui");
+ gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (klass), activate_link);
+
+ page_class->page_id = PAGE_ID;
+ page_class->locale_changed = gis_ubuntu_changes_page_locale_changed;
+ object_class->constructed = gis_ubuntu_changes_page_constructed;
+ object_class->dispose = gis_ubuntu_changes_page_dispose;
+}
+
+static void
+gis_ubuntu_changes_page_init (GisUbuntuChangesPage *page)
+{
+ g_resources_register (ubuntu_changes_get_resource ());
+
+ gtk_widget_init_template (GTK_WIDGET (page));
+}
+
+void
+gis_prepare_ubuntu_changes_page (GisDriver *driver)
+{
+ gis_driver_add_page (driver,
+ g_object_new (GIS_TYPE_UBUNTU_CHANGES_PAGE,
+ "driver", driver,
+ NULL));
+}
diff --git a/gnome-initial-setup/pages/ubuntu-changes/gis-ubuntu-changes-page.h
b/gnome-initial-setup/pages/ubuntu-changes/gis-ubuntu-changes-page.h
new file mode 100644
index 0000000..c42993b
--- /dev/null
+++ b/gnome-initial-setup/pages/ubuntu-changes/gis-ubuntu-changes-page.h
@@ -0,0 +1,52 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/*
+ * Copyright (C) 2018 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GIS_UBUNTU_CHANGES_PAGE_H__
+#define __GIS_UBUNTU_CHANGES_PAGE_H__
+
+#include "gnome-initial-setup.h"
+
+G_BEGIN_DECLS
+
+#define GIS_TYPE_UBUNTU_CHANGES_PAGE (gis_ubuntu_changes_page_get_type ())
+#define GIS_UBUNTU_CHANGES_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj),
GIS_TYPE_UBUNTU_CHANGES_PAGE, GisUbuntuChangesPage))
+#define GIS_UBUNTU_CHANGES_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass),
GIS_TYPE_UBUNTU_CHANGES_PAGE, GisUbuntuChangesPageClass))
+#define GIS_IS_UBUNTU_CHANGES_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),
GIS_TYPE_UBUNTU_CHANGES_PAGE))
+#define GIS_IS_UBUNTU_CHANGES_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),
GIS_TYPE_UBUNTU_CHANGES_PAGE))
+#define GIS_UBUNTU_CHANGES_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),
GIS_TYPE_UBUNTU_CHANGES_PAGE, GisUbuntuChangesPageClass))
+
+typedef struct _GisUbuntuChangesPage GisUbuntuChangesPage;
+typedef struct _GisUbuntuChangesPageClass GisUbuntuChangesPageClass;
+
+struct _GisUbuntuChangesPage
+{
+ GisPage parent;
+};
+
+struct _GisUbuntuChangesPageClass
+{
+ GisPageClass parent_class;
+};
+
+GType gis_ubuntu_changes_page_get_type (void);
+
+void gis_prepare_ubuntu_changes_page (GisDriver *driver);
+
+G_END_DECLS
+
+#endif /* __GIS_UBUNTU_CHANGES_PAGE_H__ */
diff --git a/gnome-initial-setup/pages/ubuntu-changes/gis-ubuntu-changes-page.ui
b/gnome-initial-setup/pages/ubuntu-changes/gis-ubuntu-changes-page.ui
new file mode 100644
index 0000000..146bd34
--- /dev/null
+++ b/gnome-initial-setup/pages/ubuntu-changes/gis-ubuntu-changes-page.ui
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <template class="GisUbuntuChangesPage" parent="GisPage">
+ <child>
+ <object class="GtkBox" id="box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">center</property>
+ <property name="valign">fill</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel" id="title">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">center</property>
+ <property name="valign">start</property>
+ <property name="margin_top">18</property>
+ <property name="label" translatable="yes">What's new in Ubuntu</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ <attribute name="scale" value="1.8"/>
+ </attributes>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="max-width-chars">50</property>
+ <property name="halign">start</property>
+ <property name="margin_top">18</property>
+ <property name="label" translatable="yes">Ubuntu 18.04 works differently from older
versions.</property>
+ <property name="wrap">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImage" id="changes_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_top">24</property>
+ <property name="resource">/org/gnome/initial-setup/ubuntu-changes.png</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel" id="guide_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="margin_top">18</property>
+ <property name="label" translatable="yes">If you like, you can read a <a href="">quick
guide to the new system</a>.</property>
+ <property name="use-markup">True</property>
+ <property name="wrap">True</property>
+ <signal name="activate-link" handler="activate_link"/>
+ </object>
+ </child>
+ </object>
+ </child>
+ </template>
+</interface>
diff --git a/gnome-initial-setup/pages/ubuntu-changes/ubuntu-changes.gresource.xml
b/gnome-initial-setup/pages/ubuntu-changes/ubuntu-changes.gresource.xml
new file mode 100644
index 0000000..946b23b
--- /dev/null
+++ b/gnome-initial-setup/pages/ubuntu-changes/ubuntu-changes.gresource.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+ <gresource prefix="/org/gnome/initial-setup">
+ <file preprocess="xml-stripblanks" alias="gis-ubuntu-changes-page.ui">gis-ubuntu-changes-page.ui</file>
+ <file alias="ubuntu-changes.png">ubuntu-changes.png</file>
+ </gresource>
+</gresources>
+
diff --git a/gnome-initial-setup/pages/ubuntu-changes/ubuntu-changes.png
b/gnome-initial-setup/pages/ubuntu-changes/ubuntu-changes.png
new file mode 100644
index 0000000..615afd4
Binary files /dev/null and b/gnome-initial-setup/pages/ubuntu-changes/ubuntu-changes.png differ
diff --git a/gnome-initial-setup/pages/ubuntu-report/Makefile.am
b/gnome-initial-setup/pages/ubuntu-report/Makefile.am
new file mode 100644
index 0000000..a769ba5
--- /dev/null
+++ b/gnome-initial-setup/pages/ubuntu-report/Makefile.am
@@ -0,0 +1,21 @@
+
+noinst_LTLIBRARIES = libgisubuntu-report.la
+
+BUILT_SOURCES =
+
+resource_files = $(shell glib-compile-resources --sourcedir=$(srcdir) --generate-dependencies
$(srcdir)/ubuntu-report.gresource.xml)
+ubuntu-report-resources.c: ubuntu-report.gresource.xml $(resource_files)
+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $<
+ubuntu-report-resources.h: ubuntu-report.gresource.xml $(resource_files)
+ $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-header $<
+BUILT_SOURCES += ubuntu-report-resources.c ubuntu-report-resources.h
+
+libgisubuntu_report_la_SOURCES = \
+ gis-ubuntu-report-page.c gis-ubuntu-report-page.h \
+ $(BUILT_SOURCES)
+
+libgisubuntu_report_la_CFLAGS = $(INITIAL_SETUP_CFLAGS) -I "$(srcdir)/../.." -I "$(top_srcdir)" -I
"$(top_builddir)"
+libgisubuntu_report_la_LIBADD = $(INITIAL_SETUP_LIBS)
+libgisubuntu_report_la_LDFLAGS = -export_dynamic -avoid-version -module -no-undefined
+
+EXTRA_DIST = ubuntu-report.gresource.xml $(resource_files)
diff --git a/gnome-initial-setup/pages/ubuntu-report/gis-ubuntu-report-page.c
b/gnome-initial-setup/pages/ubuntu-report/gis-ubuntu-report-page.c
new file mode 100644
index 0000000..bb906a9
--- /dev/null
+++ b/gnome-initial-setup/pages/ubuntu-report/gis-ubuntu-report-page.c
@@ -0,0 +1,168 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/*
+ * Copyright (C) 2018 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* Ubuntu report page {{{1 */
+
+#define PAGE_ID "ubuntu-report"
+
+#include "config.h"
+#include "gis-ubuntu-report-page.h"
+#include "ubuntu-report-resources.h"
+
+#include <glib/gi18n.h>
+#include <gio/gio.h>
+#include <libsysmetrics.h>
+
+struct _GisUbuntuReportPagePrivate {
+ GtkWidget *opt_in_radio;
+ gchar *report;
+};
+typedef struct _GisUbuntuReportPagePrivate GisUbuntuReportPagePrivate;
+
+G_DEFINE_TYPE_WITH_PRIVATE (GisUbuntuReportPage, gis_ubuntu_report_page, GIS_TYPE_PAGE);
+
+static void
+gis_ubuntu_report_page_constructed (GObject *object)
+{
+ GisUbuntuReportPage *page = GIS_UBUNTU_REPORT_PAGE (object);
+ GisUbuntuReportPagePrivate *priv = gis_ubuntu_report_page_get_instance_private (page);
+
+ G_OBJECT_CLASS (gis_ubuntu_report_page_parent_class)->constructed (object);
+
+ gis_page_set_skippable (GIS_PAGE (page), TRUE);
+
+ gis_page_set_complete (GIS_PAGE (page), TRUE);
+ gtk_widget_show (GTK_WIDGET (page));
+}
+
+static void
+gis_ubuntu_report_page_dispose (GObject *object)
+{
+ GisUbuntuReportPage *page = GIS_UBUNTU_REPORT_PAGE (object);
+ GisUbuntuReportPagePrivate *priv = gis_ubuntu_report_page_get_instance_private (page);
+
+ g_free (priv->report);
+
+ G_OBJECT_CLASS (gis_ubuntu_report_page_parent_class)->dispose (object);
+}
+
+static void
+show_report (GtkButton *button, GisUbuntuReportPage *page)
+{
+ GisUbuntuReportPagePrivate *priv = gis_ubuntu_report_page_get_instance_private (page);
+ g_autofree char *error = NULL;
+ GtkWidget *dialog, *scroll, *text_view;
+
+ if (priv->report == NULL)
+ error = sysmetrics_collect (&priv->report);
+ if (error != NULL) {
+ dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (page))),
+ GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_CLOSE,
+ _("Failed to get report informaiton: %s"), error);
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+ return;
+ }
+
+ dialog = gtk_dialog_new_with_buttons (_("Report"),
+ GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (page))),
+ GTK_DIALOG_MODAL |
+ GTK_DIALOG_DESTROY_WITH_PARENT |
+ GTK_DIALOG_USE_HEADER_BAR,
+ NULL, NULL);
+ gtk_widget_set_size_request (dialog, 800, 600);
+
+ scroll = gtk_scrolled_window_new (NULL, NULL);
+ gtk_widget_show (scroll);
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), scroll, TRUE, TRUE, 0);
+
+ text_view = gtk_text_view_new ();
+ gtk_widget_show (text_view);
+ gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view)), priv->report, -1);
+ gtk_container_add (GTK_CONTAINER (scroll), text_view);
+
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+}
+
+static void
+gis_ubuntu_report_page_save_data (GisPage *page)
+{
+ GisUbuntuReportPagePrivate *priv = gis_ubuntu_report_page_get_instance_private (GIS_UBUNTU_REPORT_PAGE
(page));
+ g_autofree char *error = NULL;
+
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->opt_in_radio))) {
+ if (priv->report == NULL) {
+ error = sysmetrics_collect (&priv->report);
+ if (error != NULL) {
+ g_warning ("Failed to get report data: %s", error);
+ return;
+ }
+ }
+
+ error = sysmetrics_send_report (priv->report, FALSE, "");
+ if (error != NULL)
+ g_warning ("Failed to send report: %s", error);
+ } else {
+ error = sysmetrics_send_decline (FALSE, "");
+ if (error != NULL)
+ g_warning ("Failed to send decline: %s", error);
+ }
+}
+
+static void
+gis_ubuntu_report_page_locale_changed (GisPage *page)
+{
+ gis_page_set_title (GIS_PAGE (page), _("Welcome to Ubuntu"));
+}
+
+static void
+gis_ubuntu_report_page_class_init (GisUbuntuReportPageClass *klass)
+{
+ GisPageClass *page_class = GIS_PAGE_CLASS (klass);
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass),
"/org/gnome/initial-setup/gis-ubuntu-report-page.ui");
+ gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisUbuntuReportPage, opt_in_radio);
+ gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (klass), show_report);
+
+ page_class->page_id = PAGE_ID;
+ page_class->locale_changed = gis_ubuntu_report_page_locale_changed;
+ page_class->save_data = gis_ubuntu_report_page_save_data;
+ object_class->constructed = gis_ubuntu_report_page_constructed;
+ object_class->dispose = gis_ubuntu_report_page_dispose;
+}
+
+static void
+gis_ubuntu_report_page_init (GisUbuntuReportPage *page)
+{
+ g_resources_register (ubuntu_report_get_resource ());
+
+ gtk_widget_init_template (GTK_WIDGET (page));
+}
+
+void
+gis_prepare_ubuntu_report_page (GisDriver *driver)
+{
+ gis_driver_add_page (driver,
+ g_object_new (GIS_TYPE_UBUNTU_REPORT_PAGE,
+ "driver", driver,
+ NULL));
+}
diff --git a/gnome-initial-setup/pages/ubuntu-report/gis-ubuntu-report-page.h
b/gnome-initial-setup/pages/ubuntu-report/gis-ubuntu-report-page.h
new file mode 100644
index 0000000..1e5063f
--- /dev/null
+++ b/gnome-initial-setup/pages/ubuntu-report/gis-ubuntu-report-page.h
@@ -0,0 +1,52 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/*
+ * Copyright (C) 2018 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GIS_UBUNTU_REPORT_PAGE_H__
+#define __GIS_UBUNTU_REPORT_PAGE_H__
+
+#include "gnome-initial-setup.h"
+
+G_BEGIN_DECLS
+
+#define GIS_TYPE_UBUNTU_REPORT_PAGE (gis_ubuntu_report_page_get_type ())
+#define GIS_UBUNTU_REPORT_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj),
GIS_TYPE_UBUNTU_REPORT_PAGE, GisUbuntuReportPage))
+#define GIS_UBUNTU_REPORT_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass),
GIS_TYPE_UBUNTU_REPORT_PAGE, GisUbuntuReportPageClass))
+#define GIS_IS_UBUNTU_REPORT_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),
GIS_TYPE_UBUNTU_REPORT_PAGE))
+#define GIS_IS_UBUNTU_REPORT_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),
GIS_TYPE_UBUNTU_REPORT_PAGE))
+#define GIS_UBUNTU_REPORT_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),
GIS_TYPE_UBUNTU_REPORT_PAGE, GisUbuntuReportPageClass))
+
+typedef struct _GisUbuntuReportPage GisUbuntuReportPage;
+typedef struct _GisUbuntuReportPageClass GisUbuntuReportPageClass;
+
+struct _GisUbuntuReportPage
+{
+ GisPage parent;
+};
+
+struct _GisUbuntuReportPageClass
+{
+ GisPageClass parent_class;
+};
+
+GType gis_ubuntu_report_page_get_type (void);
+
+void gis_prepare_ubuntu_report_page (GisDriver *driver);
+
+G_END_DECLS
+
+#endif /* __GIS_UBUNTU_REPORT_PAGE_H__ */
diff --git a/gnome-initial-setup/pages/ubuntu-report/gis-ubuntu-report-page.ui
b/gnome-initial-setup/pages/ubuntu-report/gis-ubuntu-report-page.ui
new file mode 100644
index 0000000..46b3461
--- /dev/null
+++ b/gnome-initial-setup/pages/ubuntu-report/gis-ubuntu-report-page.ui
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <template class="GisUbuntuReportPage" parent="GisPage">
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">center</property>
+ <property name="valign">fill</property>
+ <property name="orientation">vertical</property>
+<!-- <child>
+ <object class="GtkImage">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixel_size">96</property>
+ <property name="icon_name">preferences-system-privacy-symbolic</property>
+ <property name="icon_size">1</property>
+ <property name="margin_top">24</property>
+ <style>
+ <class name="dim-label" />
+ </style>
+ </object>
+ </child> -->
+ <child>
+ <object class="GtkLabel" id="title">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">center</property>
+ <property name="valign">start</property>
+ <property name="margin_top">18</property>
+ <property name="label" translatable="yes">Help improve Ubuntu</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ <attribute name="scale" value="1.8"/>
+ </attributes>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="max-width-chars">50</property>
+ <property name="halign">center</property>
+ <property name="margin_top">18</property>
+ <property name="label" translatable="yes">Ubuntu can report information that helps developers
improve it. This includes things like computer model, what software is installed, and the approximate
location you chose (FIXME).</property>
+ <property name="wrap">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">center</property>
+ <property name="orientation">horizontal</property>
+ <property name="homogeneous">True</property>
+ <property name="margin_top">18</property>
+ <child>
+ <object class="GtkButton">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Show the First Report</property>
+ <signal name="clicked" handler="show_report"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkButton">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Show the Privacy Policy</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">center</property>
+ <property name="orientation">vertical</property>
+ <property name="margin_top">18</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_top">18</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Would you like to send this information?</property>
+ <property name="wrap">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="opt_in_radio">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Yes, send occasional system info to
Canonical</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="opt_out_radio">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">No, don't send any info</property>
+ <property name="group">opt_in_radio</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel" id="footer_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">You can change your mind later in Settings -> Privacy
-> Diagnostics.</property>
+ <property name="justify">center</property>
+ <property name="wrap">True</property>
+ <property name="margin_bottom">18</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </template>
+</interface>
diff --git a/gnome-initial-setup/pages/ubuntu-report/ubuntu-report.gresource.xml
b/gnome-initial-setup/pages/ubuntu-report/ubuntu-report.gresource.xml
new file mode 100644
index 0000000..7ab30ac
--- /dev/null
+++ b/gnome-initial-setup/pages/ubuntu-report/ubuntu-report.gresource.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+ <gresource prefix="/org/gnome/initial-setup">
+ <file preprocess="xml-stripblanks" alias="gis-ubuntu-report-page.ui">gis-ubuntu-report-page.ui</file>
+ </gresource>
+</gresources>
+
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 7af03af..5613b06 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -41,3 +41,11 @@ gnome-initial-setup/pages/timezone/gis-timezone-page.c
[type: gettext/glade]gnome-initial-setup/pages/timezone/gis-timezone-page.ui
gnome-initial-setup/pages/software/gis-software-page.c
[type: gettext/glade]gnome-initial-setup/pages/software/gis-software-page.ui
+gnome-initial-setup/pages/ubuntu-report/gis-ubuntu-report-page.c
+[type: gettext/glade]gnome-initial-setup/pages/ubuntu-report/gis-ubuntu-report-page.ui
+gnome-initial-setup/pages/livepatch/gis-livepatch-page.c
+[type: gettext/glade]gnome-initial-setup/pages/livepatch/gis-livepatch-page.ui
+gnome-initial-setup/pages/ubuntu-changes/gis-ubuntu-changes-page.c
+[type: gettext/glade]gnome-initial-setup/pages/ubuntu-changes/gis-ubuntu-changes-page.ui
+gnome-initial-setup/pages/apps/gis-apps-page.c
+[type: gettext/glade]gnome-initial-setup/pages/apps/gis-apps-page.ui
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]