banshee r3063 - in trunk/banshee: . src/Core/Banshee.Services src/Core/Banshee.Services/Banshee.Collection.Database src/Core/Banshee.Services/Banshee.Database src/Core/Banshee.Services/Banshee.Library src/Core/Banshee.Services/Banshee.Playlist src/Core/Banshee.Services/Banshee.ServiceStack src/Core/Banshee.Services/Banshee.SmartPlaylist src/Core/Banshee.Services/Banshee.Sources src/Core/Banshee.ThickClient/Banshee.Collection.Gui src/Core/Banshee.ThickClient/Banshee.Gui src/Core/Banshee.ThickClient/Resources src/Core/Hyena src/Core/Hyena/Hyena.Data.Sqlite



Author: abock
Date: Mon Jan 28 05:39:42 2008
New Revision: 3063
URL: http://svn.gnome.org/viewvc/banshee?rev=3063&view=rev

Log:
2008-01-28  Aaron Bockover  <abock gnome org>

    This commit adds about 90% of what's needed for a fully functioning 
    play queue. Yes, you can has queue. You can has indeed. <3

    * src/Core/Banshee.Services/Banshee.Collection.Database/TrackListDatabaseModel.cs:
    Allow model to have a sort query forced upon it, effectively disabling
    user sorting

    * src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs:
    CorePlaylists has a new column called Special; Special playlists (not 0)
    are ignored by the regular static playlist loader

    * src/Core/Banshee.Services/Banshee.Playlist/AbstractPlaylistSource.cs:
    Get rid of the IconName property

    * src/Core/Banshee.Services/Banshee.Library/LibrarySource.cs: Use the old
    home icon again; make the library source order 1

    * src/Core/Banshee.Services/Banshee.Playlist/PlayQueueSource.cs: Hot
    sexy new source for the play queue; it's the world's first special
    playlist in Banshee

    * src/Core/Banshee.Services/Banshee.Playlist/PlaylistSource.cs: Do not
    load special playlists; return mediocre playlists using yield, instead of
    collecting into a temporary list; cope with the fact that IconName was
    banished from the base APS

    * src/Core/Banshee.Services/Banshee.ServiceStack/Application.cs: Load the
    hot new play queue source - zomg

    * src/Core/Banshee.Services/Banshee.SmartPlaylist/SmartPlaylistSource.cs:
    Also deal with the fact that IconName was banished from APS

    * src/Core/Banshee.Services/Banshee.Sources/ITrackModelSource.cs:
    * src/Core/Banshee.Services/Banshee.Sources/DatabaseSource.cs: Added a
    ShowBrowser property that allows track model sources to mandate whether
    or not the user can see the browser

    * src/Core/Banshee.Services/Makefile.am:
    * src/Core/Banshee.ThickClient/Banshee.Collection.Gui/CompositeTrackListView.cs:
    Respect ShowBrowser if the active source is an ITrackModelSource, otherwise
    never show the browser since that doesn't make sense

    * src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs:
    * src/Core/Banshee.ThickClient/Resources/core-ui-actions-layout.xml:
    Added the sweet new 'Add to Play Queue' action

    * src/Core/Hyena/Hyena.Data.Sqlite/HyenaSqliteConnection.cs: Added
    LastInsertRowId, because that is some useful stuff



Added:
   trunk/banshee/src/Core/Banshee.Services/Banshee.Playlist/PlayQueueSource.cs
Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/TrackListDatabaseModel.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.Library/LibrarySource.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.Playlist/AbstractPlaylistSource.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.Playlist/PlaylistSource.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/Application.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.Services.mdp
   trunk/banshee/src/Core/Banshee.Services/Banshee.SmartPlaylist/SmartPlaylistSource.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/DatabaseSource.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/ITrackModelSource.cs
   trunk/banshee/src/Core/Banshee.Services/Makefile.am
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/CompositeTrackListView.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Resources/core-ui-actions-layout.xml
   trunk/banshee/src/Core/Hyena/Hyena.Data.Sqlite/HyenaSqliteConnection.cs
   trunk/banshee/src/Core/Hyena/Hyena.mdp

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/TrackListDatabaseModel.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/TrackListDatabaseModel.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/TrackListDatabaseModel.cs	Mon Jan 28 05:39:42 2008
@@ -53,6 +53,7 @@
         
         private ISortableColumn sort_column;
         private string sort_query;
+        private bool forced_sort_query;
         
         private string reload_fragment;
         private string join_fragment, condition;
@@ -63,7 +64,8 @@
         private string album_id_filter_query;
         
         private int rows_in_view;
