[banshee] [Podcasting] Add back podcast browser



commit 91dce3d1c12bea0e7c88c47793ce5f688021d481
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Tue Nov 23 14:27:55 2010 -0600

    [Podcasting] Add back podcast browser

 .../DownloadStatusFilterModel.cs                   |   95 --------------
 .../Banshee.Podcasting.Data/PodcastSource.cs       |   10 +--
 .../PodcastUnheardFilterModel.cs                   |    6 +-
 .../ColumnCellDownloadStatus.cs                    |   64 ---------
 .../Banshee.Podcasting.Gui/ColumnCellUnheard.cs    |    1 -
 .../DownloadStatusFilterView.cs                    |   59 ---------
 .../Banshee.Podcasting.Gui/GridContent.cs          |  101 --------------
 .../Banshee.Podcasting.Gui/HeaderWidget.cs         |  138 --------------------
 .../Banshee.Podcasting.Gui/PodcastFeedView.cs      |   85 +------------
 .../PodcastSourceContents.cs                       |   16 +--
 src/Extensions/Banshee.Podcasting/Makefile.am      |    7 +-
 .../Resources/ActiveSourceUI.xml                   |    4 +-
 12 files changed, 16 insertions(+), 570 deletions(-)
---
diff --git a/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastSource.cs b/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastSource.cs
index b3f029a..2f8b9c8 100644
--- a/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastSource.cs
+++ b/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastSource.cs
@@ -60,7 +60,6 @@ namespace Banshee.Podcasting.Gui
     {
         private PodcastFeedModel feed_model;
         private PodcastUnheardFilterModel new_filter;
-        private DownloadStatusFilterModel downloaded_filter;
 
         public override string DefaultBaseDirectory {
             get {
@@ -94,7 +93,6 @@ namespace Banshee.Podcasting.Gui
         }
 
         public PodcastUnheardFilterModel NewFilter { get { return new_filter; } }
-        public DownloadStatusFilterModel DownloadedFilter { get { return downloaded_filter; } }
 
         public override string PreferencesPageId {
             get { return UniqueId; }
@@ -227,15 +225,10 @@ namespace Banshee.Podcasting.Gui
 
             Properties.SetString ("GtkActionPath", "/PodcastSourcePopup");
 
-            //Properties.Set<ISourceContents> ("Nereid.SourceContents", new LazyLoadSourceContents<PodcastSourceContents> ());
-            Properties.Set<ISourceContents> ("Nereid.SourceContents", new LazyLoadSourceContents<GridContent> ());
+            Properties.Set<ISourceContents> ("Nereid.SourceContents", new LazyLoadSourceContents<PodcastSourceContents> ());
             Properties.Set<bool> ("Nereid.SourceContentsPropagate", true);
             Properties.Set<bool> ("SourceView.HideCount", false);
 
-            var header_widget = new HeaderWidget (this);
-            header_widget.ShowAll ();
-            Properties.Set<Gtk.Widget> ("Nereid.SourceContents.HeaderWidget", header_widget);
-
             Properties.SetString ("TrackView.ColumnControllerXml", String.Format (@"
                     <column-controller>
                       <add-all-defaults />
@@ -328,7 +321,6 @@ namespace Banshee.Podcasting.Gui
         {
             PodcastFeedModel feed_model;
             yield return new_filter = new PodcastUnheardFilterModel (src.DatabaseTrackModel);
-            yield return downloaded_filter = new DownloadStatusFilterModel (src.DatabaseTrackModel);
             yield return feed_model = new PodcastFeedModel (src, src.DatabaseTrackModel, ServiceManager.DbConnection, String.Format ("PodcastFeeds-{0}", src.UniqueId));
 
             if (src == this) {
diff --git a/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastUnheardFilterModel.cs b/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastUnheardFilterModel.cs
index 895c9c2..15cf6dd 100644
--- a/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastUnheardFilterModel.cs
+++ b/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastUnheardFilterModel.cs
@@ -44,8 +44,7 @@ namespace Banshee.Podcasting.Gui
     public enum OldNewFilter
     {
         Both,
-        New,
-        Old
+        New
     }
 
     public class PodcastUnheardFilterModel : FilterListModel<OldNewFilter>
@@ -71,7 +70,6 @@ namespace Banshee.Podcasting.Gui
             get {
                 switch (index) {
                     case 1:    return OldNewFilter.New;
-                    case 2:    return OldNewFilter.Old;
                     case 0:
                     default:   return OldNewFilter.Both;
                 }
@@ -79,7 +77,7 @@ namespace Banshee.Podcasting.Gui
         }
 
         public override int Count {
-            get { return 3; }
+            get { return 2; }
         }
 
         public override string GetSqlFilter ()
diff --git a/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/ColumnCellUnheard.cs b/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/ColumnCellUnheard.cs
index 2c41d64..5e0055c 100644
--- a/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/ColumnCellUnheard.cs
+++ b/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/ColumnCellUnheard.cs
@@ -56,7 +56,6 @@ namespace Banshee.Podcasting.Gui
             switch (val) {
                 case OldNewFilter.New:    return Catalog.GetString ("New Items");
                 case OldNewFilter.Both:   return Catalog.GetString ("All Items");
-                case OldNewFilter.Old:    return Catalog.GetString ("Old Items");
             }
             return String.Empty;
         }
diff --git a/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastFeedView.cs b/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastFeedView.cs
index d9414a0..f98ee22 100644
--- a/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastFeedView.cs
+++ b/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastFeedView.cs
@@ -49,14 +49,12 @@ namespace Banshee.Podcasting.Gui
 {
     public class PodcastFeedView : TrackFilterListView<Feed>
     {
-        private ColumnCellPodcast renderer;
+        private ColumnCellText renderer;
 
         public PodcastFeedView () : base ()
         {
-            renderer = new ColumnCellPodcast ();
-            column_controller.Add (new Column ("Podcast", renderer, 1.0));
-            //column_controller.Add (new Column (null, "Activity", new FeedActivityColumnCell ("Activity"), 0.00, true, 26, 26));
-
+            renderer = new ColumnCellText ("Title", true);
+            column_controller.Add (new Column ("Title", renderer, 1.0));
             ColumnController = column_controller;
         }
 
@@ -65,82 +63,5 @@ namespace Banshee.Podcasting.Gui
             ServiceManager.Get<InterfaceActionService> ().FindAction ("Podcast.PodcastFeedPopupAction").Activate ();
             return true;
         }
-
-        protected override Gdk.Size OnMeasureChild ()
-        {
-            return ViewLayout != null
-                ? base.OnMeasureChild ()
-                : new Gdk.Size (0, renderer.ComputeRowHeight (this));
-        }
     }
-
-    /*public class PodcastFeedView : ListView<Feed>
-    {
-        private ColumnController columnController;
-
-        public PodcastFeedView () : base ()
-        {
-            columnController = new ColumnController ();
-
-            SortableColumn podcastFeedTitleColumn = new SortableColumn (
-                    Catalog.GetString ("Podcasts"),
-                    new ColumnCellText ("Title", true), 0.97,
-                    PodcastSortKeys.Title, true
-            );
-
-            columnController.AddRange (
-                new Column (null, "Activity", new FeedActivityColumnCell ("Activity"), 0.00, true, 26, 26),
-                podcastFeedTitleColumn
-            );
-
-            RulesHint = true;
-            podcastFeedTitleColumn.SortType = Hyena.Data.SortType.Descending;
-            columnController.DefaultSortColumn = podcastFeedTitleColumn;
-            ColumnController = columnController;
-        }
-
-        private Menu allPopup;
-        private Menu popupMenu;
-        private MenuItem homepageItem;
-        private MenuItem propertiesItem;
-        private MenuItem updateAllItem;
-
-        protected override bool OnPopupMenu ()
-        {
-            if (popupMenu == null) {
-                UIManager uiManager = ServiceManager.Get<InterfaceActionService> ().UIManager;
-
-                allPopup = uiManager.GetWidget ("/PodcastSourcePopup") as Menu;
-                popupMenu = uiManager.GetWidget ("/PodcastFeedViewPopup") as Menu;
-
-                updateAllItem = uiManager.GetWidget ("/PodcastFeedViewPopup/PodcastUpdateAll") as MenuItem;
-                propertiesItem = uiManager.GetWidget ("/PodcastFeedViewPopup/PodcastProperties") as MenuItem;
-                homepageItem = uiManager.GetWidget ("/PodcastFeedViewPopup/PodcastHomepage") as MenuItem;
-            }
-
-            Menu popup;
-            PodcastFeedModel model = Model as PodcastFeedModel;
-
-            ReadOnlyCollection<Feed> feeds = model.CopySelectedItems ();
-
-            if (feeds.Count == 0) {
-                popup = allPopup;
-            } else {
-                if (feeds.Count > 1) {
-                    homepageItem.Hide ();
-                    propertiesItem.Hide ();
-                } else {
-                    homepageItem.Show ();
-                    propertiesItem.Show ();
-                }
-
-                popup = popupMenu;
-            }
-
-            updateAllItem.Hide ();
-
-            popup.Popup (null, null, null, 0, Gtk.Global.CurrentEventTime);
-            return true;
-        }
-    }*/
 }
diff --git a/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastSourceContents.cs b/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastSourceContents.cs
index 813b44d..d0dd457 100644
--- a/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastSourceContents.cs
+++ b/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastSourceContents.cs
@@ -53,10 +53,9 @@ namespace Banshee.Podcasting.Gui
 {
     public class PodcastSourceContents : FilteredListSourceContents, ITrackModelSourceContents
     {
-        private TrackListView track_view;
+        private Grid track_view;
         private PodcastFeedView feed_view;
         private PodcastUnheardFilterView unheard_view;
-        private DownloadStatusFilterView download_view;
 
         public PodcastSourceContents () : base ("podcast")
         {
@@ -64,9 +63,8 @@ namespace Banshee.Podcasting.Gui
 
         protected override void InitializeViews ()
         {
-            SetupMainView (track_view = new TrackListView ());
+            SetupMainView (track_view = new Grid ());
             SetupFilterView (unheard_view = new PodcastUnheardFilterView ());
-            SetupFilterView (download_view = new DownloadStatusFilterView ());
             SetupFilterView (feed_view = new PodcastFeedView ());
         }
 
@@ -75,7 +73,6 @@ namespace Banshee.Podcasting.Gui
             if (feed_view.Model != null) {
                 feed_view.Selection.Clear ();
                 unheard_view.Selection.Clear ();
-                download_view.Selection.Clear ();
             }
         }
 
@@ -86,6 +83,10 @@ namespace Banshee.Podcasting.Gui
             }
         }
 
+        protected override string ForcePosition {
+            get { return "Left"; }
+        }
+
         #region Implement ISourceContents
 
         public override bool SetSource (ISource source)
@@ -105,8 +106,6 @@ namespace Banshee.Podcasting.Gui
                     SetModel (feed_view, (model as IListModel<Feed>));
                 else if (model is PodcastUnheardFilterModel)
                     SetModel (unheard_view, (model as IListModel<OldNewFilter>));
-                else if (model is DownloadStatusFilterModel)
-                    SetModel (download_view, (model as IListModel<DownloadedStatusFilter>));
                 else
                     Hyena.Log.DebugFormat ("PodcastContents got non-feed filter model: {0}", model);
             }
@@ -122,7 +121,6 @@ namespace Banshee.Podcasting.Gui
             source = null;
             SetModel (track_view, null);
             SetModel (unheard_view, null);
-            SetModel (download_view, null);
             SetModel (feed_view, null);
             track_view.HeaderVisible = false;
             //Console.WriteLine ("PSC.reset_source 2");
@@ -142,4 +140,4 @@ namespace Banshee.Podcasting.Gui
             "plugins.podcasting", "vpaned_position", 120, "VPaned Position", ""
         );
     }
-}
\ No newline at end of file
+}
diff --git a/src/Extensions/Banshee.Podcasting/Makefile.am b/src/Extensions/Banshee.Podcasting/Makefile.am
index 3bb4a77..e2add12 100644
--- a/src/Extensions/Banshee.Podcasting/Makefile.am
+++ b/src/Extensions/Banshee.Podcasting/Makefile.am
@@ -4,13 +4,11 @@ LINK = $(REF_EXTENSION_PODCASTING)
 INSTALL_DIR = $(EXTENSIONS_INSTALL_DIR)
 
 SOURCES =  \
