Наследование: Banshee.Library.LibrarySource
        public PodcastFeedPropertiesDialog (PodcastSource source, Feed feed)
        {
            this.source = source;
            this.feed = feed;

            Title = feed.Title;
            //IconThemeUtils.SetWindowIcon (this);

            BuildWindow ();
        }
        public PodcastFeedPropertiesDialog(PodcastSource source, Feed feed)
        {
            this.source     = source;
            this.feed       = feed;
            fake_track.Feed = feed;

            Title        = feed.Title;
            BorderWidth  = 12;
            WidthRequest = 525;
            //IconThemeUtils.SetWindowIcon (this);

            BuildWindow();

            DefaultResponse   = Gtk.ResponseType.Cancel;
            ActionArea.Layout = Gtk.ButtonBoxStyle.End;

            Response += OnResponse;

            ShowAll();
        }
Пример #3
0
        public PodcastFeedPropertiesDialog(PodcastSource source, Feed feed)
        {
            this.source = source;
            this.feed = feed;
            fake_track.Feed = feed;

            Title = feed.Title;
            BorderWidth = 12;
            WidthRequest = 525;
            //IconThemeUtils.SetWindowIcon (this);

            BuildWindow ();

            DefaultResponse = Gtk.ResponseType.Cancel;
            ActionArea.Layout = Gtk.ButtonBoxStyle.End;

            Response += OnResponse;

            ShowAll ();
        }
Пример #4
0
 public void SetLibrary (PodcastSource library)
 {
     SetModel (library.TrackModel);
 }
