[banshee/extension-prefs] [Prefs] AddinView code tweaks



commit 52c3d40730391f11cd94054518af72f67c3412c2
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Thu Dec 17 17:56:37 2009 -0800

    [Prefs] AddinView code tweaks

 .../Banshee.Addins.Gui/AddinView.cs                |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Addins.Gui/AddinView.cs b/src/Core/Banshee.ThickClient/Banshee.Addins.Gui/AddinView.cs
index 5590e6e..44ac603 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Addins.Gui/AddinView.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Addins.Gui/AddinView.cs
@@ -90,10 +90,10 @@ namespace Banshee.Addins.Gui
             };
 
             var txt_cell = new CellRendererText () { WrapMode = Pango.WrapMode.Word };
-            tree_view.AppendColumn ("Name", txt_cell , "markup", 2);
+            tree_view.AppendColumn ("Name", txt_cell , "markup", Columns.Name);
 
             var check_cell = new CellRendererToggle () { Activatable = true };
-            tree_view.AppendColumn ("Enable", check_cell, "visible", 0, "active", 1);
+            tree_view.AppendColumn ("Enable", check_cell, "visible", Columns.IsAddin, "active", Columns.IsEnabled);
             check_cell.Toggled += (o, a) => {
                 TreeIter iter;
                 if (model.GetIter (out iter, new TreePath (a.Path))) {
@@ -149,6 +149,12 @@ namespace Banshee.Addins.Gui
             txt_cell.WrapWidth = 300;
         }
 
+        private enum Columns : int {
+            IsAddin,
+            IsEnabled,
+            Name,
+            Addin
+        };
     }
 
     internal static class AddinExtensions
@@ -156,6 +162,9 @@ namespace Banshee.Addins.Gui
         public static IEnumerable<Addin> Matching (this IEnumerable<Addin> addins, string search)
         {
             search = StringUtil.SearchKey (search);
+            if (String.IsNullOrEmpty (search)) {
+                return addins;
+            }
 
             return addins.Where (a => { return
                 StringUtil.SearchKey (a.Name).Contains (search) ||



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