Esempio n. 1
0
 private void RaiseTorrentLost(RssFilter filter, RssItem item)
 {
     if (TorrentLost != null)
     {
         TorrentLost(this, new TorrentRssWatcherEventArgs(filter, item));
     }
 }
        private void RenderItem(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            RssItem item = (RssItem)model.GetValue(iter, 0);

            if (item != null)
            {
                (cell as Gtk.CellRendererText).Text = item.Title;
            }
        }
Esempio n. 3
0
        private void ParseDocument()
        {
            XmlNode rssNode;

            XmlElement root = document.DocumentElement;

            if (!(root.Name == "rss"))
            {
                return;
            }

            rssNode     = root;
            channelNode = null;

            foreach (XmlNode childNode in rssNode.ChildNodes)
            {
                if (childNode.Name == "channel")
                {
                    channelNode = childNode;
                }
            }

            foreach (XmlNode childNode in channelNode.ChildNodes)
            {
                RssItem rssItem = new RssItem();

                rssItem.Feed = uri;

                foreach (XmlNode childNodeNode in childNode.ChildNodes)
                {
                    if (childNodeNode.Name == "title")
                    {
                        rssItem.Title = childNodeNode.InnerText;
                    }
                    if (childNodeNode.Name == "link")
                    {
                        rssItem.Link = childNodeNode.InnerText;
                    }
                    if (childNodeNode.Name == "pubDate")
                    {
                        rssItem.Pubdate = childNodeNode.InnerText;
                    }
                    if (childNodeNode.Name == "description")
                    {
                        rssItem.Pubdate = childNodeNode.InnerText;
                    }
                }

                if (rssItem.Link != string.Empty)
                {
                    items.Add(rssItem);
                }
            }
        }
        private bool FilterItemTree(TreeModel model, TreeIter iter)
        {
            RssItem item = (RssItem)model.GetValue(iter, 0);

            if (item == null)
            {
                return(false);
            }

            if (item.Feed == feedCombobox.ActiveText || feedCombobox.ActiveText == "All")
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 5
0
		private void ParseDocument()
		{
			XmlNode rssNode;
			
			XmlElement root = document.DocumentElement;
			
			if(!(root.Name == "rss"))
				return;
				
			rssNode = root;
			channelNode = null;
			
			foreach (XmlNode childNode in rssNode.ChildNodes){
				if(childNode.Name == "channel")
					channelNode = childNode;
			}
						
			foreach(XmlNode childNode in channelNode.ChildNodes){
				RssItem rssItem = new RssItem();
				
				rssItem.Feed = uri;
				
				foreach(XmlNode childNodeNode in childNode.ChildNodes){
					if(childNodeNode.Name == "title")
						rssItem.Title = childNodeNode.InnerText;
					if(childNodeNode.Name == "link")
						rssItem.Link = childNodeNode.InnerText;
					if(childNodeNode.Name == "pubDate")
						rssItem.Pubdate = childNodeNode.InnerText;
					if(childNodeNode.Name == "description")
						rssItem.Pubdate = childNodeNode.InnerText;
				}
				
				if(rssItem.Link != string.Empty)
					items.Add(rssItem);
			}
			
		}
Esempio n. 6
0
        // FIXME: Adding torrents not on the main loop, will throw up!
        // Solutions: Pop every add onto main loop resulting in blocking
        // or add async Load(uri, location) to library, or let the GUI
        // program handle downloading the torrent file
        public void AddTorrent(RssItem item, RssFilter filter)
        {
            history.Add(item);
            historyListStore.AppendValues(item);

            if (filter == null)
            {
                Console.Out.WriteLine("About to add with default savepath, URL: " + item.Link);
                try {
                    controller.addTorrent(item.Link, true, false, false, null, controller.engine.Settings.SavePath, true);
                } catch {
                    logger.Error("RSS Manager: Unable to add - " + item.Title);
                }
            }
            else
            {
                Console.Out.WriteLine("About to add with custom savepath, Path: " + filter.SavePath);
                try{
                    controller.addTorrent(item.Link, true, false, false, null, filter.SavePath, true);
                } catch {
                    logger.Error("RSS Manager: Unabled to add - " + item.Title);
                }
            }
        }
		private void AddTorrent(RssItem item)
		{
			controller.AddTorrent(item, null);
		}
		public TorrentRssWatcherEventArgs(RssFilter matchedFilter, RssItem item) : base(item.Link)
		{
			this.matchedFilter = matchedFilter;
			this.item = item;
		}
		private void RaiseTorrentLost(RssFilter filter, RssItem item)
		{
			if(TorrentLost != null)
				TorrentLost(this, new TorrentRssWatcherEventArgs(filter, item));
		}
 public TorrentRssWatcherEventArgs(RssFilter matchedFilter, RssItem item) : base(item.Link)
 {
     this.matchedFilter = matchedFilter;
     this.item          = item;
 }
		// FIXME: Adding torrents not on the main loop, will throw up!
		// Solutions: Pop every add onto main loop resulting in blocking
		// or add async Load(uri, location) to library, or let the GUI
		// program handle downloading the torrent file 
		public void AddTorrent(RssItem item, RssFilter filter)
		{
			history.Add(item);
			historyListStore.AppendValues(item);
			
			if(filter == null){
				Console.Out.WriteLine("About to add with default savepath, URL: " + item.Link);
				try {
					controller.addTorrent(item.Link, true, false, false, null, controller.engine.Settings.SavePath, true);
				} catch {
					logger.Error("RSS Manager: Unable to add - " + item.Title);
				}
			}
			else {
				Console.Out.WriteLine("About to add with custom savepath, Path: " + filter.SavePath);
				try{
					controller.addTorrent(item.Link, true, false, false, null, filter.SavePath, true);
				} catch {
					logger.Error("RSS Manager: Unabled to add - " + item.Title);
				}
			}
		}
Esempio n. 12
0
 private void AddTorrent(RssItem item)
 {
     controller.AddTorrent(item, null);
 }