-
+        
+        
         public TrackListDatabaseModel (BansheeDbConnection connection, string uuid)
         {
             this.connection = connection;
@@ -114,7 +116,7 @@
                 sort_query = null;
                 return;
             }
-
+            
             sort_query = GetSort (sort_column.SortKey, AscDesc ());
         }
 
@@ -185,6 +187,10 @@
         public void Sort(ISortableColumn column)
         {
             lock(this) {
+                if (forced_sort_query != null) {
+                    return;
+                }
+                
                 if(sort_column == column && sort_column != null) {
                     sort_column.SortType = sort_column.SortType == SortType.Ascending 
                         ? SortType.Descending 
@@ -280,6 +286,15 @@
                 }
             }
         }
+        
+        public string ForcedSortQuery {
+            get { return forced_sort_query ? sort_query : null; }
+            set { 
+                forced_sort_query = value != null;
+                sort_query = value;
+                cache.Clear ();
+            }
+        }
 
         public string JoinFragment {
             get { return join_fragment; }

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs	Mon Jan 28 05:39:42 2008
@@ -316,10 +316,16 @@
                     PlaylistID          INTEGER PRIMARY KEY,
                     Name                TEXT,
                     SortColumn          INTEGER NOT NULL DEFAULT -1,
-                    SortType            INTEGER NOT NULL DEFAULT 0
+                    SortType            INTEGER NOT NULL DEFAULT 0,
+                    Special             INTEGER NOT NULL DEFAULT 0
                 )
             ");
             
