banshee r4020 - in trunk/banshee: . src/Core/Banshee.Services/Banshee.Collection.Database src/Core/Banshee.Services/Banshee.Playlist src/Core/Banshee.Services/Banshee.Sources src/Core/Banshee.ThickClient/Banshee.Sources.Gui src/Dap/Banshee.Dap/Banshee.Dap src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui



Author: gburt
Date: Thu May 29 04:21:47 2008
New Revision: 4020
URL: http://svn.gnome.org/viewvc/banshee?rev=4020&view=rev

Log:
2008-05-28  Gabriel Burt  <gabriel burt gmail com>

	* src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/ColumnCellPodcastStatusIndicator.cs:
	* src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastItemView.cs:
	Change grey to mean the podcast item is old, and the blue indicator to
	mean the podcast item has been downloaded.  Different than iTunes, but
	then so are we.  (Plus we let you stream podcast items).

	* src/Dap/Banshee.Dap/Banshee.Dap/RemovableSource.cs:
	* src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView_DragAndDrop.cs:
	* src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceModel.cs:
	* src/Core/Banshee.Services/Banshee.Sources/PrimarySource.cs:
	* src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackListModel.cs:
	* src/Core/Banshee.Services/Banshee.Playlist/PlaylistSource.cs: Fix up
	drag and droppability for sources and tracks.  Fix bug with sources having
	a border drawn around them when a dnd is cancelled.  Only allowed but
	not-yet-functional dnd is from DapSource subclass (eg Music) to a library.


Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackListModel.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.Playlist/PlaylistSource.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/PrimarySource.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceModel.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView_DragAndDrop.cs
   trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/MediaGroupSource.cs
   trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/RemovableSource.cs
   trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/ColumnCellPodcastStatusIndicator.cs
   trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastItemView.cs

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackListModel.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackListModel.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackListModel.cs	Thu May 29 04:21:47 2008
@@ -208,6 +208,12 @@
 
         public void Reload (IListModel reloadTrigger)
         {
+            if (cache == null) {
+                Log.WarningFormat ("Called Reload on {0} for source {1} but cache is null;  Did you forget to call AfterInitialized () in your DatabaseSource ctor?",
+                    this, source == null ? "null source!" : source.Name);
+                return;
+            }
+
             lock (this) {
                 GenerateUserQueryFragment ();
 

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	Thu May 29 04:21:47 2008
@@ -124,7 +124,10 @@
 
         public override bool AcceptsInputFromSource (Source source)
         {
-            return base.AcceptsInputFromSource (source) && (Parent == null || source == Parent || source.Parent == Parent);
+            return base.AcceptsInputFromSource (source) && (
+                source == Parent || 
+                (source.Parent == Parent || Parent == null || (source.Parent == null && !(source is PrimarySource)))
+            );
         }
         
         public override SourceMergeType SupportedMergeTypes {

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/PrimarySource.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/PrimarySource.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/PrimarySource.cs	Thu May 29 04:21:47 2008
@@ -429,7 +429,8 @@
 
         public override bool AcceptsInputFromSource (Source source)
         {
-            return base.AcceptsInputFromSource (source) && source.Parent != this;
+            return base.AcceptsInputFromSource (source) && source.Parent != this &&
+                (source.Parent is PrimarySource) && !(source.Parent is Banshee.Library.LibrarySource);
         }
 
         public override bool AddSelectedTracks (Source source)

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceModel.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceModel.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceModel.cs	Thu May 29 04:21:47 2008
@@ -118,8 +118,10 @@
         
         public Source GetSource (TreePath path)
         {
+            if (path == null)
+                return null;
+
             TreeIter iter;
-        
             if (GetIter (out iter, path)) {
                 return GetSource (iter);
             }

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView_DragAndDrop.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView_DragAndDrop.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView_DragAndDrop.cs	Thu May 29 04:21:47 2008
@@ -76,7 +76,10 @@
             TreeViewDropPosition pos;
             Source active_source = ServiceManager.SourceManager.ActiveSource;
             
-            if (!GetDestRowAtPos (x, y, out path, out pos)) {
+            if (active_source.SupportedMergeTypes == SourceMergeType.None) {
+                Gdk.Drag.Status (context, 0, time);
+                return false;
+            } else if (!GetDestRowAtPos (x, y, out path, out pos)) {
                 Gdk.Drag.Status (context, 0, time);
                 return false;
             }
@@ -90,8 +93,8 @@
             else if ((Allocation.Height - y) < 20)
                 Vadjustment.Value += 30;
 
-            if (parent_source != null) {
-                ShowNewPlaylistUnder (parent_source);
+            if (parent_source != null && parent_source.AcceptsInputFromSource (active_source)) {
+                ShowNewPlaylistUnder (parent_source, active_source);
             } else if (drop_source != NewPlaylistSource) {
                 HideNewPlaylistRow ();
             }
@@ -111,7 +114,7 @@
 
         Source new_playlist_parent = null;
         bool parent_was_expanded;
-        private void ShowNewPlaylistUnder (Source parent)
+        private void ShowNewPlaylistUnder (Source parent, Source active)
         {
             if (new_playlist_visible) {
                 if (parent == new_playlist_parent)
@@ -120,6 +123,12 @@
                     HideNewPlaylistRow ();
             }
 
+            NewPlaylistSource.SetParentSource (parent);
+            if (!NewPlaylistSource.AcceptsInputFromSource (active)) {
+                NewPlaylistSource.SetParentSource (new_playlist_parent);
+                return;
+            }
+
             TreeIter parent_iter = store.FindSource (parent);
             new_playlist_iter = store.AppendNode (parent_iter);
             
@@ -160,14 +169,17 @@
             TreeViewDropPosition pos;
             GetDragDestRow (out path, out pos);
 
-            if (path == null) {
+            if (path == null && !TreeIter.Zero.Equals (new_playlist_iter)) {
                 path = store.GetPath (new_playlist_iter);
             }
             
-            final_drag_source = store.GetSource (path);
+            if (path != null) {
+                final_drag_source = store.GetSource (path);
+            }
+
             final_drag_start_time = context.StartTime;
-        
             HideNewPlaylistRow ();
+            SetDragDestRow (null, TreeViewDropPosition.Before);
         }
         
         protected override void OnDragBegin (Gdk.DragContext context)
@@ -177,6 +189,12 @@
             }
         }
 
+        protected override void OnDragEnd (Gdk.DragContext context)
+        {
+            base.OnDragEnd (context);
+            SetDragDestRow (null, TreeViewDropPosition.Before);
+        }
+
         protected override void OnDragDataReceived (Gdk.DragContext context, int x, int y,
             Gtk.SelectionData selectionData, uint info, uint time)
         {

Modified: trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/MediaGroupSource.cs
==============================================================================
--- trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/MediaGroupSource.cs	(original)
+++ trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/MediaGroupSource.cs	Thu May 29 04:21:47 2008
@@ -53,6 +53,11 @@
             base.AfterInitialized ();
             Reload ();
         }
+
+        /*public override bool AcceptsInputFromSource (Source source)
+        {
+            return (source is DatabaseSource) && source.Parent != Parent && source != Parent;
+        }*/
         
         public override string ConditionSql {
             get { return base.ConditionSql; }

Modified: trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/RemovableSource.cs
==============================================================================
--- trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/RemovableSource.cs	(original)
+++ trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/RemovableSource.cs	Thu May 29 04:21:47 2008
@@ -115,6 +115,11 @@
             return true;
         }
 
+        public override bool AcceptsInputFromSource (Source source)
+        {
+            return (source is DatabaseSource) && this != source.Parent;
+        }
+
         private bool syncing = false;
         public bool CanUnmap {
             get { return !syncing; }

Modified: trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/ColumnCellPodcastStatusIndicator.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/ColumnCellPodcastStatusIndicator.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/ColumnCellPodcastStatusIndicator.cs	Thu May 29 04:21:47 2008
@@ -59,7 +59,7 @@
             // Downloading
             Pixbufs[base.PixbufCount + 0] = IconThemeUtils.LoadIcon (PixbufSize, "document-save", "go-bottom");
             
-            // Podcast is New
+            // Podcast is Downloaded
             Pixbufs[base.PixbufCount + 1] = IconThemeUtils.LoadIcon (PixbufSize, "podcast-new");
         }
         
@@ -74,8 +74,8 @@
                 case PodcastItemActivity.Downloading:
                 case PodcastItemActivity.DownloadPending: 
                     return base.PixbufCount + 0;
-                default: 
-                    return podcast.IsNew ? base.PixbufCount + 1 : -1;
+                default:
+                    return podcast.IsDownloaded ? base.PixbufCount + 1 : -1;
             }
         }
         

Modified: trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastItemView.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastItemView.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastItemView.cs	Thu May 29 04:21:47 2008
@@ -65,7 +65,7 @@
                 return;
             }
             
-            text_cell.Opacity = podcast.IsDownloaded ? 1.0 : 0.5;
+            text_cell.Opacity = podcast.IsNew ? 1.0 : 0.5;
         }
     }
     /*public class PodcastItemView : ListView<TrackInfo>



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