-	Banshee.Podcasting.Data/DownloadStatusFilterModel.cs \
 	Banshee.Podcasting.Data/PodcastFeedModel.cs \
 	Banshee.Podcasting.Data/PodcastSource.cs \
 	Banshee.Podcasting.Data/PodcastTrackInfo.cs \
 	Banshee.Podcasting.Data/PodcastTrackListModel.cs \
 	Banshee.Podcasting.Data/PodcastUnheardFilterModel.cs \
-	Banshee.Podcasting.Gui/ColumnCellDownloadStatus.cs \
 	Banshee.Podcasting.Gui/ColumnCellPodcast.cs \
 	Banshee.Podcasting.Gui/ColumnCellPodcastStatusIndicator.cs \
 	Banshee.Podcasting.Gui/ColumnCellPublished.cs \
@@ -18,10 +16,7 @@ SOURCES =  \
 	Banshee.Podcasting.Gui/ColumnCellYesNo.cs \
 	Banshee.Podcasting.Gui/DownloadManager/DownloadManagerInterface.cs \
 	Banshee.Podcasting.Gui/DownloadManager/DownloadUserJob.cs \
-	Banshee.Podcasting.Gui/DownloadStatusFilterView.cs \
 	Banshee.Podcasting.Gui/Grid.cs \