Пример #5
0
        public PodcastActions(PodcastSource source)
            : base(ServiceManager.Get<InterfaceActionService> (), "Podcast")
        {
            this.podcast_source = source;
            ImportantByDefault = false;

            Add (
                new ActionEntry (
                    "PodcastUpdateAllAction", Stock.Refresh,
                     Catalog.GetString ("Refresh"), null,//"<control><shift>U",
                     Catalog.GetString ("Check all podcasts for new episodes"),
                     OnPodcastUpdateAll
                ),
                new ActionEntry (
                    "PodcastAddAction", Stock.Add,
                     Catalog.GetString ("Add Podcast..."),"<control><shift>F",
                     Catalog.GetString ("Subscribe to a new podcast"),
                     OnPodcastAdd
                )
            );

            Add (
                new ActionEntry("PodcastFeedPopupAction", null,
                    String.Empty, null, null, OnFeedPopup),

                new ActionEntry("EpisodePodcastMenu", null,
                    Catalog.GetString ("Podcast"), null, null, null),

                new ActionEntry (
                    "PodcastDeleteAction", Stock.Delete,
                     Catalog.GetString ("Unsubscribe and Delete"),
                     null, String.Empty,
                     OnPodcastDelete
                ),
                new ActionEntry (
                    "PodcastUpdateFeedAction", Stock.Refresh,
                     Catalog.GetString ("Check for New Episodes"),
                     null, String.Empty,
                     OnPodcastUpdate
                ),
                new ActionEntry (
                    "PodcastDownloadAllAction", Stock.Save,
                     Catalog.GetString ("Download All Episodes"),
                     null, String.Empty,
                     OnPodcastDownloadAllEpisodes
                ),
                new ActionEntry (
                    "PodcastHomepageAction", Stock.JumpTo,
                     Catalog.GetString ("Visit Podcast Homepage"),
                     null, String.Empty,
                     OnPodcastHomepage
                ),
                new ActionEntry (
                    "PodcastPropertiesAction", Stock.Properties,
                     Catalog.GetString ("Properties"),
                     null, String.Empty,
                     OnPodcastProperties
                ),
                new ActionEntry (
                    "EpisodePodcastProperties", null,
                     Catalog.GetString ("Podcast Properties"), null, String.Empty,
                     OnEpisodePodcastProperties
                ),
                new ActionEntry (
                    "PodcastItemMarkNewAction", null,
                     Catalog.GetString ("Mark as New"),
                     null, String.Empty,
                     OnPodcastItemMarkNew
                ),
                new ActionEntry (
                    "PodcastItemMarkOldAction", null,
                     Catalog.GetString ("Archive"), "y", String.Empty,
                     OnPodcastItemMarkOld
                ),
                new ActionEntry (
                    "PodcastItemDownloadAction", Stock.Save,
                     /* Translators: this is a verb used as a button name, not a noun*/
                     Catalog.GetString ("Download"),
                     "<control><shift>D", String.Empty,
                     OnPodcastItemDownload
                ),
                new ActionEntry (
                    "PodcastItemCancelAction", Stock.Cancel,
                     Catalog.GetString ("Cancel Download"),
                     "<control><shift>C", String.Empty,
                     OnPodcastItemCancel
                ),
                new ActionEntry (
                    "PodcastItemDeleteFileAction", Stock.Remove,
                     "",
                     null, String.Empty,
                     OnPodcastItemDeleteFile
                ),
                new ActionEntry (
                    "PodcastItemLinkAction", Stock.JumpTo,
                     Catalog.GetString ("Visit Website"),
                     null, String.Empty,
                     OnPodcastItemLink
                ),
                new ActionEntry (
                    "PodcastItemPropertiesAction", Stock.Properties,
                     Catalog.GetString ("Properties"),
                     null, String.Empty,
                     OnPodcastItemProperties
                )
            );

            this["PodcastAddAction"].ShortLabel = Catalog.GetString ("Add Podcast");

            actions_id = Actions.UIManager.AddUiFromResource ("GlobalUI.xml");
            Actions.AddActionGroup (this);

            ServiceManager.SourceManager.ActiveSourceChanged += HandleActiveSourceChanged;
            OnSelectionChanged (null, null);
        }
        public PodcastActions(PodcastSource source) : base(ServiceManager.Get <InterfaceActionService> (), "Podcast")
        {
            this.podcast_source = source;
            ImportantByDefault  = false;

            Add(
                new ActionEntry(
                    "PodcastUpdateAllAction", Stock.Refresh,
                    Catalog.GetString("Refresh"), null,  //"<control><shift>U",
                    Catalog.GetString("Check all podcasts for new episodes"),
                    OnPodcastUpdateAll
                    ),
                new ActionEntry(
                    "PodcastAddAction", Stock.Add,
                    Catalog.GetString("Add Podcast..."), "<control><shift>F",
                    Catalog.GetString("Subscribe to a new podcast"),
                    OnPodcastAdd
                    )
                );

            Add(
                new ActionEntry("PodcastFeedPopupAction", null,
                                String.Empty, null, null, OnFeedPopup),

                new ActionEntry("EpisodePodcastMenu", null,
                                Catalog.GetString("Podcast"), null, null, null),

                new ActionEntry(
                    "PodcastDeleteAction", Stock.Delete,
                    Catalog.GetString("Unsubscribe and Delete"),
                    null, String.Empty,
                    OnPodcastDelete
                    ),
                new ActionEntry(
                    "PodcastUpdateFeedAction", Stock.Refresh,
                    Catalog.GetString("Check for New Episodes"),
                    null, String.Empty,
                    OnPodcastUpdate
                    ),
                new ActionEntry(
                    "PodcastDownloadAllAction", Stock.Save,
                    Catalog.GetString("Download All Episodes"),
                    null, String.Empty,
                    OnPodcastDownloadAllEpisodes
                    ),
                new ActionEntry(
                    "PodcastHomepageAction", Stock.JumpTo,
                    Catalog.GetString("Visit Podcast Homepage"),
                    null, String.Empty,
                    OnPodcastHomepage
                    ),
                new ActionEntry(
                    "PodcastPropertiesAction", Stock.Properties,
                    Catalog.GetString("Properties"),
                    null, String.Empty,
                    OnPodcastProperties
                    ),
                new ActionEntry(
                    "EpisodePodcastProperties", null,
                    Catalog.GetString("Podcast Properties"), null, String.Empty,
                    OnEpisodePodcastProperties
                    ),
                new ActionEntry(
                    "PodcastItemMarkNewAction", null,
                    Catalog.GetString("Mark as New"),
                    null, String.Empty,
                    OnPodcastItemMarkNew
                    ),
                new ActionEntry(
                    "PodcastItemMarkOldAction", null,
                    Catalog.GetString("Archive"), "y", String.Empty,
                    OnPodcastItemMarkOld
                    ),
                new ActionEntry(
                    "PodcastItemDownloadAction", Stock.Save,
                    /* Translators: this is a verb used as a button name, not a noun*/
                    Catalog.GetString("Download"),
                    "<control><shift>D", String.Empty,
                    OnPodcastItemDownload
                    ),
                new ActionEntry(
                    "PodcastItemCancelAction", Stock.Cancel,
                    Catalog.GetString("Cancel Download"),
                    "<control><shift>C", String.Empty,
                    OnPodcastItemCancel
                    ),
                new ActionEntry(
                    "PodcastItemDeleteFileAction", Stock.Remove,
                    "",
                    null, String.Empty,
                    OnPodcastItemDeleteFile
                    ),
                new ActionEntry(
                    "PodcastItemLinkAction", Stock.JumpTo,
                    Catalog.GetString("Visit Website"),
                    null, String.Empty,
                    OnPodcastItemLink
                    ),
                new ActionEntry(
                    "PodcastItemPropertiesAction", Stock.Properties,
                    Catalog.GetString("Properties"),
                    null, String.Empty,
                    OnPodcastItemProperties
                    )
                );

            this["PodcastAddAction"].ShortLabel = Catalog.GetString("Add Podcast");

            actions_id = Actions.UIManager.AddUiFromResource("GlobalUI.xml");
            Actions.AddActionGroup(this);

            ServiceManager.SourceManager.ActiveSourceChanged += HandleActiveSourceChanged;
            OnSelectionChanged(null, null);
        }
