[evolution] Add an environment variable to show all errors as intrusive
- From: Chenthill Palanisamy <pchen src gnome org>
- To: svn-commits-list gnome org
- Subject: [evolution] Add an environment variable to show all errors as intrusive
- Date: Tue, 14 Jul 2009 10:26:30 +0000 (UTC)
commit e5fe0c9a3b74bf4910d768d65bb59a53c3792001
Author: Chenthill Palanisamy <pchenthill novell com>
Date: Tue Jul 14 15:45:50 2009 +0530
Add an environment variable to show all errors as intrusive
if needed.
widgets/misc/e-activity-handler.c | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/widgets/misc/e-activity-handler.c b/widgets/misc/e-activity-handler.c
index ed5db04..471d585 100644
--- a/widgets/misc/e-activity-handler.c
+++ b/widgets/misc/e-activity-handler.c
@@ -533,6 +533,19 @@ error_cleanup (EActivityHandler *activity_handler)
return berror;
}
+static gboolean
+show_intrusive_errors (void)
+{
+ const char *intrusive = NULL;
+
+ intrusive = g_getenv ("EVO-SHOW-INTRUSIVE-ERRORS");
+
+ if (intrusive && g_str_equal (intrusive, "1"))
+ return TRUE;
+ else
+ return FALSE;
+}
+
guint
e_activity_handler_make_error (EActivityHandler *activity_handler,
const gchar *component_id,
@@ -549,6 +562,11 @@ e_activity_handler_make_error (EActivityHandler *activity_handler,
priv = activity_handler->priv;
activity_id = get_new_activity_id (activity_handler);
+ if (show_intrusive_errors ()) {
+ gtk_widget_show (error);
+ return activity_id;
+ }
+
activity_info = activity_info_new (component_id, activity_id, information, TRUE);
activity_info->error = error;
activity_info->error_time = time (NULL);
@@ -622,8 +640,9 @@ e_activity_handler_operation_set_error(EActivityHandler *activity_handler,
g_object_set_data ((GObject *) task_widget, "activity", GINT_TO_POINTER(activity_id));
g_object_set_data ((GObject *) task_widget, "error-type", GINT_TO_POINTER(E_LOG_ERROR));
g_signal_connect_swapped (tool, "clicked", G_CALLBACK(handle_error), task_widget);
+ handle_error (task_widget);
}
-
+
if (!activity_handler->priv->error_timer)
activity_handler->priv->error_timer = g_timeout_add (activity_handler->priv->error_flush_interval, (GSourceFunc) error_cleanup, activity_handler);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]