diff options
author | Milan Crha <mcrha@redhat.com> | 2011-12-23 00:22:24 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2011-12-23 00:22:24 +0800 |
commit | f2ab123afa50e8fa0c905a04c1a2e846edbe87a4 (patch) | |
tree | e5c04d6579c5a43b7165eafd0fec8ace243ac164 /e-util | |
parent | 8ad132c58be4ed401450d79f9d0cc3511d61f210 (diff) | |
download | gsoc2013-evolution-f2ab123afa50e8fa0c905a04c1a2e846edbe87a4.tar.gz gsoc2013-evolution-f2ab123afa50e8fa0c905a04c1a2e846edbe87a4.tar.zst gsoc2013-evolution-f2ab123afa50e8fa0c905a04c1a2e846edbe87a4.zip |
Make sure EAlertDialog has at least one button, to be able to closed it
This is a regression from commit 451179909849, which removes the default
"Dismiss" action from each EAlert, but the EAlertDialog was using that
button to allow users to close it.
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/e-alert-dialog.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/e-util/e-alert-dialog.c b/e-util/e-alert-dialog.c index 70e53432f3..2f27a4fbcd 100644 --- a/e-util/e-alert-dialog.c +++ b/e-util/e-alert-dialog.c @@ -25,6 +25,8 @@ #include <config.h> #endif +#include <glib/gi18n.h> + #include "e-alert-dialog.h" #include "e-util.h" @@ -150,6 +152,18 @@ alert_dialog_constructed (GObject *object) /* Add buttons from actions. */ actions = e_alert_peek_actions (alert); + if (!actions) { + GtkAction *action; + + /* Make sure there is at least one action, thus the dialog can be closed. */ + action = gtk_action_new ( + "alert-response-0", _("_Dismiss"), NULL, NULL); + e_alert_add_action (alert, action, GTK_RESPONSE_CLOSE); + g_object_unref (action); + + actions = e_alert_peek_actions (alert); + } + while (actions != NULL) { GtkWidget *button; gpointer data; |