Example #1
0
        private void PodcastAddedOrRemoved(PodcastEventArgs args, bool added)
        {
            if (args.Podcast != null)
            {
                PodcastInfo pi = args.Podcast;
                if (added)
                {
                    podcast_model.QueueAdd(pi);
                }
                else
                {
                    podcast_model.QueueRemove(pi);
                }
            }
            else if (args.Podcasts != null)
            {
                ICollection podcasts = args.Podcasts;

                if (added)
                {
                    podcast_model.QueueAdd(podcasts);
                }
                else
                {
                    podcast_model.QueueRemove(podcasts);
                }
            }

            Update();
        }
Example #2
0
        private void BuildView()
        {
            podcast_view_scroller = new ScrolledWindow();

            podcast_view_scroller.ShadowType       = ShadowType.In;
            podcast_view_scroller.VscrollbarPolicy = PolicyType.Automatic;
            podcast_view_scroller.HscrollbarPolicy = PolicyType.Automatic;

            podcast_feed_view_scroller = new ScrolledWindow();

            podcast_feed_view_scroller.ShadowType       = ShadowType.In;
            podcast_feed_view_scroller.VscrollbarPolicy = PolicyType.Automatic;
            podcast_feed_view_scroller.HscrollbarPolicy = PolicyType.Automatic;

            podcast_model      = new PodcastPlaylistModel();
            podcast_feed_model = new PodcastFeedModel();

            podcast_model.ClearModel();
            podcast_feed_model.ClearModel();

            podcast_model.QueueAdd(PodcastCore.Library.Podcasts);
            podcast_feed_model.QueueAdd(PodcastCore.Library.Feeds);

            podcast_view = new PodcastPlaylistView(podcast_model);
            podcast_view.ButtonPressEvent += OnPlaylistViewButtonPressEvent;

            podcast_feed_view = new PodcastFeedView(podcast_feed_model);
            podcast_feed_view.Selection.Changed += OnFeedViewSelectionChanged;
            podcast_feed_view.ButtonPressEvent  += OnPodcastFeedViewButtonPressEvent;
            podcast_feed_view.SelectAll         += OnSelectAllHandler;

            podcast_view_scroller.Add(podcast_view);
            podcast_feed_view_scroller.Add(podcast_feed_view);

            feed_info_pane = new HPaned();
            feed_info_pane.Add1(podcast_feed_view_scroller);
            // -- later-- feed_info_pane.Add2 ();

            feed_playlist_pane = new VPaned();
            feed_playlist_pane.Add1(feed_info_pane);
            feed_playlist_pane.Add2(podcast_view_scroller);

            try
            {
                feed_playlist_pane.Position =
                    GConfSchemas.PlaylistSeparatorPositionSchema.Get();
            }
            catch {
                feed_playlist_pane.Position = 300;
                GConfSchemas.PlaylistSeparatorPositionSchema.Set(
                    feed_playlist_pane.Position
                    );
            }

            update_button = new ActionButton(Globals.ActionManager ["PodcastUpdateFeedsAction"]);
            viewWidget    = feed_playlist_pane;

            viewWidget.ShowAll();
        }
        private void BuildView()
        {
            podcast_view_scroller = new ScrolledWindow();

            podcast_view_scroller.ShadowType = ShadowType.In;
            podcast_view_scroller.VscrollbarPolicy = PolicyType.Automatic;
            podcast_view_scroller.HscrollbarPolicy = PolicyType.Automatic;

            podcast_feed_view_scroller = new ScrolledWindow();

            podcast_feed_view_scroller.ShadowType = ShadowType.In;
            podcast_feed_view_scroller.VscrollbarPolicy = PolicyType.Automatic;
            podcast_feed_view_scroller.HscrollbarPolicy = PolicyType.Automatic;

            podcast_model = new PodcastPlaylistModel ();
            podcast_feed_model = new PodcastFeedModel ();

            podcast_model.ClearModel ();
            podcast_feed_model.ClearModel ();

            podcast_model.QueueAdd (PodcastCore.Library.Podcasts);
            podcast_feed_model.QueueAdd (PodcastCore.Library.Feeds);

            podcast_view = new PodcastPlaylistView (podcast_model);
            podcast_view.ButtonPressEvent += OnPlaylistViewButtonPressEvent;

            podcast_feed_view = new PodcastFeedView (podcast_feed_model);
            podcast_feed_view.Selection.Changed += OnFeedViewSelectionChanged;
            podcast_feed_view.ButtonPressEvent += OnPodcastFeedViewButtonPressEvent;
            podcast_feed_view.SelectAll += OnSelectAllHandler;

            podcast_view_scroller.Add (podcast_view);
            podcast_feed_view_scroller.Add (podcast_feed_view);

            feed_info_pane = new HPaned ();
            feed_info_pane.Add1 (podcast_feed_view_scroller);
            // -- later-- feed_info_pane.Add2 ();

            feed_playlist_pane = new VPaned ();
            feed_playlist_pane.Add1 (feed_info_pane);
            feed_playlist_pane.Add2 (podcast_view_scroller);

            try
            {
                feed_playlist_pane.Position =
                    GConfSchemas.PlaylistSeparatorPositionSchema.Get ();
            }
            catch {
                feed_playlist_pane.Position = 300;
                GConfSchemas.PlaylistSeparatorPositionSchema.Set (
                    feed_playlist_pane.Position
                );
            }

            update_button = new ActionButton (Globals.ActionManager ["PodcastUpdateFeedsAction"]);
            viewWidget = feed_playlist_pane;

            viewWidget.ShowAll ();
        }