banshee r4170 - in trunk/banshee: . src/Core/Banshee.Services/Banshee.Collection.Database src/Core/Banshee.ThickClient/Banshee.Collection.Gui src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea



Author: gburt
Date: Thu Jun 19 15:35:59 2008
New Revision: 4170
URL: http://svn.gnome.org/viewvc/banshee?rev=4170&view=rev

Log:
2008-06-19  Gabriel Burt  <gabriel burt gmail com>

	* src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs:
	* src/Core/Banshee.ThickClient/Banshee.Collection.Gui/DefaultColumnController.cs:
	* src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs:
	Fix misleading API, where setting the Rating on a DatabaseTrackInfo would
	automatically save.  Now if you want that behavior, use the SavedRating
	property.  This is the property now bound to the ListView, for example.


Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/DefaultColumnController.cs
   trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs	Thu Jun 19 15:35:59 2008
@@ -426,6 +426,11 @@
         protected int rating;
         public override int Rating {
             get { return rating; }
+            set { rating = value; }
+        }
+
+        public int SavedRating {
+            get { return rating; }
             set {
                 if (rating != value) {
                     rating = value;
@@ -491,7 +496,7 @@
                 Uri = PrimarySource.UriAndTypeToSafeUri (UriType, UriField);
             }
         }
-        
+
         public void CopyToLibraryIfAppropriate (bool force_copy)
         {
             SafeUri old_uri = this.Uri;

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/DefaultColumnController.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/DefaultColumnController.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/DefaultColumnController.cs	Thu Jun 19 15:35:59 2008
@@ -167,7 +167,7 @@
         }
         
         private SortableColumn rating_column = new SortableColumn (Catalog.GetString ("Rating"),
-            new ColumnCellRating ("Rating", true), 0.15, "Rating", false);
+            new ColumnCellRating ("SavedRating", true), 0.15, "Rating", false);
         public SortableColumn RatingColumn {
             get { return rating_column; }
         }

Modified: trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs	Thu Jun 19 15:35:59 2008
@@ -340,8 +340,16 @@
         
         private void OnRatingChanged (object o, EventArgs args)
         {
-            if (ServiceManager.PlayerEngine.CurrentTrack != null) {
-                ServiceManager.PlayerEngine.CurrentTrack.Rating = rating_menu_item.Value;
+            TrackInfo track = ServiceManager.PlayerEngine.CurrentTrack;
+            if (track != null) {
+                DatabaseTrackInfo db_track = track as DatabaseTrackInfo;
+                if (db_track != null) {
+                    db_track.SavedRating = rating_menu_item.Value;
+                } else {
+                    track.Rating = rating_menu_item.Value;
+                    track.Save ();
+                }
+
                 ServiceManager.PlayerEngine.TrackInfoUpdated ();
             }
         }



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