Merge lp:~jamesh/gnome-control-center/ubuntu-bug-1720331 into lp:~ubuntu-desktop/gnome-control-center/ubuntu

Proposed by James Henstridge
Status: Merged
Merged at revision: 782
Proposed branch: lp:~jamesh/gnome-control-center/ubuntu-bug-1720331
Merge into: lp:~ubuntu-desktop/gnome-control-center/ubuntu
Diff against target: 158 lines (+48/-23)
2 files modified
debian/changelog (+7/-0)
debian/patches/privacy-panel-whoopsie.patch (+41/-23)
To merge this branch: bzr merge lp:~jamesh/gnome-control-center/ubuntu-bug-1720331
Reviewer Review Type Date Requested Status
Jeremy Bícha Approve
Review via email: mp+332101@code.launchpad.net

Commit message

Avoid blocking the UI when toggling crash reporting, and try to avoid the whoopsie restart loop by checking the current value of the ReportCrashes property before calling SetReportCrashes.

Description of the change

Avoid blocking the UI when toggling crash reporting, and try to avoid the whoopsie restart loop by checking the current value of the ReportCrashes property before calling SetReportCrashes.

To post a comment you must log in.
Revision history for this message
James Henstridge (jamesh) wrote :

While it would be nice to get this in since it avoids blocking the UI, the whoopsie restart loop is gone now that whoopsie-preferences 0.19 is in the archive. So this probably isn't a blocker for 17.10.

Revision history for this message
Jeremy Bícha (jbicha) wrote :

