banshee r4067 - in trunk/banshee: . src/Clients/Nereid/Nereid src/Core/Banshee.ThickClient/Banshee.Sources.Gui



Author: gburt
Date: Mon Jun  2 19:50:45 2008
New Revision: 4067
URL: http://svn.gnome.org/viewvc/banshee?rev=4067&view=rev

Log:
2008-06-02  Gabriel Burt  <gabriel burt gmail com>

	* src/Clients/Nereid/Nereid/ViewContainer.cs: Add the separator back
	between the filter options and the Help item.  Attempt to fix the
	"GdkWindow unexpectedly destroyed" warnings (and related partial UI
	freezing) by hiding the old content, adding and showing the new content,
	and then removing the old content when switching source contents.

	* src/Core/Banshee.ThickClient/Banshee.Sources.Gui/FilteredListSourceContents.cs:
	Remove WriteLine cruft.


Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Clients/Nereid/Nereid/ViewContainer.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/FilteredListSourceContents.cs

Modified: trunk/banshee/src/Clients/Nereid/Nereid/ViewContainer.cs
==============================================================================
--- trunk/banshee/src/Clients/Nereid/Nereid/ViewContainer.cs	(original)
+++ trunk/banshee/src/Clients/Nereid/Nereid/ViewContainer.cs	Mon Jun  2 19:50:45 2008
@@ -96,11 +96,11 @@
             if (uia != null) {
                 Gtk.Action action = uia.GlobalActions["WikiSearchHelpAction"];
                 if (action != null) {
-                    //MenuItem item = new SeparatorMenuItem ();
-                    //item.Show ();
-                    //search_entry.Menu.Append (item);
+                    MenuItem item = new SeparatorMenuItem ();
+                    item.Show ();
+                    search_entry.Menu.Append (item);
                     
-                    MenuItem item = new ImageMenuItem (Stock.Help, null);
+                    item = new ImageMenuItem (Stock.Help, null);
                     item.Activated += delegate { action.Activate (); };
                     item.Show ();
                     search_entry.Menu.Append (item);
@@ -208,18 +208,24 @@
                 if (content == value) {
                     return;
                 }
-                
+
+                // Hide the old content widget
                 if (content != null && content.Widget != null) {
                     content.Widget.Hide ();
-                    Remove (content.Widget);
+                }
+
+                // Add and show the new one
+                if (value != null && value.Widget != null) {
+                    PackStart (value.Widget, true, true, 0);
+                    value.Widget.Show ();
                 }
                 
-                content = value;
-                
+                // Remove the old one
                 if (content != null && content.Widget != null) {
-                    PackStart (content.Widget, true, true, 0);
-                    content.Widget.Show ();
+                    Remove (content.Widget);
                 }
+                
+                content = value;
             }
         }
         

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/FilteredListSourceContents.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/FilteredListSourceContents.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/FilteredListSourceContents.cs	Mon Jun  2 19:50:45 2008
@@ -171,25 +171,20 @@
             // Unparent the views' scrolled window parents so they can be re-packed in 
             // a new layout. The main container gets destroyed since it will be recreated.
             
-            //Console.WriteLine ("FLSC.reset 1");
             foreach (ScrolledWindow window in filter_scrolled_windows) {
                 Paned filter_container = window.Parent as Paned;
                 if (filter_container != null) {
                     filter_container.Remove (window);
                 }
             }
-            //Console.WriteLine ("FLSC.reset 2");
-            
+
             if (container != null && main_scrolled_window != null) {
                 container.Remove (main_scrolled_window);
             }
             
-            //Console.WriteLine ("FLSC.reset 3");
-            
             if (container != null) {
                 Remove (container);
             }
-            //Console.WriteLine ("FLSC.reset 4");
         }
 
         private void LayoutLeft ()
@@ -211,13 +206,11 @@
             Paned filter_box = GetPane (top);
             filter_box.PositionSet = true;
             Paned current_pane = filter_box;
-            //Console.WriteLine ("FLSC.layout 1");
             
             for (int i = 0; i < filter_scrolled_windows.Count; i++) {
                 ScrolledWindow window = filter_scrolled_windows[i];
                 bool last_even_filter = (i == filter_scrolled_windows.Count - 1 && filter_scrolled_windows.Count % 2 == 0);
                 if (i > 0 && !last_even_filter) {
-                    //Console.WriteLine ("creating new pane for filter {0}", i);
                     Paned new_pane = GetPane (top);
                     current_pane.Add2 (new_pane);
                     current_pane.Position = 350;
@@ -236,19 +229,15 @@
                         current_pane.Add1 (window);
                 }
                     
-                //Console.WriteLine ("FLSC.layout 2");
             }
             
-            //Console.WriteLine ("FLSC.layout 3");
             container.Add1 (filter_box);
             container.Add2 (main_scrolled_window);
-            //Console.WriteLine ("FLSC.layout 4");
             browser_container = filter_box;
             
             container.Position = top ? 175 : 275;
             PersistentPaneController.Control (container, ControllerName (top, -1));
             ShowPack ();
-            //Console.WriteLine ("FLSC.layout 5");
         }
         
         private string ControllerName (bool top, int filter)



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