Пример #1
0
        protected override void Initialize()
        {
            PurgeTemporaryPlaylists();

            base.Initialize();

            Expanded = true;
            Properties.SetStringList("Icon.Name", GetIconNames());
            Properties.Set <string> ("SourcePropertiesActionLabel", Catalog.GetString("Device Properties"));
            Properties.Set <OpenPropertiesDelegate> ("SourceProperties.GuiHandler", delegate {
                new DapPropertiesDialog(this).RunDialog();
            });

            Properties.Set <bool> ("Nereid.SourceContents.HeaderVisible", false);
            Properties.Set <bool> ("Nereid.SourceContents.FooterVisible", false);
            Properties.Set <System.Reflection.Assembly> ("ActiveSourceUIResource.Assembly", System.Reflection.Assembly.GetExecutingAssembly());
            Properties.SetString("ActiveSourceUIResource", "ActiveSourceUI.xml");

            sync = new DapSync(this);

            if (String.IsNullOrEmpty(GenericName))
            {
                GenericName = Catalog.GetString("Media Player");
            }

            if (String.IsNullOrEmpty(Name))
            {
                Name = device.Name;
            }

            AddDapProperty(Catalog.GetString("Product"), device.Product);
            AddDapProperty(Catalog.GetString("Vendor"), device.Vendor);

            if (acceptable_mimetypes == null)
            {
                acceptable_mimetypes = HasMediaCapabilities ? MediaCapabilities.PlaybackMimeTypes : null;
                if (acceptable_mimetypes == null || acceptable_mimetypes.Length == 0)
                {
                    acceptable_mimetypes = new string [] { "taglib/mp3" };
                }
            }

            AddChildSource(music_group_source = music_group_source ?? new MusicGroupSource(this));
            // We want the group sources to be on top of the list, with Music first
            music_group_source.Order = -30;

            if (SupportsPodcasts && null == podcast_group_source)
            {
                podcast_group_source       = new PodcastGroupSource(this);
                podcast_group_source.Order = -10;
            }

            BuildPreferences();

            Properties.Set <Gtk.Widget> ("Nereid.SourceContents.FooterWidget", dap_info_bar = dap_info_bar ?? new DapInfoBar(this));
            Properties.Set <Banshee.Sources.Gui.ISourceContents> ("Nereid.SourceContents", dap_properties_display = dap_properties_display ?? new DapContent(this));
        }
Пример #2
0
        protected override void Initialize()
        {
            PurgeTemporaryPlaylists ();

            base.Initialize ();

            Expanded = true;
            Properties.SetStringList ("Icon.Name", GetIconNames ());
            Properties.Set<string> ("SourcePropertiesActionLabel", Catalog.GetString ("Device Properties"));
            Properties.Set<OpenPropertiesDelegate> ("SourceProperties.GuiHandler", delegate {
                new DapPropertiesDialog (this).RunDialog ();
            });

            Properties.Set<bool> ("Nereid.SourceContents.HeaderVisible", false);
            Properties.Set<System.Reflection.Assembly> ("ActiveSourceUIResource.Assembly", System.Reflection.Assembly.GetExecutingAssembly ());
            Properties.SetString ("ActiveSourceUIResource", "ActiveSourceUI.xml");

            sync = new DapSync (this);

            /*dap_properties_display = new DapPropertiesDisplay (this);
            Properties.Set<Banshee.Sources.Gui.ISourceContents> ("Nereid.SourceContents", dap_properties_display);*/

            if (String.IsNullOrEmpty (GenericName)) {
                GenericName = Catalog.GetString ("Media Player");
            }

            if (String.IsNullOrEmpty (Name)) {
                Name = device.Name;
            }

            AddDapProperty (Catalog.GetString ("Product"), device.Product);
            AddDapProperty (Catalog.GetString ("Vendor"), device.Vendor);

            if (acceptable_mimetypes == null) {
                acceptable_mimetypes = HasMediaCapabilities ? MediaCapabilities.PlaybackMimeTypes : null;
                if (acceptable_mimetypes == null || acceptable_mimetypes.Length == 0) {
                    acceptable_mimetypes = new string [] { "taglib/mp3" };
                }
            }

            AddChildSource (music_group_source = new MusicGroupSource (this));
            // We want the group sources to be on top of the list, with Music first
            music_group_source.Order = -30;

            if (SupportsVideo) {
                video_group_source = new VideoGroupSource (this);
                video_group_source.Order = -20;
            }

            if (SupportsPodcasts) {
                podcast_group_source = new PodcastGroupSource (this);
                podcast_group_source.Order = -10;
            }

            BuildPreferences ();

            ThreadAssist.ProxyToMain (delegate {
                dap_info_bar = new DapInfoBar (this);
                Properties.Set<Gtk.Widget> ("Nereid.SourceContents.FooterWidget", dap_info_bar);

                Properties.Set<Banshee.Sources.Gui.ISourceContents> ("Nereid.SourceContents", new DapContent (this));
            });
        }