+            // Create the special play queue playlist here so we can 
+            // be sure it gets PlaylistID = 0, just for the sake of 
+            // cleanliness (no operations are performed on that assumption)
+            Banshee.Playlist.PlayQueueSource.CreateDatabaseEntry(connection);
+            
             Execute(@"
                 CREATE TABLE CorePlaylistEntries (
                     EntryID             INTEGER PRIMARY KEY,
@@ -422,7 +428,7 @@
             ");
 
             Execute(@"
-                INSERT INTO CorePlaylists
+                INSERT INTO CorePlaylists (PlaylistID, Name, SortColumn, SortType)
                     SELECT * FROM Playlists
             ");
 

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Library/LibrarySource.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Library/LibrarySource.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Library/LibrarySource.cs	Mon Jan 28 05:39:42 2008
@@ -65,9 +65,9 @@
             DELETE FROM CoreSmartPlaylistEntries WHERE TrackID = ?", 3
         );
     
-        public LibrarySource () : base (Catalog.GetString("Library"), Catalog.GetString ("Library"), "Library", 0)
+        public LibrarySource () : base (Catalog.GetString("Library"), Catalog.GetString ("Library"), "Library", 1)
         {
-            Properties.SetStringList ("IconName", "audio-x-generic", "go-home", "user-home", "source-library");
+            Properties.SetStringList ("IconName", "go-home", "user-home", "source-library");
             Properties.SetString ("GtkActionPath", "/LibraryContextMenu");
             AfterInitialized ();
 

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Playlist/AbstractPlaylistSource.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Playlist/AbstractPlaylistSource.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Playlist/AbstractPlaylistSource.cs	Mon Jan 28 05:39:42 2008
@@ -68,8 +68,6 @@
             }
         }
 
-        protected abstract string IconName { get; }
-
         public int? DbId {
             get { return dbid; }
             protected set {
@@ -91,7 +89,6 @@
         public AbstractPlaylistSource (string generic_name, string name, int? dbid, int sortColumn, int sortType) 
             : base (generic_name, name, Convert.ToString (dbid), 500)
         {
-            Properties.SetString ("IconName", IconName);
         }
 
         public override void Rename (string newName)

Added: trunk/banshee/src/Core/Banshee.Services/Banshee.Playlist/PlayQueueSource.cs
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Playlist/PlayQueueSource.cs	Mon Jan 28 05:39:42 2008
@@ -0,0 +1,105 @@
+//
+// PlayQueueSource.cs
+//
+// Author:
+//   Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2008 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Data;
+using Mono.Unix;
+
+using Hyena.Data.Sqlite;
+
+using Banshee.ServiceStack;
+using Banshee.Database;
+using Banshee.Collection.Database;
+
+namespace Banshee.Playlist
+{
+    public class PlayQueueSource : PlaylistSource
+    {
+        private static string special_playlist_name = typeof (PlayQueueSource).ToString ();
+        
+        private static PlayQueueSource instance;
+        public static PlayQueueSource Instance {
+            get { 
+                if (instance == null) {
+                    instance = new PlayQueueSource ();
+                }
+                
+                return instance;
+            }
+        }
+    
+        public PlayQueueSource () : base (Catalog.GetString ("Play Queue"), null)
+        {
+            BindToDatabase ();
+            
+            Order = 0;
+            Properties.SetString ("IconName", "audio-x-generic");
+            
+            ((TrackListDatabaseModel)TrackModel).ForcedSortQuery = "CorePlaylistEntries.EntryID DESC";
+        }
+        
+        private void BindToDatabase ()
+        {
+            object result = ServiceManager.DbConnection.ExecuteScalar (new HyenaSqliteCommand (@"
+                SELECT PlaylistID FROM CorePlaylists 
+                    WHERE Special = 1 AND Name = ?
+                    LIMIT 1", special_playlist_name));
+            
+            if (result != null) {
+                DbId = Convert.ToInt32 (result);
+            } else {
+                CreateDatabaseEntry (ServiceManager.DbConnection.Connection);
+                DbId = ServiceManager.DbConnection.LastInsertRowId;
+            }
+        }
+        
+        public override bool CanRename {
+            get { return false; }
+        }
+        
+        public override bool ShowBrowser {
+            get { return false; }
+        }
+    
+        // We have to use System.Data level API here since this is called inside
+        // of BansheeDbFormatMigrator and thus ServiceManager.DbConnection is not
+        // yet available for use.
+        internal static void CreateDatabaseEntry (IDbConnection connection)
+        {
+            IDbCommand command = connection.CreateCommand ();
+            
+            IDbDataParameter parameter = command.CreateParameter ();
+            parameter.ParameterName = "playlist_name";
+            parameter.Value = special_playlist_name;
+            command.Parameters.Add (parameter);
+            
+            command.CommandText = "INSERT INTO CorePlaylists VALUES (0, :playlist_name, -1, 0, 1)";
+            command.ExecuteNonQuery ();
+        }
+    }
+}

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Playlist/PlaylistSource.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Playlist/PlaylistSource.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Playlist/PlaylistSource.cs	Mon Jan 28 05:39:42 2008
@@ -67,10 +67,6 @@
             get { return "CorePlaylistEntries"; }
         }
 
-        protected override string IconName {
-            get { return "source-playlist"; }
-        }
-
         static PlaylistSource () 
         {
             add_tracks_command = new HyenaSqliteCommand (@"
@@ -100,6 +96,7 @@
         public PlaylistSource (string name, int? dbid, int sortColumn, int sortType) 
             : base (generic_name, name, dbid, sortColumn, sortType)
         {
+            Properties.SetString ("IconName", "source-playlist");
             Properties.SetString ("RemoveTracksActionLabel", Catalog.GetString ("Remove From Playlist"));
             Properties.SetString ("UnmapSourceActionLabel", Catalog.GetString ("Delete Playlist"));
             DbId = dbid;
@@ -193,7 +190,6 @@
         protected virtual void AddTrackRange (TrackListDatabaseModel from, RangeCollection.Range range)
         {
             add_tracks_command.ApplyValues (DbId, from.CacheId, range.Start, range.End - range.Start + 1);
-            Console.WriteLine ("adding tracks with {0}", add_tracks_command.CommandText);
             ServiceManager.DbConnection.Execute (add_tracks_command);
         }
 
@@ -203,22 +199,17 @@
             ServiceManager.DbConnection.Execute (remove_tracks_command);
         }
 
-        public static List<PlaylistSource> LoadAll ()
+        public static IEnumerable<PlaylistSource> LoadAll ()
         {
-            List<PlaylistSource> sources = new List<PlaylistSource> ();
-
             using (IDataReader reader = ServiceManager.DbConnection.ExecuteReader (
-                "SELECT PlaylistID, Name, SortColumn, SortType FROM CorePlaylists")) {
+                "SELECT PlaylistID, Name, SortColumn, SortType FROM CorePlaylists WHERE Special = 0")) {
                 while (reader.Read ()) {
-                    PlaylistSource playlist = new PlaylistSource (
+                    yield return new PlaylistSource (
                         reader[1] as string, Convert.ToInt32 (reader[0]),
                         Convert.ToInt32 (reader[2]), Convert.ToInt32 (reader[3])
                     );
-                    sources.Add (playlist);
                 }
             }
-            
-            return sources;
         }
     }
 

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/Application.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/Application.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/Application.cs	Mon Jan 28 05:39:42 2008
@@ -57,10 +57,12 @@
             ServiceManager.Run ();
             
             if (ServiceManager.SourceManager != null) {
+                ServiceManager.SourceManager.AddSource (PlayQueueSource.Instance, false);
                 ServiceManager.SourceManager.AddSource (new LibrarySource (), true);
 
-                foreach (PlaylistSource pl in PlaylistSource.LoadAll ())
+                foreach (PlaylistSource pl in PlaylistSource.LoadAll ()) {
                     ServiceManager.SourceManager.DefaultSource.AddChildSource (pl);
+                }
             }
             
             Banshee.Base.PlatformHacks.RestoreMonoJitSegv ();

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Services.mdp
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Services.mdp	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Services.mdp	Mon Jan 28 05:39:42 2008
@@ -112,6 +112,7 @@
     <File name="Banshee.Networking/NetworkManager.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.Database/BansheeModelProvider.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.Database/BansheeModelCache.cs" subtype="Code" buildaction="Compile" />
+    <File name="Banshee.Playlist/PlayQueueSource.cs" subtype="Code" buildaction="Compile" />
   </Contents>
   <References>
     <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.SmartPlaylist/SmartPlaylistSource.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.SmartPlaylist/SmartPlaylistSource.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.SmartPlaylist/SmartPlaylistSource.cs	Mon Jan 28 05:39:42 2008
@@ -93,10 +93,6 @@
             get { return "CoreSmartPlaylistEntries"; }
         }
 
-        protected override string IconName {
-            get { return "source-smart-playlist"; }
-        }
-
         // Custom properties
         private QueryNode condition;
         public QueryNode ConditionTree {
@@ -196,6 +192,7 @@
             LimitCriterion = limit_criterion;
             DbId = dbid;
 
+            Properties.SetString ("IconName", "source-smart-playlist");
             Properties.SetString ("SourcePropertiesActionLabel", properties_label);
 
             //Globals.Library.TrackRemoved += OnLibraryTrackRemoved;

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/DatabaseSource.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/DatabaseSource.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/DatabaseSource.cs	Mon Jan 28 05:39:42 2008
@@ -99,6 +99,10 @@
         public ArtistListModel ArtistModel {
             get { return artist_model; }
         }
+        
+        public virtual bool ShowBrowser { 
+            get { return true; }
+        }
 
 #endregion
 

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/ITrackModelSource.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/ITrackModelSource.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/ITrackModelSource.cs	Mon Jan 28 05:39:42 2008
@@ -48,5 +48,7 @@
 
         bool CanRemoveTracks { get; }
         bool CanDeleteTracks { get; }
+        
+        bool ShowBrowser { get; }
     }
 }

Modified: trunk/banshee/src/Core/Banshee.Services/Makefile.am
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Makefile.am	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Makefile.am	Mon Jan 28 05:39:42 2008
@@ -66,6 +66,7 @@
 	Banshee.Playlist/AbstractPlaylistSource.cs \
 	Banshee.Playlist/PlaylistFileUtil.cs \
 	Banshee.Playlist/PlaylistSource.cs \
+	Banshee.Playlist/PlayQueueSource.cs \
 	Banshee.Playlists.Formats.Xspf/LinkEntry.cs \
 	Banshee.Playlists.Formats.Xspf/MetaEntry.cs \
 	Banshee.Playlists.Formats.Xspf/Playlist.cs \

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/CompositeTrackListView.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/CompositeTrackListView.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/CompositeTrackListView.cs	Mon Jan 28 05:39:42 2008
@@ -37,6 +37,8 @@
 using Hyena.Data;
 using Hyena.Data.Gui;
 
+using Banshee.Sources;
+
 using Banshee.Gui;
 using Banshee.ServiceStack;
 using Banshee.Collection;
@@ -118,6 +120,10 @@
                 action_service.UIManager.AddUiFromString (menu_xml);
             }
             
+            ServiceManager.SourceManager.ActiveSourceChanged += delegate {
+                browser_container.Visible = ActiveSourceCanHasBrowser ? BrowserVisible.Get () : false; 
+            };
+            
             NoShowAll = true;
         }
         
@@ -239,7 +245,7 @@
         {
             ToggleAction action = (ToggleAction)o;
             artist_view.Selection.Clear ();
-            browser_container.Visible = action.Active;
+            browser_container.Visible = action.Active && ActiveSourceCanHasBrowser;
             BrowserVisible.Set (action.Active);
         }
         
@@ -309,6 +315,16 @@
             get { return (AlbumListModel)album_view.Model; }
         }
 
