public PodcastFeedView(PodcastFeedModel model)
        {
            if (model == null)
            {
                throw new ArgumentNullException ("model");
            }

            RulesHint = true;
            Selection.Mode = SelectionMode.Single;

            this.model = model;
            this.model.FeedAdded += OnModelPodcastFeedAdded;

            feed_title_column = new TreeViewColumn();
            feed_activity_column = new TreeViewColumn();

            feed_activity_column.Expand = false;
            feed_activity_column.Resizable = false;
            feed_activity_column.Clickable = false;
            feed_activity_column.Reorderable = true;
            feed_activity_column.Visible = true;
            feed_activity_column.MinWidth = 32;

            feed_title_column.Title = Catalog.GetString ("Feeds");
            feed_title_column.Expand = true;
            feed_title_column.Resizable = false;
            feed_title_column.Clickable = false;
            feed_title_column.Reorderable = true;
            feed_title_column.Visible = true;
            feed_title_column.Spacing = 24;

            CellRendererText feed_title_renderer = new CellRendererText();
            CellRendererText feed_status_renderer = new CellRendererText();
            CellRendererPixbuf feed_activity_renderer = new CellRendererPixbuf();

            feed_activity_column.PackStart (feed_activity_renderer, true);
            feed_activity_column.SetCellDataFunc(feed_activity_renderer,
                                                 new TreeCellDataFunc(TrackCellPodcastFeedActivity));

            feed_title_column.PackStart (feed_status_renderer, false);
            feed_title_column.SetCellDataFunc(feed_status_renderer,
                                              new TreeCellDataFunc(TrackCellPodcastFeedStatus));

            feed_title_column.PackStart(feed_title_renderer, true);
            feed_title_column.SetCellDataFunc(feed_title_renderer,
                                              new TreeCellDataFunc(TrackCellPodcastFeedTitle));

            this.model.DefaultSortFunc = PodcastFeedTitleTreeIterCompareFunc;

            this.model.SetSortFunc((int)Column.Title,
                                   new TreeIterCompareFunc(PodcastFeedTitleTreeIterCompareFunc));

            Model = this.model;

            this.model.SetSortColumnId ((int) Column.Title, SortType.Ascending);

            InsertColumn (feed_title_column, (int)Column.Title);
            InsertColumn (feed_activity_column, (int)Column.Activity);
        }
Пример #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();
        }
        public PodcastFeedView(PodcastFeedModel model)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

            RulesHint      = true;
            Selection.Mode = SelectionMode.Single;

            this.model            = model;
            this.model.FeedAdded += OnModelPodcastFeedAdded;

            feed_title_column    = new TreeViewColumn();
            feed_activity_column = new TreeViewColumn();

            feed_activity_column.Expand      = false;
            feed_activity_column.Resizable   = false;
            feed_activity_column.Clickable   = false;
            feed_activity_column.Reorderable = true;
            feed_activity_column.Visible     = true;
            feed_activity_column.MinWidth    = 32;

            feed_title_column.Title       = Catalog.GetString("Feeds");
            feed_title_column.Expand      = true;
            feed_title_column.Resizable   = false;
            feed_title_column.Clickable   = false;
            feed_title_column.Reorderable = true;
            feed_title_column.Visible     = true;
            feed_title_column.Spacing     = 24;

            CellRendererText   feed_title_renderer    = new CellRendererText();
            CellRendererText   feed_status_renderer   = new CellRendererText();
            CellRendererPixbuf feed_activity_renderer = new CellRendererPixbuf();

            feed_activity_column.PackStart(feed_activity_renderer, true);
            feed_activity_column.SetCellDataFunc(feed_activity_renderer,
                                                 new TreeCellDataFunc(TrackCellPodcastFeedActivity));

            feed_title_column.PackStart(feed_status_renderer, false);
            feed_title_column.SetCellDataFunc(feed_status_renderer,
                                              new TreeCellDataFunc(TrackCellPodcastFeedStatus));

            feed_title_column.PackStart(feed_title_renderer, true);
            feed_title_column.SetCellDataFunc(feed_title_renderer,
                                              new TreeCellDataFunc(TrackCellPodcastFeedTitle));

            this.model.DefaultSortFunc = PodcastFeedTitleTreeIterCompareFunc;

            this.model.SetSortFunc((int)Column.Title,
                                   new TreeIterCompareFunc(PodcastFeedTitleTreeIterCompareFunc));

            Model = this.model;

            this.model.SetSortColumnId((int)Column.Title, SortType.Ascending);

            InsertColumn(feed_title_column, (int)Column.Title);
            InsertColumn(feed_activity_column, (int)Column.Activity);
        }
Пример #4
0
        private void DestroyView()
        {
            viewWidget = null;

            if (podcast_view != null)
            {
                podcast_view.Shutdown();
            }

            podcast_view  = null;
            podcast_model = null;

            podcast_feed_view  = null;
            podcast_feed_model = null;

            feed_view_popup_menu = null;
        }
        private void DestroyView()
        {
            viewWidget = null;

            if (podcast_view != null)
            {
                podcast_view.Shutdown ();
            }

            podcast_view = null;
            podcast_model = null;

            podcast_feed_view = null;
            podcast_feed_model = null;

            feed_view_popup_menu = null;
        }
        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 ();
        }