|
Matej Habrnal |
30183d |
From abdedafd3a530ad4baa992010a3cfc87645d98d1 Mon Sep 17 00:00:00 2001
|
|
Matej Habrnal |
30183d |
From: Jakub Filak <jfilak@redhat.com>
|
|
Matej Habrnal |
30183d |
Date: Sat, 16 May 2015 06:51:37 +0200
|
|
Matej Habrnal |
30183d |
Subject: [PATCH] config UI: Automatic reporting from GSettings
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
If Privacy panels exists:
|
|
Matej Habrnal |
30183d |
Make the widget insensitive because the user can only read its value.
|
|
Matej Habrnal |
30183d |
Add a button launching Privacy panel.
|
|
Matej Habrnal |
30183d |
Else:
|
|
Matej Habrnal |
30183d |
Read/write the GSettings and show a warning about modifying the
|
|
Matej Habrnal |
30183d |
GSettings.
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
Signed-off-by: Jakub Filak <jfilak@redhat.com>
|
|
Matej Habrnal |
30183d |
---
|
|
Matej Habrnal |
30183d |
po/POTFILES.in | 1 +
|
|
Matej Habrnal |
30183d |
src/configuration-gui/abrt-config-widget.c | 201 +++++++++++++++++++++++--
|
|
Matej Habrnal |
30183d |
src/configuration-gui/abrt-config-widget.glade | 82 ++++------
|
|
Matej Habrnal |
30183d |
3 files changed, 217 insertions(+), 67 deletions(-)
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
diff --git a/po/POTFILES.in b/po/POTFILES.in
|
|
Matej Habrnal |
30183d |
index 0da1396..8c31438 100644
|
|
Matej Habrnal |
30183d |
--- a/po/POTFILES.in
|
|
Matej Habrnal |
30183d |
+++ b/po/POTFILES.in
|
|
Matej Habrnal |
30183d |
@@ -3,6 +3,7 @@
|
|
Matej Habrnal |
30183d |
# Please keep this file sorted alphabetically.
|
|
Matej Habrnal |
30183d |
src/applet/abrt-applet.desktop.in
|
|
Matej Habrnal |
30183d |
src/applet/applet.c
|
|
Matej Habrnal |
30183d |
+src/configuration-gui/abrt-config-widget.c
|
|
Matej Habrnal |
30183d |
src/configuration-gui/abrt-config-widget.glade
|
|
Matej Habrnal |
30183d |
src/configuration-gui/system-config-abrt.c
|
|
Matej Habrnal |
30183d |
src/configuration-gui/main.c
|
|
Matej Habrnal |
30183d |
diff --git a/src/configuration-gui/abrt-config-widget.c b/src/configuration-gui/abrt-config-widget.c
|
|
Matej Habrnal |
30183d |
index 8bfc269..c9b0b02 100644
|
|
Matej Habrnal |
30183d |
--- a/src/configuration-gui/abrt-config-widget.c
|
|
Matej Habrnal |
30183d |
+++ b/src/configuration-gui/abrt-config-widget.c
|
|
Matej Habrnal |
30183d |
@@ -21,6 +21,8 @@
|
|
Matej Habrnal |
30183d |
#endif
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
#include "abrt-config-widget.h"
|
|
Matej Habrnal |
30183d |
+#include <satyr/utils.h>
|
|
Matej Habrnal |
30183d |
+#include <gio/gdesktopappinfo.h>
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
#include "libabrt.h"
|
|
Matej Habrnal |
30183d |
#include <assert.h>
|
|
Matej Habrnal |
30183d |
@@ -32,19 +34,36 @@
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
#define UI_FILE_NAME "abrt-config-widget.glade"
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
+/* AbrtConfigWidgetPrivate:
|
|
Matej Habrnal |
30183d |
+ * + AbrtConfigWidgetOption == "abrt-option" of GtkSwitch
|
|
Matej Habrnal |
30183d |
+ * + AbrtConfigWidgetOption == "abrt-option" of GtkSwitch
|
|
Matej Habrnal |
30183d |
+ * + ...
|
|
Matej Habrnal |
30183d |
+ *
|
|
Matej Habrnal |
30183d |
+ * + AbrtAppConfiguration == config of AbrtConfigWidgetOption
|
|
Matej Habrnal |
30183d |
+ * + AbrtAppConfiguration == config of AbrtConfigWidgetOption
|
|
Matej Habrnal |
30183d |
+ * + ...
|
|
Matej Habrnal |
30183d |
+ */
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
+/* This structure represents either an ABRT configuration file or a GSettings
|
|
Matej Habrnal |
30183d |
+ * schema.
|
|
Matej Habrnal |
30183d |
+ */
|
|
Matej Habrnal |
30183d |
typedef struct {
|
|
Matej Habrnal |
30183d |
- char *app_name;
|
|
Matej Habrnal |
30183d |
- map_string_t *settings;
|
|
Matej Habrnal |
30183d |
+ char *app_name; ///< e.g abrt-applet, org.gnome.desktop.privacy
|
|
Matej Habrnal |
30183d |
+ map_string_t *settings; ///< ABRT configuration file
|
|
Matej Habrnal |
30183d |
+ GSettings *glib_settings; ///< GSettings
|
|
Matej Habrnal |
30183d |
} AbrtAppConfiguration;
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
+/* This structure represents a single switch.
|
|
Matej Habrnal |
30183d |
+ */
|
|
Matej Habrnal |
30183d |
typedef struct {
|
|
Matej Habrnal |
30183d |
- const char *name;
|
|
Matej Habrnal |
30183d |
+ const char *name; ///< e.g. ask_steal_dir, report-technical-problems
|
|
Matej Habrnal |
30183d |
GtkSwitch *widget;
|
|
Matej Habrnal |
30183d |
gboolean default_value;
|
|
Matej Habrnal |
30183d |
gboolean current_value;
|
|
Matej Habrnal |
30183d |
AbrtAppConfiguration *config;
|
|
Matej Habrnal |
30183d |
} AbrtConfigWidgetOption;
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
+/* Each configuration option has its own number. */
|
|
Matej Habrnal |
30183d |
enum AbrtOptions
|
|
Matej Habrnal |
30183d |
{
|
|
Matej Habrnal |
30183d |
_ABRT_OPT_BEGIN_,
|
|
Matej Habrnal |
30183d |
@@ -60,11 +79,15 @@ enum AbrtOptions
|
|
Matej Habrnal |
30183d |
_ABRT_OPT_END_,
|
|
Matej Habrnal |
30183d |
};
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
+/* This structure holds private data of AbrtConfigWidget
|
|
Matej Habrnal |
30183d |
+ */
|
|
Matej Habrnal |
30183d |
struct AbrtConfigWidgetPrivate {
|
|
Matej Habrnal |
30183d |
GtkBuilder *builder;
|
|
Matej Habrnal |
30183d |
AbrtAppConfiguration *report_gtk_conf;
|
|
Matej Habrnal |
30183d |
AbrtAppConfiguration *abrt_applet_conf;
|
|
Matej Habrnal |
30183d |
+ AbrtAppConfiguration *privacy_gsettings;
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
+ /* Static array for all switches */
|
|
Matej Habrnal |
30183d |
AbrtConfigWidgetOption options[_ABRT_OPT_END_];
|
|
Matej Habrnal |
30183d |
};
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
@@ -79,6 +102,8 @@ static guint s_signals[SN_LAST_SIGNAL] = { 0 };
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
static void abrt_config_widget_finalize(GObject *object);
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
+/* New ABRT configuration file wrapper
|
|
Matej Habrnal |
30183d |
+ */
|
|
Matej Habrnal |
30183d |
static AbrtAppConfiguration *
|
|
Matej Habrnal |
30183d |
abrt_app_configuration_new(const char *app_name)
|
|
Matej Habrnal |
30183d |
{
|
|
Matej Habrnal |
30183d |
@@ -86,6 +111,7 @@ abrt_app_configuration_new(const char *app_name)
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
conf->app_name = xstrdup(app_name);
|
|
Matej Habrnal |
30183d |
conf->settings = new_map_string();
|
|
Matej Habrnal |
30183d |
+ conf->glib_settings = NULL;
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
if(!load_app_conf_file(conf->app_name, conf->settings)) {
|
|
Matej Habrnal |
30183d |
g_warning("Failed to load config for '%s'", conf->app_name);
|
|
Matej Habrnal |
30183d |
@@ -94,22 +120,50 @@ abrt_app_configuration_new(const char *app_name)
|
|
Matej Habrnal |
30183d |
return conf;
|
|
Matej Habrnal |
30183d |
}
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
+/* New GSettings wrapper
|
|
Matej Habrnal |
30183d |
+ */
|
|
Matej Habrnal |
30183d |
+static AbrtAppConfiguration *
|
|
Matej Habrnal |
30183d |
+abrt_app_configuration_new_glib(const char *schema)
|
|
Matej Habrnal |
30183d |
+{
|
|
Matej Habrnal |
30183d |
+ AbrtAppConfiguration *conf = xmalloc(sizeof(*conf));
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
+ conf->app_name = xstrdup(schema);
|
|
Matej Habrnal |
30183d |
+ conf->settings = NULL;
|
|
Matej Habrnal |
30183d |
+ conf->glib_settings = g_settings_new(conf->app_name);
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
+ return conf;
|
|
Matej Habrnal |
30183d |
+}
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
static void
|
|
Matej Habrnal |
30183d |
abrt_app_configuration_set_value(AbrtAppConfiguration *conf, const char *name, const char *value)
|
|
Matej Habrnal |
30183d |
{
|
|
Matej Habrnal |
30183d |
- set_app_user_setting(conf->settings, name, value);
|
|
Matej Habrnal |
30183d |
+ if (conf->settings)
|
|
Matej Habrnal |
30183d |
+ set_app_user_setting(conf->settings, name, value);
|
|
Matej Habrnal |
30183d |
+ else if (conf->glib_settings)
|
|
Matej Habrnal |
30183d |
+ g_settings_set_boolean(conf->glib_settings, name, string_to_bool(value));
|
|
Matej Habrnal |
30183d |
+ else
|
|
Matej Habrnal |
30183d |
+ assert(!"BUG: not properly initialized AbrtAppConfiguration");
|
|
Matej Habrnal |
30183d |
}
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
static const char *
|
|
Matej Habrnal |
30183d |
abrt_app_configuration_get_value(AbrtAppConfiguration *conf, const char *name)
|
|
Matej Habrnal |
30183d |
{
|
|
Matej Habrnal |
30183d |
- return get_app_user_setting(conf->settings, name);
|
|
Matej Habrnal |
30183d |
+ if (conf->settings)
|
|
Matej Habrnal |
30183d |
+ return get_app_user_setting(conf->settings, name);
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
+ if (conf->glib_settings)
|
|
Matej Habrnal |
30183d |
+ return g_settings_get_boolean(conf->glib_settings, name) ? "yes" : "no";
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
+ assert(!"BUG: not properly initialized AbrtAppConfiguration");
|
|
Matej Habrnal |
30183d |
}
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
static void
|
|
Matej Habrnal |
30183d |
abrt_app_configuration_save(AbrtAppConfiguration *conf)
|
|
Matej Habrnal |
30183d |
{
|
|
Matej Habrnal |
30183d |
- save_app_conf_file(conf->app_name, conf->settings);
|
|
Matej Habrnal |
30183d |
+ if (conf->settings)
|
|
Matej Habrnal |
30183d |
+ save_app_conf_file(conf->app_name, conf->settings);
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
+ /* No need to save GSettings because changes are applied instantly */
|
|
Matej Habrnal |
30183d |
}
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
static void
|
|
Matej Habrnal |
30183d |
@@ -121,8 +175,17 @@ abrt_app_configuration_free(AbrtAppConfiguration *conf)
|
|
Matej Habrnal |
30183d |
free(conf->app_name);
|
|
Matej Habrnal |
30183d |
conf->app_name = (void *)0xDEADBEAF;
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
- free_map_string(conf->settings);
|
|
Matej Habrnal |
30183d |
- conf->settings = (void *)0xDEADBEAF;
|
|
Matej Habrnal |
30183d |
+ if (conf->settings)
|
|
Matej Habrnal |
30183d |
+ {
|
|
Matej Habrnal |
30183d |
+ free_map_string(conf->settings);
|
|
Matej Habrnal |
30183d |
+ conf->settings = (void *)0xDEADBEAF;
|
|
Matej Habrnal |
30183d |
+ }
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
+ if (conf->glib_settings)
|
|
Matej Habrnal |
30183d |
+ {
|
|
Matej Habrnal |
30183d |
+ g_object_unref(conf->glib_settings);
|
|
Matej Habrnal |
30183d |
+ conf->glib_settings = (void *)0xDEADBEAF;
|
|
Matej Habrnal |
30183d |
+ }
|
|
Matej Habrnal |
30183d |
}
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
static void
|
|
Matej Habrnal |
30183d |
@@ -161,6 +224,9 @@ abrt_config_widget_finalize(GObject *object)
|
|
Matej Habrnal |
30183d |
abrt_app_configuration_free(self->priv->abrt_applet_conf);
|
|
Matej Habrnal |
30183d |
self->priv->abrt_applet_conf = NULL;
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
+ abrt_app_configuration_free(self->priv->privacy_gsettings);
|
|
Matej Habrnal |
30183d |
+ self->priv->privacy_gsettings = NULL;
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
G_OBJECT_CLASS(abrt_config_widget_parent_class)->finalize(object);
|
|
Matej Habrnal |
30183d |
}
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
@@ -217,8 +283,31 @@ connect_switch_with_option(AbrtConfigWidget *self, enum AbrtOptions opid, const
|
|
Matej Habrnal |
30183d |
g_signal_connect(G_OBJECT(gsw), "notify::active",
|
|
Matej Habrnal |
30183d |
G_CALLBACK(on_switch_activate), self);
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
- if (option->config == NULL)
|
|
Matej Habrnal |
30183d |
- gtk_widget_set_sensitive(GTK_WIDGET(gsw), FALSE);
|
|
Matej Habrnal |
30183d |
+ /* If the option has no config, make the corresponding insensitive. */
|
|
Matej Habrnal |
30183d |
+ gtk_widget_set_sensitive(GTK_WIDGET(gsw), option->config != NULL);
|
|
Matej Habrnal |
30183d |
+}
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
+static void
|
|
Matej Habrnal |
30183d |
+pp_launcher_clicked(GtkButton *launcher, gpointer *unused_data)
|
|
Matej Habrnal |
30183d |
+{
|
|
Matej Habrnal |
30183d |
+ GDesktopAppInfo *app = g_object_get_data(G_OBJECT(launcher), "launched-app");
|
|
Matej Habrnal |
30183d |
+ GError *err = NULL;
|
|
Matej Habrnal |
30183d |
+ if (!g_app_info_launch(G_APP_INFO(app), NULL, NULL, &err))
|
|
Matej Habrnal |
30183d |
+ {
|
|
Matej Habrnal |
30183d |
+ perror_msg("Could not launch '%s': %s",
|
|
Matej Habrnal |
30183d |
+ g_desktop_app_info_get_filename(G_DESKTOP_APP_INFO (app)),
|
|
Matej Habrnal |
30183d |
+ err->message);
|
|
Matej Habrnal |
30183d |
+ }
|
|
Matej Habrnal |
30183d |
+}
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
+static void
|
|
Matej Habrnal |
30183d |
+os_release_callback(char *key, char *value, void *data)
|
|
Matej Habrnal |
30183d |
+{
|
|
Matej Habrnal |
30183d |
+ if (strcmp(key, "PRIVACY_POLICY") == 0)
|
|
Matej Habrnal |
30183d |
+ *(char **)data = value;
|
|
Matej Habrnal |
30183d |
+ else
|
|
Matej Habrnal |
30183d |
+ free(value);
|
|
Matej Habrnal |
30183d |
+ free(key);
|
|
Matej Habrnal |
30183d |
}
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
static void
|
|
Matej Habrnal |
30183d |
@@ -249,6 +338,7 @@ abrt_config_widget_init(AbrtConfigWidget *self)
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
self->priv->report_gtk_conf = abrt_app_configuration_new("report-gtk");
|
|
Matej Habrnal |
30183d |
self->priv->abrt_applet_conf = abrt_app_configuration_new("abrt-applet");
|
|
Matej Habrnal |
30183d |
+ self->priv->privacy_gsettings = abrt_app_configuration_new_glib("org.gnome.desktop.privacy");
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
/* Initialize options */
|
|
Matej Habrnal |
30183d |
/* report-gtk */
|
|
Matej Habrnal |
30183d |
@@ -259,15 +349,98 @@ abrt_config_widget_init(AbrtConfigWidget *self)
|
|
Matej Habrnal |
30183d |
self->priv->options[ABRT_OPT_UPLOAD_COREDUMP].name = "abrt_analyze_smart_ask_upload_coredump";
|
|
Matej Habrnal |
30183d |
self->priv->options[ABRT_OPT_UPLOAD_COREDUMP].default_value = TRUE;
|
|
Matej Habrnal |
30183d |
self->priv->options[ABRT_OPT_UPLOAD_COREDUMP].config = self->priv->report_gtk_conf;
|
|
Matej Habrnal |
30183d |
-
|
|
Matej Habrnal |
30183d |
self->priv->options[ABRT_OPT_PRIVATE_TICKET].name = CREATE_PRIVATE_TICKET;
|
|
Matej Habrnal |
30183d |
self->priv->options[ABRT_OPT_PRIVATE_TICKET].default_value = FALSE;
|
|
Matej Habrnal |
30183d |
self->priv->options[ABRT_OPT_PRIVATE_TICKET].config = self->priv->report_gtk_conf;
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
/* abrt-applet */
|
|
Matej Habrnal |
30183d |
- self->priv->options[ABRT_OPT_SEND_UREPORT].name = "AutoreportingEnabled";
|
|
Matej Habrnal |
30183d |
- self->priv->options[ABRT_OPT_SEND_UREPORT].default_value = g_settings_autoreporting;
|
|
Matej Habrnal |
30183d |
- self->priv->options[ABRT_OPT_SEND_UREPORT].config = self->priv->abrt_applet_conf;
|
|
Matej Habrnal |
30183d |
+ self->priv->options[ABRT_OPT_SEND_UREPORT].name = "report-technical-problems";
|
|
Matej Habrnal |
30183d |
+ self->priv->options[ABRT_OPT_SEND_UREPORT].default_value =
|
|
Matej Habrnal |
30183d |
+ string_to_bool(abrt_app_configuration_get_value(self->priv->privacy_gsettings,
|
|
Matej Habrnal |
30183d |
+ "report-technical-problems"));
|
|
Matej Habrnal |
30183d |
+ {
|
|
Matej Habrnal |
30183d |
+ /* Get the container widget for the lauch button and warnings */
|
|
Matej Habrnal |
30183d |
+ GtkWidget *hbox_auto_reporting = WID("hbox_auto_reporting");
|
|
Matej Habrnal |
30183d |
+ assert(hbox_auto_reporting);
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
+ /* Be able to use another desktop file while debugging */
|
|
Matej Habrnal |
30183d |
+ const char *gpp_app = getenv("ABRT_PRIVACY_APP_DESKTOP");
|
|
Matej Habrnal |
30183d |
+ if (gpp_app == NULL)
|
|
Matej Habrnal |
30183d |
+ gpp_app = "gnome-privacy-panel.desktop";
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
+ GDesktopAppInfo *app = g_desktop_app_info_new(gpp_app);
|
|
Matej Habrnal |
30183d |
+ char *message = NULL;
|
|
Matej Habrnal |
30183d |
+ char *markup = NULL;
|
|
Matej Habrnal |
30183d |
+ if (!app)
|
|
Matej Habrnal |
30183d |
+ {
|
|
Matej Habrnal |
30183d |
+ /* Make the switch editable */
|
|
Matej Habrnal |
30183d |
+ self->priv->options[ABRT_OPT_SEND_UREPORT].config = self->priv->privacy_gsettings;
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
+ char *os_release = xmalloc_open_read_close("/etc/os-release", /*no size limit*/NULL);
|
|
Matej Habrnal |
30183d |
+ char *privacy_policy = NULL;
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
+ /* Try to get the value of PRIVACY_POLICY from /etc/os-release */
|
|
Matej Habrnal |
30183d |
+ sr_parse_os_release(os_release, os_release_callback, (void *)&privacy_policy);
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
+ message = xasprintf(_("The configuration option above has been moved to GSettings and "
|
|
Matej Habrnal |
30183d |
+ "the switch is linked to the value of the setting 'report-technical-problems' "
|
|
Matej Habrnal |
30183d |
+ "from the schema 'org.gnome.desktop.privacy'."));
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
+ /* Do not add Privacy Policy link if /etc/os-release does not contain PRIVACY_POLICY */
|
|
Matej Habrnal |
30183d |
+ if (privacy_policy != NULL)
|
|
Matej Habrnal |
30183d |
+ markup = xasprintf("%s\n\nPrivacy Policy", message, privacy_policy);
|
|
Matej Habrnal |
30183d |
+ else
|
|
Matej Habrnal |
30183d |
+ markup = xasprintf("%s", message);
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
+ free(privacy_policy);
|
|
Matej Habrnal |
30183d |
+ free(os_release);
|
|
Matej Habrnal |
30183d |
+ }
|
|
Matej Habrnal |
30183d |
+ else
|
|
Matej Habrnal |
30183d |
+ {
|
|
Matej Habrnal |
30183d |
+ /* Make the switch read-only */
|
|
Matej Habrnal |
30183d |
+ self->priv->options[ABRT_OPT_SEND_UREPORT].config = NULL;
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
+ message = xasprintf(_("The configuration option above can be configured in"));
|
|
Matej Habrnal |
30183d |
+ markup = xasprintf("%s", message);
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
+ GtkWidget *launcher = gtk_button_new_with_label(g_app_info_get_display_name(G_APP_INFO(app)));
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
+ /* Here we could pass the launcher to pp_launcher_clicked() as the
|
|
Matej Habrnal |
30183d |
+ * 4th argument of g_signal_connect() but we would leek the
|
|
Matej Habrnal |
30183d |
+ * launcher's memory. Therefore we need to find a way how to free
|
|
Matej Habrnal |
30183d |
+ * the launcher when it is not needed anymore. GtkWidget inherits
|
|
Matej Habrnal |
30183d |
+ * from GObject which offers a functionality for attaching an
|
|
Matej Habrnal |
30183d |
+ * arbitrary data to its instances. The last argument is a function
|
|
Matej Habrnal |
30183d |
+ * called to destroy the arbirarty data when the instance is being
|
|
Matej Habrnal |
30183d |
+ * destoryed. */
|
|
Matej Habrnal |
30183d |
+ g_object_set_data_full(G_OBJECT(launcher), "launched-app", app, g_object_unref);
|
|
Matej Habrnal |
30183d |
+ g_signal_connect(launcher, "clicked", G_CALLBACK(pp_launcher_clicked), NULL);
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
+ /* Make the launcher button narrow, otherwise it would expand to
|
|
Matej Habrnal |
30183d |
+ * the width of the warninig. */
|
|
Matej Habrnal |
30183d |
+ gtk_widget_set_hexpand(launcher, FALSE);
|
|
Matej Habrnal |
30183d |
+ gtk_widget_set_vexpand(launcher, FALSE);
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
+ /* Make the launcher button alligned on center of the warning. */
|
|
Matej Habrnal |
30183d |
+ gtk_widget_set_halign(launcher, GTK_ALIGN_CENTER);
|
|
Matej Habrnal |
30183d |
+ gtk_widget_set_valign(launcher, GTK_ALIGN_CENTER);
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
+ gtk_box_pack_end(GTK_BOX(hbox_auto_reporting), launcher, false, false, 0);
|
|
Matej Habrnal |
30183d |
+ }
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
+ GtkWidget *lbl = gtk_label_new(message);
|
|
Matej Habrnal |
30183d |
+ gtk_label_set_markup(GTK_LABEL(lbl), markup);
|
|
Matej Habrnal |
30183d |
+ /* Do not expand the window by too long warning. */
|
|
Matej Habrnal |
30183d |
+ gtk_label_set_line_wrap(GTK_LABEL(lbl), TRUE);
|
|
Matej Habrnal |
30183d |
+ /* Let users to copy the warning. */
|
|
Matej Habrnal |
30183d |
+ gtk_label_set_selectable(GTK_LABEL(lbl), TRUE);
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
+ free(markup);
|
|
Matej Habrnal |
30183d |
+ free(message);
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
+ gtk_box_pack_start(GTK_BOX(hbox_auto_reporting), lbl, false, false, 0);
|
|
Matej Habrnal |
30183d |
+ }
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
self->priv->options[ABRT_OPT_SHORTENED_REPORTING].name = "ShortenedReporting";
|
|
Matej Habrnal |
30183d |
self->priv->options[ABRT_OPT_SHORTENED_REPORTING].default_value = g_settings_shortenedreporting;
|
|
Matej Habrnal |
30183d |
diff --git a/src/configuration-gui/abrt-config-widget.glade b/src/configuration-gui/abrt-config-widget.glade
|
|
Matej Habrnal |
30183d |
index 3aa566c..7f613c7 100644
|
|
Matej Habrnal |
30183d |
--- a/src/configuration-gui/abrt-config-widget.glade
|
|
Matej Habrnal |
30183d |
+++ b/src/configuration-gui/abrt-config-widget.glade
|
|
Matej Habrnal |
30183d |
@@ -1,6 +1,7 @@
|
|
Matej Habrnal |
30183d |
|
|
Matej Habrnal |
30183d |
+
|
|
Matej Habrnal |
30183d |
<interface>
|
|
Matej Habrnal |
30183d |
-
|
|
Matej Habrnal |
30183d |
+ <requires lib="gtk+" version="3.0"/>
|
|
Matej Habrnal |
30183d |
<object class="GtkWindow" id="window1">
|
|
Matej Habrnal |
30183d |
<property name="can_focus">False</property>
|
|
Matej Habrnal |
30183d |
<child>
|
|
Matej Habrnal |
30183d |
@@ -11,7 +12,6 @@
|
|
Matej Habrnal |
30183d |
<property name="margin_right">10</property>
|
|
Matej Habrnal |
30183d |
<property name="margin_top">10</property>
|
|
Matej Habrnal |
30183d |
<property name="margin_bottom">10</property>
|
|
Matej Habrnal |
30183d |
- <property name="row_homogeneous">True</property>
|
|
Matej Habrnal |
30183d |
<child>
|
|
Matej Habrnal |
30183d |
<object class="GtkLabel" id="label2">
|
|
Matej Habrnal |
30183d |
<property name="visible">True</property>
|
|
Matej Habrnal |
30183d |
@@ -26,8 +26,6 @@
|
|
Matej Habrnal |
30183d |
<packing>
|
|
Matej Habrnal |
30183d |
<property name="left_attach">0</property>
|
|
Matej Habrnal |
30183d |
<property name="top_attach">1</property>
|
|
Matej Habrnal |
30183d |
- <property name="width">1</property>
|
|
Matej Habrnal |
30183d |
- <property name="height">1</property>
|
|
Matej Habrnal |
30183d |
</packing>
|
|
Matej Habrnal |
30183d |
</child>
|
|
Matej Habrnal |
30183d |
<child>
|
|
Matej Habrnal |
30183d |
@@ -44,8 +42,6 @@
|
|
Matej Habrnal |
30183d |
<packing>
|
|
Matej Habrnal |
30183d |
<property name="left_attach">0</property>
|
|
Matej Habrnal |
30183d |
<property name="top_attach">3</property>
|
|
Matej Habrnal |
30183d |
- <property name="width">1</property>
|
|
Matej Habrnal |
30183d |
- <property name="height">1</property>
|
|
Matej Habrnal |
30183d |
</packing>
|
|
Matej Habrnal |
30183d |
</child>
|
|
Matej Habrnal |
30183d |
<child>
|
|
Matej Habrnal |
30183d |
@@ -59,8 +55,6 @@
|
|
Matej Habrnal |
30183d |
<packing>
|
|
Matej Habrnal |
30183d |
<property name="left_attach">1</property>
|
|
Matej Habrnal |
30183d |
<property name="top_attach">0</property>
|
|
Matej Habrnal |
30183d |
- <property name="width">1</property>
|
|
Matej Habrnal |
30183d |
- <property name="height">1</property>
|
|
Matej Habrnal |
30183d |
</packing>
|
|
Matej Habrnal |
30183d |
</child>
|
|
Matej Habrnal |
30183d |
<child>
|
|
Matej Habrnal |
30183d |
@@ -74,13 +68,12 @@
|
|
Matej Habrnal |
30183d |
<packing>
|
|
Matej Habrnal |
30183d |
<property name="left_attach">1</property>
|
|
Matej Habrnal |
30183d |
<property name="top_attach">1</property>
|
|
Matej Habrnal |
30183d |
- <property name="width">1</property>
|
|
Matej Habrnal |
30183d |
- <property name="height">1</property>
|
|
Matej Habrnal |
30183d |
</packing>
|
|
Matej Habrnal |
30183d |
</child>
|
|
Matej Habrnal |
30183d |
<child>
|
|
Matej Habrnal |
30183d |
<object class="GtkSwitch" id="switch_send_ureport">
|
|
Matej Habrnal |
30183d |
<property name="visible">True</property>
|
|
Matej Habrnal |
30183d |
+ <property name="sensitive">False</property>
|
|
Matej Habrnal |
30183d |
<property name="can_focus">True</property>
|
|
Matej Habrnal |
30183d |
<property name="halign">end</property>
|
|
Matej Habrnal |
30183d |
<property name="valign">center</property>
|
|
Matej Habrnal |
30183d |
@@ -89,8 +82,6 @@
|
|
Matej Habrnal |
30183d |
<packing>
|
|
Matej Habrnal |
30183d |
<property name="left_attach">1</property>
|
|
Matej Habrnal |
30183d |
<property name="top_attach">3</property>
|
|
Matej Habrnal |
30183d |
- <property name="width">1</property>
|
|
Matej Habrnal |
30183d |
- <property name="height">1</property>
|
|
Matej Habrnal |
30183d |
</packing>
|
|
Matej Habrnal |
30183d |
</child>
|
|
Matej Habrnal |
30183d |
<child>
|
|
Matej Habrnal |
30183d |
@@ -106,9 +97,7 @@
|
|
Matej Habrnal |
30183d |
</object>
|
|
Matej Habrnal |
30183d |
<packing>
|
|
Matej Habrnal |
30183d |
<property name="left_attach">0</property>
|
|
Matej Habrnal |
30183d |
- <property name="top_attach">4</property>
|
|
Matej Habrnal |
30183d |
- <property name="width">1</property>
|
|
Matej Habrnal |
30183d |
- <property name="height">1</property>
|
|
Matej Habrnal |
30183d |
+ <property name="top_attach">5</property>
|
|
Matej Habrnal |
30183d |
</packing>
|
|
Matej Habrnal |
30183d |
</child>
|
|
Matej Habrnal |
30183d |
<child>
|
|
Matej Habrnal |
30183d |
@@ -121,9 +110,7 @@
|
|
Matej Habrnal |
30183d |
</object>
|
|
Matej Habrnal |
30183d |
<packing>
|
|
Matej Habrnal |
30183d |
<property name="left_attach">1</property>
|
|
Matej Habrnal |
30183d |
- <property name="top_attach">4</property>
|
|
Matej Habrnal |
30183d |
- <property name="width">1</property>
|
|
Matej Habrnal |
30183d |
- <property name="height">1</property>
|
|
Matej Habrnal |
30183d |
+ <property name="top_attach">5</property>
|
|
Matej Habrnal |
30183d |
</packing>
|
|
Matej Habrnal |
30183d |
</child>
|
|
Matej Habrnal |
30183d |
<child>
|
|
Matej Habrnal |
30183d |
@@ -136,9 +123,7 @@
|
|
Matej Habrnal |
30183d |
</object>
|
|
Matej Habrnal |
30183d |
<packing>
|
|
Matej Habrnal |
30183d |
<property name="left_attach">1</property>
|
|
Matej Habrnal |
30183d |
- <property name="top_attach">5</property>
|
|
Matej Habrnal |
30183d |
- <property name="width">1</property>
|
|
Matej Habrnal |
30183d |
- <property name="height">1</property>
|
|
Matej Habrnal |
30183d |
+ <property name="top_attach">6</property>
|
|
Matej Habrnal |
30183d |
</packing>
|
|
Matej Habrnal |
30183d |
</child>
|
|
Matej Habrnal |
30183d |
<child>
|
|
Matej Habrnal |
30183d |
@@ -154,9 +139,7 @@
|
|
Matej Habrnal |
30183d |
</object>
|
|
Matej Habrnal |
30183d |
<packing>
|
|
Matej Habrnal |
30183d |
<property name="left_attach">0</property>
|
|
Matej Habrnal |
30183d |
- <property name="top_attach">5</property>
|
|
Matej Habrnal |
30183d |
- <property name="width">1</property>
|
|
Matej Habrnal |
30183d |
- <property name="height">1</property>
|
|
Matej Habrnal |
30183d |
+ <property name="top_attach">6</property>
|
|
Matej Habrnal |
30183d |
</packing>
|
|
Matej Habrnal |
30183d |
</child>
|
|
Matej Habrnal |
30183d |
<child>
|
|
Matej Habrnal |
30183d |
@@ -172,8 +155,6 @@
|
|
Matej Habrnal |
30183d |
<packing>
|
|
Matej Habrnal |
30183d |
<property name="left_attach">2</property>
|
|
Matej Habrnal |
30183d |
<property name="top_attach">0</property>
|
|
Matej Habrnal |
30183d |
- <property name="width">1</property>
|
|
Matej Habrnal |
30183d |
- <property name="height">1</property>
|
|
Matej Habrnal |
30183d |
</packing>
|
|
Matej Habrnal |
30183d |
</child>
|
|
Matej Habrnal |
30183d |
<child>
|
|
Matej Habrnal |
30183d |
@@ -188,8 +169,6 @@
|
|
Matej Habrnal |
30183d |
<packing>
|
|
Matej Habrnal |
30183d |
<property name="left_attach">2</property>
|
|
Matej Habrnal |
30183d |
<property name="top_attach">1</property>
|
|
Matej Habrnal |
30183d |
- <property name="width">1</property>
|
|
Matej Habrnal |
30183d |
- <property name="height">1</property>
|
|
Matej Habrnal |
30183d |
</packing>
|
|
Matej Habrnal |
30183d |
</child>
|
|
Matej Habrnal |
30183d |
<child>
|
|
Matej Habrnal |
30183d |
@@ -204,8 +183,6 @@
|
|
Matej Habrnal |
30183d |
<packing>
|
|
Matej Habrnal |
30183d |
<property name="left_attach">2</property>
|
|
Matej Habrnal |
30183d |
<property name="top_attach">3</property>
|
|
Matej Habrnal |
30183d |
- <property name="width">1</property>
|
|
Matej Habrnal |
30183d |
- <property name="height">1</property>
|
|
Matej Habrnal |
30183d |
</packing>
|
|
Matej Habrnal |
30183d |
</child>
|
|
Matej Habrnal |
30183d |
<child>
|
|
Matej Habrnal |
30183d |
@@ -219,9 +196,7 @@
|
|
Matej Habrnal |
30183d |
</object>
|
|
Matej Habrnal |
30183d |
<packing>
|
|
Matej Habrnal |
30183d |
<property name="left_attach">2</property>
|
|
Matej Habrnal |
30183d |
- <property name="top_attach">4</property>
|
|
Matej Habrnal |
30183d |
- <property name="width">1</property>
|
|
Matej Habrnal |
30183d |
- <property name="height">1</property>
|
|
Matej Habrnal |
30183d |
+ <property name="top_attach">5</property>
|
|
Matej Habrnal |
30183d |
</packing>
|
|
Matej Habrnal |
30183d |
</child>
|
|
Matej Habrnal |
30183d |
<child>
|
|
Matej Habrnal |
30183d |
@@ -235,9 +210,7 @@
|
|
Matej Habrnal |
30183d |
</object>
|
|
Matej Habrnal |
30183d |
<packing>
|
|
Matej Habrnal |
30183d |
<property name="left_attach">2</property>
|
|
Matej Habrnal |
30183d |
- <property name="top_attach">5</property>
|
|
Matej Habrnal |
30183d |
- <property name="width">1</property>
|
|
Matej Habrnal |
30183d |
- <property name="height">1</property>
|
|
Matej Habrnal |
30183d |
+ <property name="top_attach">6</property>
|
|
Matej Habrnal |
30183d |
</packing>
|
|
Matej Habrnal |
30183d |
</child>
|
|
Matej Habrnal |
30183d |
<child>
|
|
Matej Habrnal |
30183d |
@@ -254,8 +227,6 @@
|
|
Matej Habrnal |
30183d |
<packing>
|
|
Matej Habrnal |
30183d |
<property name="left_attach">0</property>
|
|
Matej Habrnal |
30183d |
<property name="top_attach">0</property>
|
|
Matej Habrnal |
30183d |
- <property name="width">1</property>
|
|
Matej Habrnal |
30183d |
- <property name="height">1</property>
|
|
Matej Habrnal |
30183d |
</packing>
|
|
Matej Habrnal |
30183d |
</child>
|
|
Matej Habrnal |
30183d |
<child>
|
|
Matej Habrnal |
30183d |
@@ -270,8 +241,6 @@
|
|
Matej Habrnal |
30183d |
<packing>
|
|
Matej Habrnal |
30183d |
<property name="left_attach">2</property>
|
|
Matej Habrnal |
30183d |
<property name="top_attach">2</property>
|
|
Matej Habrnal |
30183d |
- <property name="width">1</property>
|
|
Matej Habrnal |
30183d |
- <property name="height">1</property>
|
|
Matej Habrnal |
30183d |
</packing>
|
|
Matej Habrnal |
30183d |
</child>
|
|
Matej Habrnal |
30183d |
<child>
|
|
Matej Habrnal |
30183d |
@@ -286,8 +255,6 @@
|
|
Matej Habrnal |
30183d |
<packing>
|
|
Matej Habrnal |
30183d |
<property name="left_attach">0</property>
|
|
Matej Habrnal |
30183d |
<property name="top_attach">2</property>
|
|
Matej Habrnal |
30183d |
- <property name="width">1</property>
|
|
Matej Habrnal |
30183d |
- <property name="height">1</property>
|
|
Matej Habrnal |
30183d |
</packing>
|
|
Matej Habrnal |
30183d |
</child>
|
|
Matej Habrnal |
30183d |
<child>
|
|
Matej Habrnal |
30183d |
@@ -301,8 +268,6 @@
|
|
Matej Habrnal |
30183d |
<packing>
|
|
Matej Habrnal |
30183d |
<property name="left_attach">1</property>
|
|
Matej Habrnal |
30183d |
<property name="top_attach">2</property>
|
|
Matej Habrnal |
30183d |
- <property name="width">1</property>
|
|
Matej Habrnal |
30183d |
- <property name="height">1</property>
|
|
Matej Habrnal |
30183d |
</packing>
|
|
Matej Habrnal |
30183d |
</child>
|
|
Matej Habrnal |
30183d |
<child>
|
|
Matej Habrnal |
30183d |
@@ -316,9 +281,7 @@
|
|
Matej Habrnal |
30183d |
</object>
|
|
Matej Habrnal |
30183d |
<packing>
|
|
Matej Habrnal |
30183d |
<property name="left_attach">0</property>
|
|
Matej Habrnal |
30183d |
- <property name="top_attach">6</property>
|
|
Matej Habrnal |
30183d |
- <property name="width">1</property>
|
|
Matej Habrnal |
30183d |
- <property name="height">1</property>
|
|
Matej Habrnal |
30183d |
+ <property name="top_attach">7</property>
|
|
Matej Habrnal |
30183d |
</packing>
|
|
Matej Habrnal |
30183d |
</child>
|
|
Matej Habrnal |
30183d |
<child>
|
|
Matej Habrnal |
30183d |
@@ -331,9 +294,7 @@
|
|
Matej Habrnal |
30183d |
</object>
|
|
Matej Habrnal |
30183d |
<packing>
|
|
Matej Habrnal |
30183d |
<property name="left_attach">1</property>
|
|
Matej Habrnal |
30183d |
- <property name="top_attach">6</property>
|
|
Matej Habrnal |
30183d |
- <property name="width">1</property>
|
|
Matej Habrnal |
30183d |
- <property name="height">1</property>
|
|
Matej Habrnal |
30183d |
+ <property name="top_attach">7</property>
|
|
Matej Habrnal |
30183d |
</packing>
|
|
Matej Habrnal |
30183d |
</child>
|
|
Matej Habrnal |
30183d |
<child>
|
|
Matej Habrnal |
30183d |
@@ -347,11 +308,26 @@
|
|
Matej Habrnal |
30183d |
</object>
|
|
Matej Habrnal |
30183d |
<packing>
|
|
Matej Habrnal |
30183d |
<property name="left_attach">2</property>
|
|
Matej Habrnal |
30183d |
- <property name="top_attach">6</property>
|
|
Matej Habrnal |
30183d |
- <property name="width">1</property>
|
|
Matej Habrnal |
30183d |
- <property name="height">1</property>
|
|
Matej Habrnal |
30183d |
+ <property name="top_attach">7</property>
|
|
Matej Habrnal |
30183d |
</packing>
|
|
Matej Habrnal |
30183d |
</child>
|
|
Matej Habrnal |
30183d |
+ <child>
|
|
Matej Habrnal |
30183d |
+ <object class="GtkBox" id="hbox_auto_reporting">
|
|
Matej Habrnal |
30183d |
+ <property name="visible">True</property>
|
|
Matej Habrnal |
30183d |
+ <property name="can_focus">False</property>
|
|
Matej Habrnal |
30183d |
+ <child>
|
|
Matej Habrnal |
30183d |
+ <placeholder/>
|
|
Matej Habrnal |
30183d |
+ </child>
|
|
Matej Habrnal |
30183d |
+ </object>
|
|
Matej Habrnal |
30183d |
+ <packing>
|
|
Matej Habrnal |
30183d |
+ <property name="left_attach">0</property>
|
|
Matej Habrnal |
30183d |
+ <property name="top_attach">4</property>
|
|
Matej Habrnal |
30183d |
+ <property name="width">2</property>
|
|
Matej Habrnal |
30183d |
+ </packing>
|
|
Matej Habrnal |
30183d |
+ </child>
|
|
Matej Habrnal |
30183d |
+ <child>
|
|
Matej Habrnal |
30183d |
+ <placeholder/>
|
|
Matej Habrnal |
30183d |
+ </child>
|
|
Matej Habrnal |
30183d |
</object>
|
|
Matej Habrnal |
30183d |
</child>
|
|
Matej Habrnal |
30183d |
</object>
|
|
Matej Habrnal |
30183d |
--
|
|
Matej Habrnal |
30183d |
2.4.1
|
|
Matej Habrnal |
30183d |
|