[gnome-initial-setup/wip/pwithnall/misc-fixes: 43/70] Launch eos-installer on eosinstaller images
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-initial-setup/wip/pwithnall/misc-fixes: 43/70] Launch eos-installer on eosinstaller images
- Date: Fri, 11 Sep 2020 13:29:14 +0000 (UTC)
commit 5eaad25f1552c30c8293739a4f61d223e42ef2a7
Author: Will Thompson <will willthompson co uk>
Date: Mon Feb 19 14:00:27 2018 +0000
Launch eos-installer on eosinstaller images
Historically, eosinstaller images did not include gnome-initial-setup.
Instead, the eos-installer-standalone package installed replacement
files to cause gdm to launch eos-installer directly, instead.
This avoided any changes to gnome-initial-setup itself. But
unfortunately it introduced its own problems: gnome-initial-setup is
moderately coupled to the corresponding versions of gdm and gnome-shell,
so eos-installer's copies of the initial-setup session and shell mode
had to be manually kept in sync with each GNOME rebase.
Since this was originally implemented, we added support for combined
live + installer images, and taught gnome-initial-setup how to launch
eos-installer. At this point, it is simpler to include the real
gnome-initial-setup in eosinstaller images, too, and make it
unconditionally launch eos-installer after the language selection page.
This brings the eosinstaller image closer to the (much more frequently
tested) ISOs.
(Rebase 3.38: Fix minor rebase conflicts.)
https://phabricator.endlessm.com/T17082
gnome-initial-setup/gis-driver.c | 17 +++++++++++++++
gnome-initial-setup/gis-driver.h | 2 ++
.../pages/live-chooser/gis-live-chooser-page.c | 24 ++++++++++++++++++----
3 files changed, 39 insertions(+), 4 deletions(-)
---
diff --git a/gnome-initial-setup/gis-driver.c b/gnome-initial-setup/gis-driver.c
index c0e50c16..b74cf6c3 100644
--- a/gnome-initial-setup/gis-driver.c
+++ b/gnome-initial-setup/gis-driver.c
@@ -98,6 +98,7 @@ struct _GisDriverPrivate {
gboolean is_live_session;
gboolean is_live_dvd;
+ gboolean is_reformatter;
GisDriverMode mode;
UmAccountMode account_mode;
@@ -195,6 +196,13 @@ get_image_version (void)
return image_version;
}
+static gboolean
+image_is_reformatter (const gchar *image_version)
+{
+ return image_version != NULL &&
+ g_str_has_prefix (image_version, "eosinstaller-");
+}
+
static gchar *
get_product_from_image_version (const gchar *image_version)
{
@@ -774,6 +782,13 @@ gis_driver_is_live_session (GisDriver *driver)
return priv->is_live_session;
}
+gboolean
+gis_driver_is_reformatter (GisDriver *driver)
+{
+ GisDriverPrivate *priv = gis_driver_get_instance_private (driver);
+ return priv->is_reformatter;
+}
+
gboolean
gis_driver_is_small_screen (GisDriver *driver)
{
@@ -1081,6 +1096,8 @@ gis_driver_startup (GApplication *app)
g_object_notify_by_pspec (G_OBJECT (driver), obj_props[PROP_LIVE_SESSION]);
g_object_notify_by_pspec (G_OBJECT (driver), obj_props[PROP_LIVE_DVD]);
+ priv->is_reformatter = image_is_reformatter (image_version);
+
gis_driver_set_user_language (driver, setlocale (LC_MESSAGES, NULL), FALSE);
prepare_main_window (driver);
diff --git a/gnome-initial-setup/gis-driver.h b/gnome-initial-setup/gis-driver.h
index dd429747..f8a2ac59 100644
--- a/gnome-initial-setup/gis-driver.h
+++ b/gnome-initial-setup/gis-driver.h
@@ -124,6 +124,8 @@ GisDriverMode gis_driver_get_mode (GisDriver *driver);
gboolean gis_driver_is_live_session (GisDriver *driver);
+gboolean gis_driver_is_reformatter (GisDriver *driver);
+
gboolean gis_driver_is_small_screen (GisDriver *driver);
const gchar *gis_driver_get_product_name (GisDriver *driver);
diff --git a/gnome-initial-setup/pages/live-chooser/gis-live-chooser-page.c
b/gnome-initial-setup/pages/live-chooser/gis-live-chooser-page.c
index 0fa581d6..8a5a1693 100644
--- a/gnome-initial-setup/pages/live-chooser/gis-live-chooser-page.c
+++ b/gnome-initial-setup/pages/live-chooser/gis-live-chooser-page.c
@@ -132,6 +132,9 @@ on_reformatter_exited (GisLiveChooserPage *page,
gis_driver_show_window (driver);
+ if (gis_driver_is_reformatter (driver))
+ gis_assistant_previous_page (gis_driver_get_assistant (driver));
+
if (error != NULL)
{
GtkWindow *toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (page)));
@@ -163,7 +166,7 @@ reformatter_exited_cb (GObject *source,
}
static void
-reformat_button_clicked (GisLiveChooserPage *page)
+gis_live_chooser_page_launch_reformatter (GisLiveChooserPage *page)
{
g_autoptr(GSubprocessLauncher) launcher = NULL;
g_autoptr(GSubprocess) subprocess = NULL;
@@ -206,7 +209,7 @@ gis_live_chooser_page_constructed (GObject *object)
g_signal_connect_swapped (priv->reformat_button,
"clicked",
- G_CALLBACK (reformat_button_clicked),
+ G_CALLBACK (gis_live_chooser_page_launch_reformatter),
page);
g_object_bind_property (driver, "live-dvd", priv->try_label, "visible", G_BINDING_SYNC_CREATE |
G_BINDING_INVERT_BOOLEAN);
@@ -233,6 +236,15 @@ gis_live_chooser_page_locale_changed (GisPage *page)
gis_page_set_title (page, _("Try or Reformat"));
}
+static void
+gis_live_chooser_page_shown (GisPage *page)
+{
+ GisLiveChooserPage *self = GIS_LIVE_CHOOSER_PAGE (page);
+
+ if (gis_driver_is_reformatter (page->driver))
+ gis_live_chooser_page_launch_reformatter (self);
+}
+
static void
gis_live_chooser_page_class_init (GisLiveChooserPageClass *klass)
{
@@ -242,6 +254,7 @@ gis_live_chooser_page_class_init (GisLiveChooserPageClass *klass)
page_class->page_id = "live-chooser";
page_class->locale_changed = gis_live_chooser_page_locale_changed;
page_class->save_data = gis_live_chooser_page_save_data;
+ page_class->shown = gis_live_chooser_page_shown;
gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass),
"/org/gnome/initial-setup/gis-live-chooser-page.ui");
@@ -267,8 +280,11 @@ gis_live_chooser_page_init (GisLiveChooserPage *page)
GisPage *
gis_prepare_live_chooser_page (GisDriver *driver)
{
- /* Only show this page when running on a live boot session */
- if (!gis_driver_is_live_session (driver))
+ /* Only include this page when running on live media or as a standalone
+ * reformatter.
+ */
+ if (!gis_driver_is_live_session (driver) &&
+ !gis_driver_is_reformatter (driver))
return NULL;
return g_object_new (GIS_TYPE_LIVE_CHOOSER_PAGE,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]