[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: Tue, 23 Jun 2020 19:06:23 +0000 (UTC)
commit 599be8a1b9795b951807e62ff11d033bef6ea666
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 | 16 +++++++++++++---
1 file changed, 13 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..9c964c71 100644
--- a/gnome-initial-setup/pages/timezone/gis-timezone-page.c
+++ b/gnome-initial-setup/pages/timezone/gis-timezone-page.c
@@ -387,6 +387,17 @@ 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 +429,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 +440,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]