[ABRT PATCH] replace 'Start Autoreport' btn by a popup dialog
by Jakub Filak
- closes trac#916
Signed-off-by: Jakub Filak <jfilak(a)redhat.com>
---
src/applet/applet.c | 68 ++++++++++++++++++++++++++++++-----------------------
1 file changed, 39 insertions(+), 29 deletions(-)
diff --git a/src/applet/applet.c b/src/applet/applet.c
index 116129f..7586d11 100644
--- a/src/applet/applet.c
+++ b/src/applet/applet.c
@@ -42,7 +42,6 @@
/* libnotify action keys */
#define A_KNOWN_OPEN_GUI "OPEN"
#define A_KNOWN_OPEN_BROWSER "SHOW"
-#define A_REPORT_START_AUTOREPORT "START_AUTOREPORT"
#define A_REPORT_REPORT "REPORT"
#define A_REPORT_AUTOREPORT "AUTOREPORT"
@@ -79,18 +78,35 @@ static bool is_autoreporting_enabled(void)
|| ( option && string_to_bool(option));
}
-static void enable_autoreporting(void)
-{
- set_user_setting("AutoreportingEnabled", "yes");
- save_user_settings();
-}
-
static const char *get_autoreport_event_name(void)
{
const char *configured = get_user_setting("AutoreportingEvent");
return configured ? configured : g_settings_autoreporting_event;
}
+static void ask_start_autoreporting()
+{
+ /* The "Yes" response will be saved even if user don't check the
+ * "Don't ask me again" box.
+ */
+ const int ret = run_ask_yes_no_save_result_dialog("AutoreportingEnabled",
+ _("The report which will be sent does not contain any security sensitive data. "
+ "Therefore it is not necessary to bother you next time and require any further action by you. "
+ "\nDo you want to enable automatically submitted anonymous crash reports?"),
+ /*parent wnd */ NULL);
+
+ /* Don't forget:
+ *
+ * The "Yes" response will be saved even if user don't check the
+ * "Don't ask me again" box.
+ */
+ if (ret != 0)
+ set_user_setting("AutoreportingEnabled", "yes");
+
+ /* must be called immediately, otherwise the data could be lost in case of crash */
+ save_user_settings();
+}
+
/*
* Converts a NM state value stored in GVariant to boolean.
*
@@ -486,30 +502,32 @@ static void run_report_from_applet(const char *dirname)
static void action_report(NotifyNotification *notification, gchar *action, gpointer user_data)
{
VERB3 log("Reporting a problem!");
- problem_info_t *pi = (problem_info_t *)user_data;
+ /* must be closed before ask_yes_no dialog run */
+ GError *err = NULL;
+ notify_notification_close(notification, &err);
+ if (err != NULL)
+ {
+ error_msg(_("Can't close notification: %s"), err->message);
+ g_error_free(err);
+ }
+
+ hide_icon();
+ problem_info_t *pi = (problem_info_t *)user_data;
if (pi->problem_dir)
{
- if (strcmp(A_REPORT_START_AUTOREPORT, action) == 0)
- enable_autoreporting();
-
if (strcmp(A_REPORT_REPORT, action) == 0)
{
run_report_from_applet(pi->problem_dir);
problem_info_free(pi);
}
- else /* start autoreporting and autoreporting itself */
- run_event_async(pi, get_autoreport_event_name(), REPORT_UNKNOWN_PROBLEM_IMMEDIATELY);
-
- GError *err = NULL;
- notify_notification_close(notification, &err);
- if (err != NULL)
+ else
{
- error_msg(_("Can't close notification: %s"), err->message);
- g_error_free(err);
- }
+ if (pi->foreign == false && strcmp(A_REPORT_AUTOREPORT, action) == 0)
+ ask_start_autoreporting();
- hide_icon();
+ run_event_async(pi, get_autoreport_event_name(), REPORT_UNKNOWN_PROBLEM_IMMEDIATELY);
+ }
/* Scan dirs and save new $XDG_CACHE_HOME/abrt/applet_dirlist.
* (Oterwise, after a crash, next time applet is started,
@@ -800,14 +818,6 @@ static void notify_problem_list(GList *problems, int flags)
NOTIFY_ACTION_CALLBACK(action_report),
pi, NULL);
- /* Doesn't make sense to allow autoreporting for foreign problems */
- if (!pi->foreign)
- {
- notify_notification_add_action(notification, A_REPORT_START_AUTOREPORT, _("Start Autoreporting"),
- NOTIFY_ACTION_CALLBACK(action_report),
- pi, NULL);
- }
-
notify_notification_update(notification, _("A Problem has Occurred"), pi->message, NULL);
}
else
--
1.7.11.7
11 years, 6 months
[Automatic Bug Reporting Tool - ABRT] #920: collect kernel memory leaks
by fedora-badges
#920: collect kernel memory leaks
----------------------+------------------------------
Reporter: npajkovs | Owner: crash-catcher@…
Type: defect | Status: new
Priority: major | Milestone:
Component: abrt | Version:
Keywords: | Blocked By:
Blocking: |
----------------------+------------------------------
Kmemleak provides a way of detecting possible kernel memory leaks in a
way similar to a tracing garbage collector with the difference that
the orphan objects are not freed but only reported via
/sys/kernel/debug/kmemleak.
doc http://www.mjmwired.net/kernel/Documentation/kmemleak.txt
{{{
unreferenced object 0xffff880211e2aec0 (size 544):
comm "X", pid 1377, jiffies 4294790842 (age 147359.137s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 73 fe 11 02 88 ff ff .........s......
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<ffffffff81189293>] create_object+0x123/0x2f0
[<ffffffff818b51d1>] kmemleak_alloc+0x21/0x50
[<ffffffff8117e4e3>] kmem_cache_alloc+0xd3/0x110
[<ffffffff813b9217>] idr_pre_get+0x67/0x90
[<ffffffff814ad93d>] drm_gem_handle_create+0x3d/0x100
[<ffffffff814dcd7b>] i915_gem_create+0x6b/0xd0
[<ffffffff814dcdf9>] i915_gem_create_ioctl+0x19/0x20
[<ffffffff814aba20>] drm_ioctl+0x2d0/0x520
[<ffffffff8119eb7a>] do_vfs_ioctl+0x8a/0x2f0
[<ffffffff8119ee71>] sys_ioctl+0x91/0xa0
[<ffffffff818d8cd8>] tracesys+0xe1/0xe6
[<ffffffffffffffff>] 0xffffffffffffffff
}}}
I'm suggesting to add new option --kmemleak to abrt-dump-oops, which will
enable catching kmemleak.
--
Ticket URL: <https://fedorahosted.org/abrt/ticket/920>
Automatic Bug Reporting Tool - ABRT <http://fedorahoted.org/abrt/>
Automatic bug reporting tool
11 years, 6 months