]> git.sur5r.net Git - glabels/commitdiff
Don't allow message bars to stack up in media select widget.
authorJim Evins <evins@snaught.com>
Tue, 19 Jan 2010 02:33:08 +0000 (21:33 -0500)
committerJim Evins <evins@snaught.com>
Tue, 19 Jan 2010 02:33:08 +0000 (21:33 -0500)
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

index 5f1eecdd711a5436170f5de0757392c61419989f..8033829a5c0d2b9be74f09f7209706c9a66f03c1 100644 (file)
@@ -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
         {