+        private bool ActiveSourceCanHasBrowser {
+            get {
+                if (!(ServiceManager.SourceManager.ActiveSource is ITrackModelSource)) {
+                    return false;
+                }
+                
+                return ((ITrackModelSource)ServiceManager.SourceManager.ActiveSource).ShowBrowser;
+            }
+        }
+
         public void SetModels (TrackListModel track, ArtistListModel artist, AlbumListModel album)
         {
             // Save the old vertical positions

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	Mon Jan 28 05:39:42 2008
@@ -50,7 +50,7 @@
         private RatingActionProxy rating_proxy;
 
         private static readonly string [] require_selection_actions = new string [] {
-            "TrackContextMenuAction", "TrackPropertiesAction", "AddToPlaylistAction",
+            "TrackContextMenuAction", "TrackPropertiesAction", "AddToPlayQueueAction", "AddToPlaylistAction",
             "RemoveTracksAction", "RemoveTracksFromLibraryAction", "DeleteTracksFromDriveAction",
             "RateTracksAction", "SelectNoneAction"
         };
@@ -94,6 +94,11 @@
                     Catalog.GetString ("_Edit Track Metadata"), null,
                     Catalog.GetString ("Edit metadata on selected tracks"), OnTrackProperties),
 
+                new ActionEntry ("AddToPlayQueueAction", Stock.Add,
+                    Catalog.GetString ("Add _to Play Queue"), null,
+                    Catalog.GetString ("Append selected songs to the play queue"),
+                    OnAddToPlayQueue),
+                    
                 new ActionEntry ("AddToPlaylistAction", Stock.Add,
                     Catalog.GetString ("Add _to Playlist"), null,
                     Catalog.GetString ("Append selected songs to playlist or create new playlist from selection"),
@@ -302,6 +307,11 @@
             PlaylistSource playlist = playlist_menu_map[o as MenuItem];
             playlist.AddSelectedTracks (TrackSelector.TrackModel);
         }
