summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <wjt@endlessos.org>2023-04-25 10:17:37 +0000
committerWill Thompson <wjt@endlessos.org>2023-04-25 10:17:37 +0000
commit4d6bb4767568c0969ef54ae820817f72f9d8fb0c (patch)
tree9945c3c74bc380ea4e4de7fd059bfbb548758eeb
parent673725a850083b792b95417514bf693fa9268bf7 (diff)
parentf4aa883b1d6d92633092c70200fd60fc1d23ccda (diff)
downloadgnome-initial-setup-4d6bb4767568c0969ef54ae820817f72f9d8fb0c.tar.gz
Merge branch 'mcatanzaro/abrt-tweaks' into 'master'
Misc tweaks for ABRT setting on privacy page See merge request GNOME/gnome-initial-setup!204
-rw-r--r--gnome-initial-setup/pages/privacy/gis-privacy-page.c50
-rw-r--r--gnome-initial-setup/pages/privacy/gis-privacy-page.ui1
2 files changed, 24 insertions, 27 deletions
diff --git a/gnome-initial-setup/pages/privacy/gis-privacy-page.c b/gnome-initial-setup/pages/privacy/gis-privacy-page.c
index 8c9f47e..b910651 100644
--- a/gnome-initial-setup/pages/privacy/gis-privacy-page.c
+++ b/gnome-initial-setup/pages/privacy/gis-privacy-page.c
@@ -52,7 +52,7 @@ typedef struct _GisPrivacyPagePrivate GisPrivacyPagePrivate;
G_DEFINE_TYPE_WITH_PRIVATE (GisPrivacyPage, gis_privacy_page, GIS_TYPE_PAGE);
-static void
+static gboolean
update_os_data (GisPrivacyPage *page)
{
GisPrivacyPagePrivate *priv = gis_privacy_page_get_instance_private (page);
@@ -61,28 +61,27 @@ update_os_data (GisPrivacyPage *page)
g_autofree char *subtitle = NULL;
if (!name)
- name = g_strdup ("GNOME");
+ return FALSE;
if (privacy_policy)
{
/* Translators: the first parameter here is the name of a distribution,
- * like "Fedora" or "Ubuntu". It falls back to "GNOME" if we can't
- * detect any distribution.
+ * like "Fedora" or "Ubuntu".
*/
- subtitle = g_strdup_printf (_("Sends technical reports that have personal information automatically "
- "removed. Data is collected by %1$s (<a href='%2$s'>privacy policy</a>)."),
- name, privacy_policy);
+ subtitle = g_strdup_printf (_("Sends technical reports that do not contain personal information. "
+ "Data is collected by %1$s (<a href='%2$s'>privacy policy</a>)."),
+ name, privacy_policy);
}
else
{
/* Translators: the parameter here is the name of a distribution,
- * like "Fedora" or "Ubuntu". It falls back to "GNOME" if we can't
- * detect any distribution.
+ * like "Fedora" or "Ubuntu".
*/
- subtitle = g_strdup_printf (_("Sends technical reports that have personal information automatically "
- "removed. Data is collected by %s."), name);
+ subtitle = g_strdup_printf (_("Sends technical reports that do not contain personal information. "
+ "Data is collected by %s."), name);
}
gtk_label_set_markup (GTK_LABEL (priv->reporting_label), subtitle);
+ return TRUE;
}
static void
@@ -124,15 +123,16 @@ gis_privacy_page_constructed (GObject *object)
gtk_switch_set_active (GTK_SWITCH (priv->location_switch), TRUE);
gtk_switch_set_active (GTK_SWITCH (priv->reporting_switch), TRUE);
- update_os_data (page);
-
- priv->abrt_watch_id = g_bus_watch_name (G_BUS_TYPE_SYSTEM,
- "org.freedesktop.problems.daemon",
- G_BUS_NAME_WATCHER_FLAGS_NONE,
- abrt_appeared_cb,
- abrt_vanished_cb,
- page,
- NULL);
+ if (update_os_data (page))
+ {
+ priv->abrt_watch_id = g_bus_watch_name (G_BUS_TYPE_SYSTEM,
+ "org.freedesktop.problems.daemon",
+ G_BUS_NAME_WATCHER_FLAGS_NONE,
+ abrt_appeared_cb,
+ abrt_vanished_cb,
+ page,
+ NULL);
+ }
}
static void
@@ -144,11 +144,7 @@ gis_privacy_page_dispose (GObject *object)
g_clear_object (&priv->location_settings);
g_clear_object (&priv->privacy_settings);
- if (priv->abrt_watch_id > 0)
- {
- g_bus_unwatch_name (priv->abrt_watch_id);
- priv->abrt_watch_id = 0;
- }
+ g_clear_handle_id (&priv->abrt_watch_id, g_bus_unwatch_name);
G_OBJECT_CLASS (gis_privacy_page_parent_class)->dispose (object);
}
@@ -161,10 +157,10 @@ gis_privacy_page_apply (GisPage *gis_page,
GisPrivacyPagePrivate *priv = gis_privacy_page_get_instance_private (page);
gboolean active;
- active = gtk_switch_get_active (GTK_SWITCH (priv->location_switch));
+ active = gtk_widget_is_visible (priv->location_switch) && gtk_switch_get_active (GTK_SWITCH (priv->location_switch));
g_settings_set_boolean (priv->location_settings, "enabled", active);
- active = gtk_switch_get_active (GTK_SWITCH (priv->reporting_switch));
+ active = gtk_widget_is_visible (priv->reporting_switch) && gtk_switch_get_active (GTK_SWITCH (priv->reporting_switch));
g_settings_set_boolean (priv->privacy_settings, "report-technical-problems", active);
return FALSE;
diff --git a/gnome-initial-setup/pages/privacy/gis-privacy-page.ui b/gnome-initial-setup/pages/privacy/gis-privacy-page.ui
index 6c48d5f..9ce8447 100644
--- a/gnome-initial-setup/pages/privacy/gis-privacy-page.ui
+++ b/gnome-initial-setup/pages/privacy/gis-privacy-page.ui
@@ -54,6 +54,7 @@
<child>
<object class="AdwPreferencesGroup" id="reporting_group">
<property name="margin-top">12</property>
+ <property name="visible">False</property>
<child>
<object class="AdwActionRow" id="reporting_row">
<property name="title" translatable="yes">Automatic Problem Reporting</property>