[glabels] Don't allow message bars to stack up in media select widget.



commit a490fde76c660355393bebff2fe48ec4daa3bfd7
Author: Jim Evins <evins snaught com>
Date:   Mon Jan 18 21:33:08 2010 -0500

    Don't allow message bars to stack up in media select widget.
    
    Remove old glMessageBar when attempting to load glMediaSelect tree views.
    This will make sure if a new glMessageBar is needed, it won't just stack
    up old message bars.

 src/media-select.c |   27 +++++++++++++++------------
 1 files changed, 15 insertions(+), 12 deletions(-)
---
diff --git a/src/media-select.c b/src/media-select.c
index 5f1eecd..8033829 100644
--- a/src/media-select.c
+++ b/src/media-select.c
@@ -770,6 +770,14 @@ load_recent_list (glMediaSelect      *this,
 
         gtk_list_store_clear (store);
 
+
+        if ( this->priv->recent_info_bar )
+        {
+                gtk_container_remove (GTK_CONTAINER (this->priv->recent_info_vbox),
+                                      this->priv->recent_info_bar);
+                this->priv->recent_info_bar = NULL;
+        }
+
         if (list)
         {
 
@@ -808,12 +816,6 @@ load_recent_list (glMediaSelect      *this,
                 gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter);
                 gtk_tree_selection_select_iter (selection, &iter);
 
-                if ( this->priv->recent_info_bar )
-                {
-                        gtk_container_remove (GTK_CONTAINER (this->priv->recent_info_vbox),
-                                              this->priv->recent_info_bar);
-                        this->priv->recent_info_bar = NULL;
-                }
         }
         else
         {
@@ -857,6 +859,13 @@ load_search_all_list (glMediaSelect      *this,
 
         gtk_list_store_clear (store);
 
+        if ( this->priv->search_all_info_bar )
+        {
+                gtk_container_remove (GTK_CONTAINER (this->priv->search_all_info_vbox),
+                                      this->priv->search_all_info_bar);
+                this->priv->search_all_info_bar = NULL;
+        }
+
         if (list)
         {
 
@@ -895,12 +904,6 @@ load_search_all_list (glMediaSelect      *this,
                 gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter);
                 gtk_tree_selection_select_iter (selection, &iter);
 
-                if ( this->priv->search_all_info_bar )
-                {
-                        gtk_container_remove (GTK_CONTAINER (this->priv->search_all_info_vbox),
-                                              this->priv->search_all_info_bar);
-                        this->priv->search_all_info_bar = NULL;
-                }
         }
         else
         {



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