[banshee: 2/7] [Banshee.ThickClient] Don't set PlayerEngine volume on widget creation.



commit 6d44ba5cb4bace184749484c71f43dc86932cf4e
Author: Christopher James Halse Rogers <chrishr src gnome org>
Date:   Sun Mar 14 14:34:27 2010 +1100

    [Banshee.ThickClient] Don't set PlayerEngine volume on widget creation.
    
    The ConnectedVolumeButton () ctor sets the VolumeButton.Volume property from gconf.
    This sets the GTK slider value, which triggers ValueChanged, which triggers OnVolumeChanged,
    which triggers ConnectedVolumeButton to try to set PlayerEngine.Volume.
    
    The PlayerEngine is not guaranteed to be fully initialised by this point, so set
    emit_lock to true before setting VolumeButton.Volume
    
    This fixes the problem worked-around by commit 3159f8900f88b0044b3c8006f3004d0e6f041fab

 .../Banshee.Gui.Widgets/ConnectedVolumeButton.cs   |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ConnectedVolumeButton.cs b/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ConnectedVolumeButton.cs
index e027928..f654244 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ConnectedVolumeButton.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ConnectedVolumeButton.cs
@@ -37,9 +37,11 @@ namespace Banshee.Gui.Widgets
     {
         private bool emit_lock = false;
 
-        public ConnectedVolumeButton () : base ()
+        public ConnectedVolumeButton () : base()
         {
+            emit_lock = true;
             Volume = PlayerEngineService.VolumeSchema.Get ();
+            emit_lock = false;
             ServiceManager.PlayerEngine.ConnectEvent (OnPlayerEvent, PlayerEvent.Volume);
         }
 



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