40
40
return exitcode == 0;
44
ask_invoke_apport_with_gksu()
47
gchar *msg = _("System program problem detected");
48
gchar *descr = _("Do you want to reporting the problem "
50
dialog = gtk_message_dialog_new (NULL,
51
GTK_DIALOG_DESTROY_WITH_PARENT,
55
gtk_message_dialog_format_secondary_text(dialog, descr);
56
gtk_dialog_add_button(dialog, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
57
gtk_dialog_add_button(dialog, _("Report problem…"), GTK_RESPONSE_ACCEPT);
58
int res = gtk_dialog_run(dialog);
59
gtk_widget_destroy(dialog);
60
if (res == GTK_RESPONSE_ACCEPT)
44
66
run_apport(TrayApplet *ta)
46
68
g_debug("fire up the crashreport tool\n");
47
69
if (check_system_crashes()) {
48
invoke_with_gksu(CRASHREPORT_REPORT_APP,
49
_("<span weight=\"bold\" size=\"larger\">Please enter your password to access problem reports of system programs</span>"),
70
// be nice and always ask first before firing up gksu with its fullscreen
72
if (ask_invoke_apport_with_gksu()) {
73
invoke_with_gksu(CRASHREPORT_REPORT_APP,
74
_("<span weight=\"bold\" size=\"larger\">Please enter your password to access problem reports of system programs</span>"),
53
return g_spawn_command_line_async(CRASHREPORT_REPORT_APP, NULL);
79
return g_spawn_command_line_async(CRASHREPORT_REPORT_APP, NULL);
144
170
gboolean visible = gtk_status_icon_get_visible(ta->tray_icon);
146
// special case for unity (and generally stuff that lacks a
147
// notification area, if the icon can not be embedded we just
148
// fire up apport regardless (but skip if there are system
149
// crashes as this will result in gksu windows
150
if (!gtk_status_icon_is_embedded (ta->tray_icon) &&
151
crashreports_found > 0 &&
153
g_debug("unity handler");
154
crashreports_found=0;
159
172
// normal operation
161
174
// crashreport found and first run: show notification bubble and
167
180
/* Show the notification, after a delay so it doesn't look ugly
168
181
* if we've just logged in */
169
182
g_timeout_add(5000, (GSourceFunc)(show_notification), ta);
172
184
// crashreport found and already visible
173
185
else if((crashreports_found > 0) && !(system_crashes || first_run)) {
181
193
hide_crash_applet(ta);
196
// special case for unity (and generally stuff that lacks a
197
// notification area, if the icon can not be embedded we just
198
// fire up apport regardless in-your-face
199
// WARNING: this needs to be *after* the normal operation
200
// and the event loop needs to be flushed, otherwise
201
// gtk_status_icon_is_embedded() will return FALSE
202
while (gtk_events_pending())
203
gtk_main_iteration();
204
if (!gtk_status_icon_is_embedded (ta->tray_icon) &&
205
crashreports_found > 0) {
206
g_debug("unity handler");
207
crashreports_found=0;
184
213
first_run = FALSE;