+        
+        private void OnAddToPlayQueue (object o, EventArgs args)
+        {
+            PlayQueueSource.Instance.AddSelectedTracks (TrackSelector.TrackModel);
+        }
 
         private void OnRemoveTracks (object o, EventArgs args)
         {

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Resources/core-ui-actions-layout.xml
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Resources/core-ui-actions-layout.xml	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Resources/core-ui-actions-layout.xml	Mon Jan 28 05:39:42 2008
@@ -21,6 +21,7 @@
         </menu>
 
         <menu name="EditMenu" action="EditMenuAction">
+            <menuitem name="AddToPlayQueue" action="AddToPlayQueueAction"></menuitem>
             <menu name="AddToPlaylist" action="AddToPlaylistAction"></menu>
             <menuitem name="TrackProperties" action="TrackPropertiesAction" />
             <separator />
@@ -108,6 +109,7 @@
     </popup>
 
     <popup name="TrackContextMenu" action="TrackContextMenuAction">
+        <menuitem name="AddToPlayQueue" action="AddToPlayQueueAction"></menuitem>
         <menu name="AddToPlaylist" action="AddToPlaylistAction"></menu>
         <separator />
         <menuitem name="RemoveTracks" action="RemoveTracksAction" />

Modified: trunk/banshee/src/Core/Hyena/Hyena.Data.Sqlite/HyenaSqliteConnection.cs
==============================================================================
--- trunk/banshee/src/Core/Hyena/Hyena.Data.Sqlite/HyenaSqliteConnection.cs	(original)
+++ trunk/banshee/src/Core/Hyena/Hyena.Data.Sqlite/HyenaSqliteConnection.cs	Mon Jan 28 05:39:42 2008
@@ -246,6 +246,10 @@
         {
             return Execute (new SqliteCommand (command.ToString ()));
         }
+        
+        public int LastInsertRowId {
+            get { return connection.LastInsertRowId; }
+        }
 
 #endregion
 

Modified: trunk/banshee/src/Core/Hyena/Hyena.mdp
==============================================================================
--- trunk/banshee/src/Core/Hyena/Hyena.mdp	(original)
+++ trunk/banshee/src/Core/Hyena/Hyena.mdp	Mon Jan 28 05:39:42 2008
@@ -74,8 +74,8 @@
   </Contents>
   <References>
     <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-    <ProjectReference type="Gac" localcopy="True" refto="Mono.Data.SqliteClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
     <ProjectReference type="Gac" localcopy="True" refto="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+    <ProjectReference type="Gac" localcopy="True" refto="Mono.Data.Sqlite, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
   </References>
   <Deployment.LinuxDeployData generateScript="False" />
   <MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="True" RelativeMakefileName="Makefile.am">



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