Ejemplo n.º 1
0
		public DruidStoragePage()
		{
			this.Build();
			
			torrentButton = new FileChooserButton("Select torrent storage directory...", FileChooserAction.SelectFolder);
			dataButton = new FileChooserButton("Select default download directory...", FileChooserAction.SelectFolder);
			
			torrentButton.ShowAll();
			dataButton.ShowAll();
			
			storageTable.Attach(dataButton, 1, 2, 0, 1, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
			storageTable.Attach(torrentButton, 1, 2, 1, 2, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
			
			torrentButton.SetCurrentFolder(System.IO.Path.Combine(System.IO.Path.Combine(Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData),"monotorrent"), "torrents"));
			dataButton.SetCurrentFolder(Environment.GetFolderPath (Environment.SpecialFolder.Personal));
		}
Ejemplo n.º 2
0
		private void BuildFilterPage()
		{
			TreeViewColumn filterColumn = new TreeViewColumn();
			filterListStore = new ListStore(typeof(RssFilter));
			
			CellRendererText textRenderer = new CellRendererText();
			filterFeedCombobox.PackStart(textRenderer, true);
			filterFeedCombobox.AddAttribute(textRenderer, "text", 0);
			
			filterFeedListStore = new ListStore(typeof(string));
			allIter = filterFeedListStore.AppendValues("All");
		   	
			filterFeedCombobox.Model = filterFeedListStore;
			filterFeedCombobox.SetActiveIter(allIter);
			
			filterColumn.Title = "Filter";
			Gtk.CellRendererText filterCell = new Gtk.CellRendererText ();
			filterColumn.PackStart (filterCell, true);
			filterColumn.SetCellDataFunc (filterCell, new Gtk.TreeCellDataFunc (RenderFilter));
			
			filterTreeView.AppendColumn(filterColumn);
			
			filterTreeView.Model = filterListStore;
			
			savePathChooserButton = new FileChooserButton("Select a Save Path", FileChooserAction.SelectFolder);
			savePathChooserButton.SetCurrentFolder(controller.TorrentController.engine.Settings.SavePath);
			savePathChooserButton.ShowAll();
			
			filterTable.Attach(savePathChooserButton, 1, 2, 3, 4, AttachOptions.Fill, AttachOptions.Shrink, 0, 0); 
			
			foreach(RssFilter filter in controller.Filters){
				filterListStore.AppendValues(filter);
			}
			foreach(string feed in controller.Feeds){
				filterFeedListStore.AppendValues(feed);
			}
			
			filterTreeView.Selection.Changed += OnFilterTreeViewSelectionChanged;
			
		}