Пример #7
0
        public void DelayedInitialize ()
        {
            download_manager = new DownloadManager (2, tmp_download_path);
            download_manager_iface = new DownloadManagerInterface (download_manager);
            download_manager_iface.Initialize ();

            feeds_manager = new FeedsManager (ServiceManager.DbConnection, download_manager, null);

            // Migrate data from 0.13.2 podcast tables, if they exist
            MigrateLegacyIfNeeded ();

            // Move incomplete downloads to the new cache location
            try {
                MigrateDownloadCache ();
            } catch (Exception e) {
                Hyena.Log.Exception ("Couldn't migrate podcast download cache", e);
            }

            source = new PodcastSource ();
            ServiceManager.SourceManager.AddSource (source);

            InitializeInterface ();

            ThreadAssist.SpawnFromMain (delegate {
                feeds_manager.PodcastStorageDirectory = source.BaseDirectory;
                feeds_manager.FeedManager.ItemAdded += OnItemAdded;
                feeds_manager.FeedManager.ItemChanged += OnItemChanged;
                feeds_manager.FeedManager.ItemRemoved += OnItemRemoved;
                feeds_manager.FeedManager.FeedsChanged += OnFeedsChanged;

                if (DatabaseConfigurationClient.Client.Get<int> ("Podcast", "Version", 0) < 7) {
                    Banshee.Library.LibrarySource music_lib = ServiceManager.SourceManager.MusicLibrary;
                    if (music_lib != null) {
                        string old_path = Path.Combine (music_lib.BaseDirectory, "Podcasts");
                        string new_path = source.BaseDirectory;
                        SafeUri old_uri = new SafeUri (old_path);
                        SafeUri new_uri = new SafeUri (new_path);
                        if (old_path != null && new_path != null && old_path != new_path &&
                            Banshee.IO.Directory.Exists (old_path) && !Banshee.IO.Directory.Exists (new_path)) {
                            Banshee.IO.Directory.Move (new SafeUri (old_path), new SafeUri (new_path));
                            ServiceManager.DbConnection.Execute (String.Format (
                                "UPDATE {0} SET LocalPath = REPLACE(LocalPath, ?, ?) WHERE LocalPath IS NOT NULL",
                                FeedEnclosure.Provider.TableName), old_path, new_path);
                            ServiceManager.DbConnection.Execute (
                                "UPDATE CoreTracks SET Uri = REPLACE(Uri, ?, ?) WHERE Uri LIKE 'file://%' AND PrimarySourceId = ?",
                                old_uri.AbsoluteUri, new_uri.AbsoluteUri, source.DbId);
                            Hyena.Log.DebugFormat ("Moved Podcasts from {0} to {1}", old_path, new_path);
                        }
                    }
                    DatabaseConfigurationClient.Client.Set<int> ("Podcast", "Version", 7);
                }

                ServiceManager.PlayerEngine.ConnectEvent (OnPlayerEvent, PlayerEvent.StateChange);
                ServiceManager.Get<DBusCommandService> ().ArgumentPushed += OnCommandLineArgument;

                RefreshFeeds ();

                // Every 10 minutes try to refresh again
                refresh_timeout_id = Application.RunTimeout (1000 * 60 * 10, RefreshFeeds);

                ServiceManager.Get<Network> ().StateChanged += OnNetworkStateChanged;
            });

            source.UpdateFeedMessages ();
        }
Пример #8
0
 public void SetLibrary(PodcastSource library)
 {
     SetModel(library.TrackModel);
 }
Пример #9
0
 public PodcastImportManager(PodcastSource source)
     : base(source)
 {
     ForceCopy = false;
 }