[gnome-initial-setup/wip/dont-tz-me] timezone: Don't set timezone if tz page is skipped
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-initial-setup/wip/dont-tz-me] timezone: Don't set timezone if tz page is skipped
- Date: Wed, 24 Jun 2020 14:03:26 +0000 (UTC)
commit 1f60d2af87a3fc1632090bd8dbef8587fc0d92da
Author: Ray Strode <rstrode redhat com>
Date: Tue Jun 23 14:54:49 2020 -0400
timezone: Don't set timezone if tz page is skipped
At the moment we still set the timezone from geoclue
even if the page is supposed to be skipped.
This commit defers setting up the geoclue proxy until the
page is added to the stack.
Fixes https://gitlab.gnome.org/GNOME/gnome-initial-setup/-/issues/106
gnome-initial-setup/pages/timezone/gis-timezone-page.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/gnome-initial-setup/pages/timezone/gis-timezone-page.c
b/gnome-initial-setup/pages/timezone/gis-timezone-page.c
index ca1088ee..8a5187c5 100644
--- a/gnome-initial-setup/pages/timezone/gis-timezone-page.c
+++ b/gnome-initial-setup/pages/timezone/gis-timezone-page.c
@@ -387,6 +387,18 @@ stop_geolocation (GisTimezonePage *page)
g_clear_object (&priv->geoclue_simple);
}
+static void
+page_added (GisTimezonePage *page)
+{
+ GisTimezonePagePrivate *priv = gis_timezone_page_get_instance_private (page);
+
+ if (priv->geoclue_cancellable == NULL)
+ {
+ priv->geoclue_cancellable = g_cancellable_new ();
+ get_location_from_geoclue_async (page);
+ }
+}
+
static void
gis_timezone_page_constructed (GObject *object)
{
@@ -418,10 +430,7 @@ gis_timezone_page_constructed (GObject *object)
priv->clock_format = g_settings_get_enum (settings, CLOCK_FORMAT_KEY);
g_object_unref (settings);
- priv->geoclue_cancellable = g_cancellable_new ();
-
set_location (page, NULL);
- get_location_from_geoclue_async (page);
priv->search_entry_text_changed_id =
g_signal_connect (priv->search_entry, "changed",
@@ -432,6 +441,8 @@ gis_timezone_page_constructed (GObject *object)
G_CALLBACK (entry_mapped), page);
g_signal_connect (priv->map, "location-changed",
G_CALLBACK (map_location_changed), page);
+ g_signal_connect (GTK_WIDGET (page), "parent-set",
+ G_CALLBACK (page_added), NULL);
gtk_widget_show (GTK_WIDGET (page));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]