[banshee] [Nereid] construct the player UI when first shown



commit 8a306de27ecda966c8e06c4c84e3e0f6e90dcb56
Author: Aaron Bockover <abockover novell com>
Date:   Tue Feb 16 20:43:19 2010 -0500

    [Nereid] construct the player UI when first shown
    
    Defer creating any UI until the window is actually shown for the
    first time. This yields an incredible startup (~2x) startup
    improvement when starting hidden (--hide). We do this in Moblin
    since Banshee is a system service and is started in the session.
    
    This allows all the services to be available, and then the Moblin
    extension adds its panel to the Moblin toolbar.

 src/Clients/Nereid/Nereid/PlayerInterface.cs       |   24 +++++++++++++++++--
 .../Banshee.Sources.Gui/SourceView.cs              |    2 +
 2 files changed, 23 insertions(+), 3 deletions(-)
---
diff --git a/src/Clients/Nereid/Nereid/PlayerInterface.cs b/src/Clients/Nereid/Nereid/PlayerInterface.cs
index 86dd915..9f91357 100644
--- a/src/Clients/Nereid/Nereid/PlayerInterface.cs
+++ b/src/Clients/Nereid/Nereid/PlayerInterface.cs
@@ -97,14 +97,31 @@ namespace Nereid
 
         protected override void Initialize ()
         {
+            InitialShowPresent ();
+        }
+
+        private bool interface_constructed;
+
+        protected override void OnShown ()
+        {
+            if (interface_constructed) {
+                base.OnShown ();
+                return;
+            }
+
+            interface_constructed = true;
+            uint timer = Log.DebugTimerStart ();
+
             BuildPrimaryLayout ();
             ConnectEvents ();
 
             ActionService.SourceActions.SourceView = this;
-
             composite_view.TrackView.HasFocus = true;
+            OnActiveSourceChanged (null);
 
-            InitialShowPresent ();
+            Log.DebugTimerPrint (timer, "Constructed Nereid interface: {0}");
+
+            base.OnShown ();
         }
 
 #region System Overrides
@@ -156,9 +173,10 @@ namespace Nereid
             header_toolbar = (Toolbar)ActionService.UIManager.GetWidget ("/HeaderToolbar");
             header_toolbar.ShowArrow = false;
             header_toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;
+            header_toolbar.Show ();
 
             toolbar_alignment.Add (header_toolbar);
-            toolbar_alignment.ShowAll ();
+            toolbar_alignment.Show ();
 
             header_table.Attach (toolbar_alignment, 0, 2, 1, 2,
                 AttachOptions.Expand | AttachOptions.Fill,
diff --git a/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs b/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs
index 5c4b68c..d83adbd 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs
@@ -81,6 +81,8 @@ namespace Banshee.Sources.Gui
             ConnectEvents ();
 
             RowSeparatorFunc = RowSeparatorHandler;
+
+            ResetSelection ();
         }
 
 #region Setup Methods



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