[evolution] Bug 739605 - Remove alert buttons on the alert bar hide



commit c0d144b24851bfd754ec273b0320bdb5dd3b61ac
Author: Milan Crha <mcrha redhat com>
Date:   Wed Nov 5 16:29:06 2014 +0100

    Bug 739605 - Remove alert buttons on the alert bar hide

 e-util/e-alert-bar.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/e-util/e-alert-bar.c b/e-util/e-alert-bar.c
index 233de93..66fbb34 100644
--- a/e-util/e-alert-bar.c
+++ b/e-util/e-alert-bar.c
@@ -202,9 +202,22 @@ alert_bar_response_cb (EAlert *alert,
        if (g_queue_remove (queue, alert))
                g_object_unref (alert);
 
-       if (g_queue_is_empty (queue))
+       if (g_queue_is_empty (queue)) {
+               GtkWidget *action_area;
+               GList *children;
+
                gtk_widget_hide (GTK_WIDGET (alert_bar));
-       else if (was_head) {
+
+               action_area = gtk_info_bar_get_action_area (GTK_INFO_BAR (alert_bar));
+
+               /* Remove all buttons from the previous alert. */
+               children = gtk_container_get_children (GTK_CONTAINER (action_area));
+               while (children != NULL) {
+                       GtkWidget *child = GTK_WIDGET (children->data);
+                       gtk_container_remove (GTK_CONTAINER (action_area), child);
+                       children = g_list_delete_link (children, children);
+               }
+       } else if (was_head) {
                GtkInfoBar *info_bar = GTK_INFO_BAR (alert_bar);
                gtk_info_bar_response (info_bar, response_id);
                alert_bar_show_alert (alert_bar);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]