Thanks! Uploading to bionic.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2017-10-11 06:02:23 +0000
3+++ debian/changelog 2017-10-11 09:56:15 +0000
4@@ -1,9 +1,16 @@
5 gnome-control-center (1:3.26.1-0ubuntu3) UNRELEASED; urgency=medium
6
7+ [ Sebastien Bacher ]
8 * debian/patches/71_ubuntu_dock_settings.patch:
9 - increase the default height to accomodate for our extra panel
10 (lp: #1722079)
11
12+ [ James Henstridge ]
13+ * debian/patches/privacy-panel-whoopsie.patch:
14+ - use an asynchronous D-Bus call when toggling crash reporting, and
15+ avoid calling SetReportCrashes when setting to the current value.
16+ (LP: #1720331)
17+
18 -- Sebastien Bacher <seb128@ubuntu.com> Wed, 11 Oct 2017 07:01:03 +0200
19
20 gnome-control-center (1:3.26.1-0ubuntu2) artful; urgency=medium
21
22=== modified file 'debian/patches/privacy-panel-whoopsie.patch'
23--- debian/patches/privacy-panel-whoopsie.patch 2017-09-14 08:05:40 +0000
24+++ debian/patches/privacy-panel-whoopsie.patch 2017-10-11 09:56:15 +0000
25@@ -2,10 +2,10 @@
26 Date: Thu, 14 Sep 2017 10:58:16 +0800
27 Subject: [PATCH] panels/privacy: add Whoopsie support to privacy panel
28
29-Index: gnome-control-center-3.25.92.1/configure.ac
30+Index: gnome-control-center-3.26.1/configure.ac
31 ===================================================================
32---- gnome-control-center-3.25.92.1.orig/configure.ac
33-+++ gnome-control-center-3.25.92.1/configure.ac
34+--- gnome-control-center-3.26.1.orig/configure.ac
35++++ gnome-control-center-3.26.1/configure.ac
36 @@ -193,6 +193,11 @@ if test "x$have_wayland" = xyes ; then
37 fi
38 fi
39@@ -18,10 +18,10 @@
40 # Panels that must be built on Linux systems
41 linux_error_or_warn()
42 {
43-Index: gnome-control-center-3.25.92.1/panels/privacy/cc-privacy-panel.c
44+Index: gnome-control-center-3.26.1/panels/privacy/cc-privacy-panel.c
45 ===================================================================
46---- gnome-control-center-3.25.92.1.orig/panels/privacy/cc-privacy-panel.c
47-+++ gnome-control-center-3.25.92.1/panels/privacy/cc-privacy-panel.c
48+--- gnome-control-center-3.26.1.orig/panels/privacy/cc-privacy-panel.c
49++++ gnome-control-center-3.26.1/panels/privacy/cc-privacy-panel.c
50 @@ -33,6 +33,12 @@
51 typedef struct _NMClient NMClient;
52 #endif
53@@ -46,7 +46,7 @@
54
55 GCancellable *cancellable;
56
57-@@ -1206,25 +1215,56 @@ abrt_vanished_cb (GDBusConnection *conne
58+@@ -1206,25 +1215,74 @@ abrt_vanished_cb (GDBusConnection *conne
59 gtk_widget_hide (self->priv->abrt_row);
60 }
61
62@@ -62,26 +62,44 @@
63 +
64 + gtk_label_set_text (GTK_LABEL (self->priv->abrt_status),
65 + report_crashes ? _("Automatic") : _("Manual"));
66-+ gtk_switch_set_active (GTK_SWITCH (self->priv->abrt_switch), report_crashes);
67++ gtk_switch_set_state (GTK_SWITCH (self->priv->abrt_switch), report_crashes);
68 +}
69 +
70 +static void
71-+whoopsie_switch_activated (GtkSwitch *sw,
72-+ GParamSpec *param_spec,
73-+ gpointer user_data)
74++whoopsie_set_report_crashes_done (GObject *source_object,
75++ GAsyncResult *res,
76++ gpointer user_data)
77 +{
78-+ CcPrivacyPanel *self = user_data;
79-+ gboolean report_crashes = gtk_switch_get_active (sw);
80++ WhoopsiePreferences *whoopsie = WHOOPSIE_PREFERENCES (source_object);
81 + GError *error = NULL;
82 +
83-+ whoopsie_preferences_call_set_report_crashes_sync (self->priv->whoopsie,
84-+ report_crashes, NULL, &error);
85-+ if (error != NULL)
86++ if (!whoopsie_preferences_call_set_report_crashes_finish (whoopsie,
87++ res, &error))
88 + {
89 + g_warning ("Failed to toggle crash reporting: %s", error->message);
90 + g_error_free (error);
91 + }
92 +}
93++
94++static gboolean
95++whoopsie_switch_state_set (GtkSwitch *sw G_GNUC_UNUSED,
96++ gboolean state,
97++ gpointer user_data)
98++{
99++ CcPrivacyPanel *self = user_data;
100++ gboolean old_report_crashes;
101++
102++ old_report_crashes = whoopsie_preferences_get_report_crashes (self->priv->whoopsie);
103++ if (state != old_report_crashes)
104++ {
105++ whoopsie_preferences_call_set_report_crashes (self->priv->whoopsie,
106++ state, NULL,
107++ whoopsie_set_report_crashes_done,
108++ NULL);
109++ }
110++
111++ return FALSE;
112++}
113 +#endif
114 +
115 static void
116@@ -110,7 +128,7 @@
117
118 os_name = get_os_name ();
119 /* translators: '%s' is the distributor's name, such as 'Fedora' */
120-@@ -1245,13 +1285,54 @@ add_abrt (CcPrivacyPanel *self)
121+@@ -1245,13 +1303,54 @@ add_abrt (CcPrivacyPanel *self)
122 gtk_label_set_markup (GTK_LABEL (gtk_builder_get_object (self->priv->builder, "abrt_policy_linklabel")), msg);
123 g_free (msg);
124
125@@ -136,8 +154,8 @@
126 + g_signal_connect (self->priv->whoopsie, "g-properties-changed",
127 + G_CALLBACK (whoopsie_properties_changed), self);
128 + whoopsie_properties_changed (self->priv->whoopsie, NULL, NULL, self);
129-+ g_signal_connect (self->priv->abrt_switch, "notify::active",
130-+ G_CALLBACK (whoopsie_switch_activated), self);
131++ g_signal_connect (self->priv->abrt_switch, "state-set",
132++ G_CALLBACK (whoopsie_switch_state_set), self);
133 + gtk_widget_show (self->priv->abrt_row);
134 + }
135 + else
136@@ -172,7 +190,7 @@
137 }
138
139 #ifdef BUILD_NETWORK
140-@@ -1374,6 +1455,7 @@ cc_privacy_panel_finalize (GObject *obje
141+@@ -1374,6 +1473,7 @@ cc_privacy_panel_finalize (GObject *obje
142 g_clear_object (&priv->cancellable);
143 g_clear_object (&priv->perm_store);
144 g_clear_object (&priv->location_icon_size_group);
145@@ -180,10 +198,10 @@
146 g_clear_pointer (&priv->location_apps_perms, g_variant_unref);
147 g_clear_pointer (&priv->location_apps_data, g_variant_unref);
148 g_clear_pointer (&priv->location_app_switches, g_hash_table_unref);
149-Index: gnome-control-center-3.25.92.1/panels/privacy/Makefile.am
150+Index: gnome-control-center-3.26.1/panels/privacy/Makefile.am
151 ===================================================================
152---- gnome-control-center-3.25.92.1.orig/panels/privacy/Makefile.am
153-+++ gnome-control-center-3.25.92.1/panels/privacy/Makefile.am
154+--- gnome-control-center-3.26.1.orig/panels/privacy/Makefile.am
155++++ gnome-control-center-3.26.1/panels/privacy/Makefile.am
156 @@ -4,6 +4,7 @@ AM_CPPFLAGS = \
157 $(PANEL_CFLAGS) \
158 $(PRIVACY_PANEL_CFLAGS) \

Subscribers

People subscribed via source and target branches