[banshee/1.5.1-fixes: 6/56] Recognize publicdomain CC URLs



commit 202756d8f4157f824deb66a2fc365445314c58a4
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Tue Oct 13 16:26:59 2009 -0700

    Recognize publicdomain CC URLs

 .../ColumnCellCreativeCommons.cs                   |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellCreativeCommons.cs b/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellCreativeCommons.cs
index fb3f3cb..19bf494 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellCreativeCommons.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellCreativeCommons.cs
@@ -45,8 +45,8 @@ namespace Banshee.Collection.Gui
     public class ColumnCellCreativeCommons : ColumnCell, ISizeRequestCell, ITooltipCell
     {
         private static Gdk.Pixbuf [] pixbufs;
-        private static string [] attributes = new string [] {"by", "nc", "nd", "sa", "pd"};
-        private static string [] attributes_uc = new string [] {"BY", "NC", "ND", "SA", "PD"};
+        private static string [] attributes = new string [] {"by", "nc", "nd", "sa", "pd", "publicdomain"};
+        private static string [] attributes_uc = new string [] {"BY", "NC", "ND", "SA", "PD", "Public Domain"};
         private const string CC_ID = "creativecommons.org/licenses/";
         private static int CC_ID_LEN = CC_ID.Length;
         private const int ICON_SIZE = 16;
@@ -100,9 +100,12 @@ namespace Banshee.Collection.Gui
                 pixbufs = new Gdk.Pixbuf[attributes.Length];
             }
             
-            for (int i = 0; i < attributes.Length; i++) {
+            for (int i = 0; i < attributes.Length - 1; i++) {
                 pixbufs[i] = IconThemeUtils.LoadIcon (ICON_SIZE, String.Format ("creative-commons-{0}", attributes[i]));
             }
+
+            // HACK to enable 'publicdomain' to work
+            pixbufs[attributes.Length - 1] = pixbufs[attributes.Length - 2];
         }
 
         private IEnumerable<int> AttributesForBoundObject {
@@ -134,7 +137,8 @@ namespace Banshee.Collection.Gui
 
         public void GetWidthRange (Pango.Layout layout, out int min, out int max)
         {
-            min = max = ICON_SIZE * attributes.Length;
+            // -1 b/c of 2 public domain entries
+            min = max = ICON_SIZE * attributes.Length - 1;
         }
     }
 }



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