diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-03-26 02:20:19 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-03-26 02:20:19 +0800 |
commit | ac5adbd8fb5ee604d825c60da9fb2df99322a58f (patch) | |
tree | df9a0c39478d095ca0ffe2fa502fb44739b4e521 /widgets/misc | |
parent | d1dc722f34b2efcc2f606de02a3cef25d8c7d9ea (diff) | |
download | gsoc2013-evolution-ac5adbd8fb5ee604d825c60da9fb2df99322a58f.tar.gz gsoc2013-evolution-ac5adbd8fb5ee604d825c60da9fb2df99322a58f.tar.zst gsoc2013-evolution-ac5adbd8fb5ee604d825c60da9fb2df99322a58f.zip |
EAlertBar: Make warnings time out after 5 minutes
Warnings are generally meant for transient errors. No need to leave
them up indefinitely. Close them automatically if the user hasn't
responded after a reasonable period of time has elapsed.
Diffstat (limited to 'widgets/misc')
-rw-r--r-- | widgets/misc/e-alert-bar.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/widgets/misc/e-alert-bar.c b/widgets/misc/e-alert-bar.c index 05f87cc752..8ed6bc3ff7 100644 --- a/widgets/misc/e-alert-bar.c +++ b/widgets/misc/e-alert-bar.c @@ -22,7 +22,10 @@ #include <glib/gi18n-lib.h> /* GTK_ICON_SIZE_DIALOG is a tad too big. */ -#define ICON_SIZE GTK_ICON_SIZE_DND +#define ICON_SIZE GTK_ICON_SIZE_DND + +/* Dismiss warnings automatically after 5 minutes. */ +#define WARNING_TIMEOUT_SECONDS (5 * 60) struct _EAlertBarPrivate { GQueue alerts; @@ -108,6 +111,13 @@ alert_bar_show_alert (EAlertBar *alert_bar) gtk_image_set_from_stock (image, stock_id, ICON_SIZE); gtk_widget_show (GTK_WIDGET (alert_bar)); + + /* Warnings are generally meant for transient errors. + * No need to leave them up indefinitely. Close them + * automatically if the user hasn't responded after a + * reasonable period of time has elapsed. */ + if (message_type == GTK_MESSAGE_WARNING) + e_alert_start_timer (alert, WARNING_TIMEOUT_SECONDS); } static void |