banshee r3284 - in trunk/banshee: . src/Clients/Nereid/Nereid src/Core/Banshee.ThickClient/Banshee.Gui src/Core/Banshee.ThickClient/Banshee.Sources.Gui src/Libraries/Hyena.Gui/Hyena.Gui



Author: abock
Date: Wed Feb 20 19:45:31 2008
New Revision: 3284
URL: http://svn.gnome.org/viewvc/banshee?rev=3284&view=rev

Log:
2008-02-20  Aaron Bockover  <abock gnome org>

    * src/Clients/Nereid/Nereid/PlayerInterface.cs: If control is being held
    down when the source view activates a row, set the source to be the
    playback source, but do not play the first song in that source - this means
    that ctrl+double-clicking a source will 'queue' that source to play next

    * src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs: Make sure the
    editor button works on all database sources

    * src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs: Because
    the ctrl+click behavior is strange on this use of the tree view, override
    it and emulate the row activation

    * src/Libraries/Hyena.Gui/Hyena.Gui/GtkUtilities.cs: Support reading 
    modifier states from Gdk.EventButton as well; make the array params



Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui/GtkUtilities.cs

Modified: trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs
==============================================================================
--- trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs	(original)
+++ trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs	Wed Feb 20 19:45:31 2008
@@ -258,7 +258,9 @@
 
             source_view.RowActivated += delegate {
                 SetPlaybackControllerSource (ServiceManager.SourceManager.ActiveSource);
-                ServiceManager.PlaybackController.First ();
+                if (GtkUtilities.NoImportantModifiersAreSet (Gdk.ModifierType.ControlMask)) {
+                    ServiceManager.PlaybackController.First ();
+                }
             };
             
             header_toolbar.ExposeEvent += OnHeaderToolbarExposeEvent;

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs	Wed Feb 20 19:45:31 2008
@@ -199,7 +199,7 @@
         {
             Hyena.Collections.Selection selection = TrackSelector.TrackSelectionProxy.Selection;
             Source source = ServiceManager.SourceManager.ActiveSource;
-            bool in_library = (source != null && source.Parent is LibrarySource) || source is LibrarySource;
+            bool in_database = source is DatabaseSource;
 
             if (selection != null) {
                 bool has_selection = selection.Count > 0;
@@ -228,9 +228,9 @@
 
                     UpdateAction ("RemoveTracksFromLibraryAction", source.Parent is LibrarySource, has_selection, null);
                     
-                    UpdateAction ("TrackPropertiesAction", in_library, has_selection, null);
-                    UpdateAction ("RateTracksAction", in_library, has_selection, null);
-                    UpdateAction ("AddToPlaylistAction", in_library, has_selection, null);
+                    UpdateAction ("TrackPropertiesAction", in_database, has_selection, null);
+                    UpdateAction ("RateTracksAction", in_database, has_selection, null);
+                    UpdateAction ("AddToPlaylistAction", in_database, has_selection, null);
                 }
             }
         }

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs	Wed Feb 20 19:45:31 2008
@@ -61,8 +61,6 @@
         private int current_timeout = -1;
         private bool editing_row = false;
 
-        public event EventHandler SourceDoubleClicked;
-    
         public SourceView ()
         {
             BuildColumns ();
@@ -149,7 +147,7 @@
         protected override bool OnButtonPressEvent (Gdk.EventButton evnt)
         {
             TreePath path;
-            
+                       
             if (evnt.Button == 1) {
                 ResetHighlight ();
             }
@@ -173,17 +171,20 @@
                 if (ServiceManager.SourceManager.ActiveSource != source) {
                     ServiceManager.SourceManager.SetActiveSource (source);
                 }
-                
-                if (evnt.Type == Gdk.EventType.TwoButtonPress) {
-                    OnSourceDoubleClicked ();
-                }
             } else if (evnt.Button == 3) {
                 HighlightPath (path);
                 OnPopupMenu ();
                 return true;
             }
             
-            return base.OnButtonPressEvent(evnt);
+            if ((evnt.State & Gdk.ModifierType.ControlMask) != 0) {
+                if (evnt.Type == Gdk.EventType.TwoButtonPress && evnt.Button == 1) {
+                    ActivateRow (path, null);
+                }
+                return true;
+            }
+            
+            return base.OnButtonPressEvent (evnt);
         }
 
         protected override bool OnPopupMenu ()
@@ -487,18 +488,6 @@
         
 #endregion
 
-#region Virtual Methods
-        
-        protected virtual void OnSourceDoubleClicked ()
-        {
-            EventHandler handler = SourceDoubleClicked;
-            if (handler != null) {
-                handler (this, EventArgs.Empty);
-            }
-        }
-
-#endregion
-
 #region Public Properties
                 
         public Source HighlightedSource {

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui/GtkUtilities.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui/GtkUtilities.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui/GtkUtilities.cs	Wed Feb 20 19:45:31 2008
@@ -43,14 +43,18 @@
             return NoImportantModifiersAreSet (important_modifiers);
         }
             
-        public static bool NoImportantModifiersAreSet (Gdk.ModifierType [] modifiers)
+        public static bool NoImportantModifiersAreSet (params Gdk.ModifierType [] modifiers)
         {
-            if (!(Global.CurrentEvent is Gdk.EventKey)) {
+            Gdk.ModifierType state;
+            
+            if (Global.CurrentEvent is Gdk.EventKey) {
+                state = ((Gdk.EventKey)Global.CurrentEvent).State;
+            } else if (Global.CurrentEvent is Gdk.EventButton) {
+                state = ((Gdk.EventButton)Global.CurrentEvent).State;
+            } else {
                 return false;
             }
             
-            Gdk.ModifierType state = ((Gdk.EventKey)Global.CurrentEvent).State;
-            
             foreach (Gdk.ModifierType modifier in modifiers) {
                 if ((state & modifier) == modifier) {
                     return false;



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