diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-03-26 02:20:19 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:41:49 +0800 |
commit | c1259e5a0862258dd8f84daefcaeb8a04d538270 (patch) | |
tree | 152267bddee0447ba2eb6dba32451ddabd49b677 /widgets | |
parent | 56d3ccc621f0a75d9500ffa8daf3b0104f36708d (diff) | |
download | gsoc2013-evolution-c1259e5a0862258dd8f84daefcaeb8a04d538270.tar.gz gsoc2013-evolution-c1259e5a0862258dd8f84daefcaeb8a04d538270.tar.zst gsoc2013-evolution-c1259e5a0862258dd8f84daefcaeb8a04d538270.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')
-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 |