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 | |
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.
-rw-r--r-- | e-util/e-alert-dialog.c | 14 | ||||
-rw-r--r-- | po/POTFILES.in | 1 |
2 files changed, 15 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; diff --git a/po/POTFILES.in b/po/POTFILES.in index b257780c9b..36bf948e96 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -157,6 +157,7 @@ em-format/em-format.c em-format/em-format-quote.c e-util/e-activity.c e-util/e-alert.c +e-util/e-alert-dialog.c e-util/e-categories-config.c e-util/e-charset.c e-util/e-datetime-format.c |