Пример #1
0
        public PodcastFeedInfo(int id, string feedUrl, bool subscribed, SyncPreference sync)
        {
            feed_id         = id;
            feed_url        = new Uri(feedUrl);
            this.subscribed = subscribed;
            sync_preference = sync;

            podcasts = new ArrayList();
        }
Пример #2
0
 public PodcastFeedInfo(int id, string title, string feedUrl, string link,
                        string description, string image, DateTime lastUpdate, bool subscribed,
                        SyncPreference sync)
     : this(id, feedUrl, subscribed, sync)
 {
     this.title       = title;
     this.description = description;
     this.link        = link;
     this.image       = image;
     this.lastUpdate  = lastUpdate;
 }
 public SyncPreferenceComboBox(SyncPreference syncPref) : base(combo_text_entries)
 {
     if ((int)syncPref >= (int)SyncPreference.All &&
         (int)syncPref <= (int)SyncPreference.None)
     {
         Active = (int)syncPref;
     }
     else
     {
         Active = (int)SyncPreference.One;
     }
 }
        internal static void RunSubscribeDialog()
        {
            PodcastSubscribeDialog subscribe_dialog = new PodcastSubscribeDialog();

            ResponseType response = (ResponseType)subscribe_dialog.Run();

            subscribe_dialog.Destroy();

            if (response == ResponseType.Ok)
            {
                Uri feedUri = null;

                if (subscribe_dialog.Url == String.Empty)
                {
                    return;
                }

                string         url  = subscribe_dialog.Url.Trim('/').Trim();
                SyncPreference sync = subscribe_dialog.SyncPreference;

                try
                {
                    // CreateUri should be in PodcastFeedInfo
                    feedUri = PodcastFeedFetcher.CreateUri(url);
                    SubscribeToPodcastFeed(feedUri.ToString(), sync);
                }
                catch (NotSupportedException)
                {
                    HigMessageDialog.RunHigMessageDialog(
                        null,
                        DialogFlags.Modal,
                        MessageType.Warning,
                        ButtonsType.Ok,
                        Catalog.GetString("Uri Scheme Not Supported"),
                        Catalog.GetString("Podcast feed URI scheme is not supported.")
                        );

                    return;
                }
                catch {
                    HigMessageDialog.RunHigMessageDialog(
                        null,
                        DialogFlags.Modal,
                        MessageType.Warning,
                        ButtonsType.Ok,
                        Catalog.GetString("Invalid URL"),
                        Catalog.GetString("Podcast feed URL is invalid.")
                        );

                    return;
                }
            }
        }
        internal static void SubscribeToPodcastFeed(string uri, SyncPreference sync)
        {
            PodcastFeedInfo feed = new PodcastFeedInfo(uri, sync);

            feed.UpdateFinished += InitialFeedUpdateHandler;

            if (feed != null)
            {
                ThreadAssist.Spawn(delegate {
                    FeedFetcher.Update(feed, true);
                });
            }
        }
 public SyncPreferenceComboBox(SyncPreference syncPref)
     : base(combo_text_entries)
 {
     if ((int) syncPref >= (int) SyncPreference.All &&
             (int) syncPref <= (int) SyncPreference.None)
     {
         Active = (int) syncPref;
     }
     else
     {
         Active = (int) SyncPreference.One;
     }
 }
        private void OnResponse(object sender, ResponseArgs args)
        {
            Destroy();

            if (args.ResponseId == Gtk.ResponseType.Ok)
            {
                SyncPreference new_sync_pref = new_episode_option_combo.ActiveSyncPreference;

                if (feed.SyncPreference != new_sync_pref)
                {
                    feed.SyncPreference = new_sync_pref;
                    feed.Commit();

                    if (new_sync_pref != SyncPreference.None &&
                        feed.IsSubscribed)
                    {
                        PodcastCore.FeedFetcher.Update(feed);
                    }
                }
            }

            (sender as Dialog).Response -= OnResponse;
            (sender as Dialog).Destroy();
        }
Пример #8
0
 public PodcastFeedInfo(string url, SyncPreference sync)
     : this(0, url, true, sync)
 {
 }
        internal static void SubscribeToPodcastFeed(string uri, SyncPreference sync)
        {
            PodcastFeedInfo feed = new PodcastFeedInfo (uri, sync);

            feed.UpdateFinished += InitialFeedUpdateHandler;

            if (feed != null)
            {
                ThreadAssist.Spawn ( delegate {
                                         FeedFetcher.Update (feed, true);
                                     });
            }
        }
 public PodcastFeedInfo(string url, SyncPreference sync)
     : this(0, url, true, sync)
 {
 }
 public PodcastFeedInfo(int id, string title, string feedUrl, string link,
                         string description, string image, DateTime lastUpdate, bool subscribed,
                         SyncPreference sync)
     : this(id, feedUrl, subscribed, sync)
 {
     this.title = title;
     this.description = description;
     this.link = link;
     this.image = image;
     this.lastUpdate = lastUpdate;
 }
        public PodcastFeedInfo(int id, string feedUrl, bool subscribed, SyncPreference sync)
        {
            feed_id = id;
            feed_url = new Uri (feedUrl);
            this.subscribed = subscribed;
            sync_preference = sync;

            podcasts = new ArrayList ();
        }