banshee r3132 - in branches/banshee/stable: . src/Core/Banshee.Base/Dap src/Dap/Banshee.Dap.Mtp src/Plugins/Banshee.Plugins.Podcast/UI



Author: gburt
Date: Fri Feb  1 19:54:35 2008
New Revision: 3132
URL: http://svn.gnome.org/viewvc/banshee?rev=3132&view=rev

Log:
2008-02-01  Gabriel Burt  <gabriel burt gmail com>

	* src/Plugins/Banshee.Plugins.Podcast/UI/PodcastSubscribeDialog.cs: Make
	"Advanced" string translatable.  Fixes BNC #265687.


Modified:
   branches/banshee/stable/ChangeLog
   branches/banshee/stable/src/Core/Banshee.Base/Dap/Dap.cs
   branches/banshee/stable/src/Dap/Banshee.Dap.Mtp/MtpDap.cs
   branches/banshee/stable/src/Dap/Banshee.Dap.Mtp/MtpDapTrackInfo.cs
   branches/banshee/stable/src/Plugins/Banshee.Plugins.Podcast/UI/PodcastSubscribeDialog.cs

Modified: branches/banshee/stable/src/Core/Banshee.Base/Dap/Dap.cs
==============================================================================
--- branches/banshee/stable/src/Core/Banshee.Base/Dap/Dap.cs	(original)
+++ branches/banshee/stable/src/Core/Banshee.Base/Dap/Dap.cs	Fri Feb  1 19:54:35 2008
@@ -705,7 +705,7 @@
                 return uuid;
             }
         }
-        
+
         public abstract void Synchronize();
         public abstract string Name { get; }
         public abstract ulong StorageCapacity { get; }

Modified: branches/banshee/stable/src/Dap/Banshee.Dap.Mtp/MtpDap.cs
==============================================================================
--- branches/banshee/stable/src/Dap/Banshee.Dap.Mtp/MtpDap.cs	(original)
+++ branches/banshee/stable/src/Dap/Banshee.Dap.Mtp/MtpDap.cs	Fri Feb  1 19:54:35 2008
@@ -575,11 +575,48 @@
 			Import (tracks, null);
 		}
 
-        string icon_name = "multimedia-player-dell-pocket-dj";
-		public override Gdk.Pixbuf GetIcon (int size)
+        private Dictionary<int, Gdk.Pixbuf> icon_cache = new Dictionary<int, Gdk.Pixbuf>(2);
+        const string icon_prefix = "multimedia-player-";
+        public override Gdk.Pixbuf GetIcon (int size)
         {
-            return IconThemeUtils.HasIcon (icon_name) ? IconThemeUtils.LoadIcon (icon_name, size) : base.GetIcon (size);
-		}
+            if (icon_cache.ContainsKey(size))
+                return icon_cache[size];
+
+            Gdk.Pixbuf icon = null;
+            string icon_id = IconId;
+
+            Console.WriteLine ("have icon id = {0}, getting size = {1}", icon_id, size);
+
+            if (icon_id != null && IconThemeUtils.HasIcon (icon_prefix + icon_id))
+                icon = IconThemeUtils.LoadIcon (icon_prefix + icon_id, size);
+            else
+                icon = base.GetIcon (size);
+
+            icon_cache.Add(size, icon);
+            return icon;
+        }
+
+        private string icon_id = null;
+        public string IconId {
+            get {
+                if (icon_id == null) {
+                    string product = hal_device.Parent["info.product"];
+                    string vendor = hal_device.Parent["info.vendor"];
+                    // Hack to get around Creative devices having Creative in the product name already
+                    if (vendor.Contains ("Creative")) {
+                        vendor = null;
+                    }
+                    if (vendor != null && vendor != String.Empty && product != null && product != String.Empty)
+                        icon_id = (vendor.Trim () + "-" + product.Trim ()).Replace (' ', '-').ToLower ();
+                    else if (product != null && product != String.Empty)
+                        icon_id = (product.Trim ()).Replace (' ', '-').ToLower ();
+                }
+
+                return icon_id;
+            }
+        }
+        
+
 /*
 		public DapPlaylistSource AddPlaylist (Source playlist)
 		{

Modified: branches/banshee/stable/src/Dap/Banshee.Dap.Mtp/MtpDapTrackInfo.cs
==============================================================================
--- branches/banshee/stable/src/Dap/Banshee.Dap.Mtp/MtpDapTrackInfo.cs	(original)
+++ branches/banshee/stable/src/Dap/Banshee.Dap.Mtp/MtpDapTrackInfo.cs	Fri Feb  1 19:54:35 2008
@@ -68,7 +68,10 @@
             NeedSync = false;
 
 			// Set a URI even though it's not actually accessible through normal API's.
-			uri = new SafeUri(String.Format ("mtp://{0}", file.Filename));
+			//uri = new SafeUri(String.Format ("mtp://{0}", file.Filename));
+            Uri = new SafeUri (
+                Globals.Library.CachedLocation + Path.DirectorySeparatorChar + FileNamePattern.CreateFromTrackInfo(this)
+            );
         }
         
         public override bool Equals (object o)

Modified: branches/banshee/stable/src/Plugins/Banshee.Plugins.Podcast/UI/PodcastSubscribeDialog.cs
==============================================================================
--- branches/banshee/stable/src/Plugins/Banshee.Plugins.Podcast/UI/PodcastSubscribeDialog.cs	(original)
+++ branches/banshee/stable/src/Plugins/Banshee.Plugins.Podcast/UI/PodcastSubscribeDialog.cs	Fri Feb  1 19:54:35 2008
@@ -85,7 +85,7 @@
             message.Justify = Justification.Left;
             message.SetAlignment (0.0f, 0.0f);
 
-            Expander advanced_expander = new Expander ("Advanced");
+            Expander advanced_expander = new Expander (Catalog.GetString ("Advanced"));
 
             VBox expander_children = new VBox();
             expander_children.BorderWidth = 6;



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