Esempio n. 1
0
 private void RaiseTorrentLost(RssFilter filter, RssItem item)
 {
     if (TorrentLost != null)
     {
         TorrentLost(this, new TorrentRssWatcherEventArgs(filter, item));
     }
 }
Esempio n. 2
0
 public void RemoveFilter(RssFilter filter)
 {
     if (Filters.Contains(filter))
     {
         Filters.Remove(filter);
         RefreshWatchers();
     }
 }
Esempio n. 3
0
 public void AddFilter(RssFilter filter)
 {
     if (!Filters.Contains(filter))
     {
         Filters.Add(filter);
         RefreshWatchers();
     }
 }
        protected virtual void OnAddFilterButtonClicked(object sender, System.EventArgs e)
        {
            RssFilter filter = new RssFilter();

            filter.SavePath = controller.TorrentController.engine.Settings.SavePath;
            filterListStore.AppendValues(filter);
            controller.AddFilter(filter);
            //controller.Filters.Add(filter);
        }
        protected virtual void OnRemoveFilterButtonClicked(object sender, System.EventArgs e)
        {
            TreeIter iter;

            if (!filterTreeView.Selection.GetSelected(out iter))
            {
                return;
            }

            RssFilter filter = (RssFilter)filterTreeView.Model.GetValue(iter, 0);

            controller.RemoveFilter(filter);
            filterListStore.Remove(ref iter);
            logger.Debug("Removed row from ListStore");
        }
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);
                }
            }
        }
		protected virtual void OnAddFilterButtonClicked (object sender, System.EventArgs e)
		{
			RssFilter filter = new RssFilter();
			filter.SavePath = controller.TorrentController.engine.Settings.SavePath;
			filterListStore.AppendValues(filter);
			controller.AddFilter(filter);
			//controller.Filters.Add(filter);
			
		}
		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;
 }
		public void RemoveFilter(RssFilter filter){
			if(Filters.Contains(filter)){
				Filters.Remove(filter);
				RefreshWatchers();
			}
		}
		public void AddFilter(RssFilter filter){
			if(!Filters.Contains(filter)){
				Filters.Add(filter);
				RefreshWatchers();
			}
		}
		// 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. 14
0
        private void RenderFilter(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            RssFilter filter = (RssFilter)model.GetValue(iter, 0);

            (cell as Gtk.CellRendererText).Text = filter.Name;
        }