-	Banshee.Podcasting.Gui/GridContent.cs \
-	Banshee.Podcasting.Gui/HeaderWidget.cs \
 	Banshee.Podcasting.Gui/Models/FilterableListModel.cs \
 	Banshee.Podcasting.Gui/Models/ListModel.cs \
 	Banshee.Podcasting.Gui/PodcastActions.cs \
@@ -32,8 +27,8 @@ SOURCES =  \
 	Banshee.Podcasting.Gui/PodcastManager/Dialog/PodcastPropertiesDialog.cs \
 	Banshee.Podcasting.Gui/PodcastManager/Dialog/PodcastSubscribeDialog.cs \
 	Banshee.Podcasting.Gui/PodcastManager/Dialog/SyncPreferenceComboBox.cs \
-	Banshee.Podcasting.Gui/PodcastSourceContents.cs \
 	Banshee.Podcasting.Gui/PodcastUnheardFilterView.cs \
+	Banshee.Podcasting.Gui/PodcastSourceContents.cs \
 	Banshee.Podcasting/ItmsPodcast.cs \
 	Banshee.Podcasting/PodcastImageFetchJob.cs \
 	Banshee.Podcasting/PodcastImportManager.cs \
diff --git a/src/Extensions/Banshee.Podcasting/Resources/ActiveSourceUI.xml b/src/Extensions/Banshee.Podcasting/Resources/ActiveSourceUI.xml
index 8037c88..33a47ea 100644
--- a/src/Extensions/Banshee.Podcasting/Resources/ActiveSourceUI.xml
+++ b/src/Extensions/Banshee.Podcasting/Resources/ActiveSourceUI.xml
@@ -39,14 +39,14 @@
         <menuitem name="PodcastItemDeleteFile" action="PodcastItemDeleteFileAction" />
         <separator />
         <menuitem name="PodcastItemLink" action="PodcastItemLinkAction" />
-        <menu action="EpisodePodcastMenu">
+        <!--<menu action="EpisodePodcastMenu">
             <menuitem name="PodcastUpdateFeed" action="PodcastUpdateFeedAction" />
             <menuitem name="PodcastDownloadAll" action="PodcastDownloadAllAction"/>
             <menuitem name="PodcastHomepage" action="PodcastHomepageAction" />
             <menuitem name="PodcastDelete" action="PodcastDeleteAction" />
             <separator />
             <menuitem name="PodcastProperties" action="PodcastPropertiesAction" />
-        </menu>
+        </menu>-->
         <!--
         <menuitem name="PodcastItemCancel" action="PodcastItemCancelAction" />-->
     </placeholder>



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