Ejemplo n.º 1
0
        private void BuildViews()
        {
            VBox source_box = new VBox();

            source_box.PackStart(new UserJobTileHost(), false, false, 0);

            view_container = new ViewContainer();
            composite_view = new LtrTrackSourceContents();
            composite_view.TrackView.HeaderVisible = false;
            view_container.Content = composite_view;
            view_container.Show();

            view_box = new Alignment(0.0f, 0.0f, 1.0f, 1.0f);
            view_box.Add(view_container);
            view_box.ShowAll();

            primary_vbox.PackStart(view_box, true, true, 0);
        }
Ejemplo n.º 2
0
        private void UpdateSourceContents(Source source)
        {
            if (source == null)
            {
                return;
            }

            // Connect the source models to the views if possible
            ISourceContents contents = source.GetProperty <ISourceContents> ("Nereid.SourceContents",
                                                                             source.GetInheritedProperty <bool> ("Nereid.SourceContentsPropagate"));

            bool remove_margins = false;

            view_container.ClearFooter();

            if (contents != null)
            {
                if (view_container.Content != contents)
                {
                    view_container.Content = contents;
                }
                view_container.Content.SetSource(source);
                view_container.Show();

                remove_margins = contents is Cubano.NowPlaying.NowPlayingInterface ||
                                 contents.GetType().FullName == "Banshee.NowPlaying.NowPlayingInterface";
            }
            else if (source is ITrackModelSource)
            {
                view_container.Content = composite_view;
                view_container.Content.SetSource(source);
                view_container.Show();
            }
            else if (source is Hyena.Data.IObjectListModel)
            {
                if (object_view == null)
                {
                    object_view = new ObjectListSourceContents();
                }

                view_container.Content = object_view;
                view_container.Content.SetSource(source);
                view_container.Show();
            }
            else
            {
                view_container.Hide();
            }

            // Associate the view with the model
            if (view_container.Visible && view_container.Content is ITrackModelSourceContents)
            {
                ITrackModelSourceContents track_content = view_container.Content as ITrackModelSourceContents;
                source.Properties.Set <IListView <TrackInfo> >  ("Track.IListView", track_content.TrackView);
            }

            header.Visible = source.Properties.Contains("Nereid.SourceContents.HeaderVisible") ?
                             source.Properties.Get <bool> ("Nereid.SourceContents.HeaderVisible") : true;

            Widget footer_widget = null;

            if (source.Properties.Contains("Nereid.SourceContents.FooterWidget"))
            {
                footer_widget = source.Properties.Get <Widget> ("Nereid.SourceContents.FooterWidget");
            }

            if (footer_widget != null)
            {
                view_container.SetFooter(footer_widget);
            }

            ConfigureMargins(remove_margins);
        }
Ejemplo n.º 3
0
        private void BuildViews()
        {
            VBox source_box = new VBox ();
            source_box.PackStart (new UserJobTileHost (), false, false, 0);

            view_container = new ViewContainer ();
            composite_view = new LtrTrackSourceContents ();
            composite_view.TrackView.HeaderVisible = false;
            view_container.Content = composite_view;
            view_container.Show ();

            view_box = new Alignment (0.0f, 0.0f, 1.0f, 1.0f);
            view_box.Add (view_container);
            view_box.ShowAll ();

            primary_vbox.PackStart (view_box, true, true, 0);
        }