banshee r3586 - in trunk/banshee: . src/Core/Banshee.ThickClient/Banshee.Gui src/Core/Banshee.Widgets/Banshee.Widgets



Author: ahixon
Date: Sat Mar 29 09:14:24 2008
New Revision: 3586
URL: http://svn.gnome.org/viewvc/banshee?rev=3586&view=rev

Log:
2008-03-29  Alexander Hixon  <hixon alexander mediati org>

	* src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackActions.cs: Remember
	the shuffle state over restarts. Fixes BGO #523681.

	* src/Core/Banshee.Widgets/Banshee.Widgets/HoverImageButton.cs:
	* src/Core/Banshee.Widgets/Banshee.Widgets/SearchEntry.cs: Make sure we
	set the background colour correctly depending on the Sensitive state.
	Closes BGO #504633.


Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackActions.cs
   trunk/banshee/src/Core/Banshee.Widgets/Banshee.Widgets/HoverImageButton.cs
   trunk/banshee/src/Core/Banshee.Widgets/Banshee.Widgets/SearchEntry.cs

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackActions.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackActions.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackActions.cs	Sat Mar 29 09:14:24 2008
@@ -32,6 +32,7 @@
 
 using Banshee.Base;
 using Banshee.Collection;
+using Banshee.Configuration;
 using Banshee.ServiceStack;
 using Banshee.MediaEngine;
 using Banshee.PlaybackController;
@@ -79,24 +80,28 @@
                 new ToggleActionEntry ("ShuffleAction", "media-playlist-shuffle",
                     Catalog.GetString ("Shu_ffle"), null,
                     Catalog.GetString ("Toggle between shuffle or continuous playback modes"), 
-                    OnShuffleAction, false),
+                    OnShuffleAction, ShuffleEnabled.Get ()),
                     
                 new ToggleActionEntry ("StopWhenFinishedAction", null,
                     Catalog.GetString ("_Stop When Finished"), "<Shift>space",
                     Catalog.GetString ("Stop playback after the current item finishes playing"), 
                     OnStopWhenFinishedAction, false)
             });
-
+            
             actionService.GlobalActions.Add (new ActionEntry [] {
                 new ActionEntry ("PlaybackMenuAction", null,
                     Catalog.GetString ("_Playback"), null, null, null),
             });
             
+            ServiceManager.PlaybackController.ShuffleMode = ShuffleEnabled.Get () 
+                ? PlaybackShuffleMode.Shuffle
+                : PlaybackShuffleMode.Linear;
+            
+            action_service = actionService;
             ServiceManager.PlayerEngine.StateChanged += OnPlayerEngineStateChanged;
             ServiceManager.PlayerEngine.EventChanged += OnPlayerEngineEventChanged;
-            action_service = actionService;
         }
-            
+        
         private void OnPlayerEngineStateChanged (object o, PlayerEngineStateArgs args)
         {
             if (play_pause_action == null) {
@@ -201,6 +206,15 @@
             ServiceManager.PlaybackController.ShuffleMode = ((ToggleAction)o).Active 
                 ? PlaybackShuffleMode.Shuffle
                 : PlaybackShuffleMode.Linear;
+            
+            ShuffleEnabled.Set ((o as ToggleAction).Active);
         }
+        
+        public static readonly SchemaEntry<bool> ShuffleEnabled = new SchemaEntry<bool> (
+            "playback", "shuffle",
+            false,
+            "Shuffle playback",
+            "Enable shuffle mode"
+        );
     }
 }

Modified: trunk/banshee/src/Core/Banshee.Widgets/Banshee.Widgets/HoverImageButton.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Widgets/Banshee.Widgets/HoverImageButton.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Widgets/Banshee.Widgets/HoverImageButton.cs	Sat Mar 29 09:14:24 2008
@@ -79,6 +79,12 @@
                 handler(this, EventArgs.Empty);
             }
         }
+        
+        private bool sensitive;
+        public new bool Sensitive {
+            get { return sensitive; }
+            set { sensitive = value; }
+        }
 
         private bool changing_style = false;
         protected override void OnStyleSet(Style previous_style)

Modified: trunk/banshee/src/Core/Banshee.Widgets/Banshee.Widgets/SearchEntry.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Widgets/Banshee.Widgets/SearchEntry.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Widgets/Banshee.Widgets/SearchEntry.cs	Sat Mar 29 09:14:24 2008
@@ -46,6 +46,7 @@
         
         private string empty_message;
         private bool ready = false;
+        private StateType current_state = StateType.Normal;
 
         private event EventHandler filter_changed;
         private event EventHandler entry_changed;
@@ -195,12 +196,23 @@
 
         private void OnInnerEntryStyleSet(object o, StyleSetArgs args)
         {
-            Gdk.Color color = entry.Style.Base(StateType.Normal);
-            filter_button.ModifyBg(StateType.Normal, color);
-            clear_button.ModifyBg(StateType.Normal, color);
+            Gdk.Color color = entry.Style.Base (current_state);
+            filter_button.ModifyBg (current_state, color);
+            clear_button.ModifyBg (current_state, color);
 
             box.BorderWidth = (uint)entry.Style.XThickness;
         }
+        
+        public new bool Sensitive {
+                get { return current_state == StateType.Normal; }
+                set {
+                    current_state = value ? StateType.Normal : StateType.Insensitive;
+                    box.Sensitive = value;
+                    
+                    // Now, redraw the background and text colors.
+                    OnInnerEntryStyleSet (null, null);
+                }
+            }
 
         private void OnInnerEntryFocusEvent(object o, EventArgs args)
         {
@@ -367,6 +379,7 @@
             get { return entry.HasFocus; }
             set { entry.HasFocus = true; }
         }
+
         
         public Entry InnerEntry {
             get { return entry; }



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