private void buildLabelPage() { labelTreeView = new LabelTreeView(mainWindow, false); labelTreeView.sizeColumn.Visible = false; labelTreeView.Model = filterListStore; labelTreeView.Selection.Changed += OnLabelSelectionChanged; labelScrolledWindow.AddWithViewport(labelTreeView); labelScrolledWindow.ShowAll(); //iconButton.Image = new Gtk.Image(Gtk.IconTheme.Default.LoadIcon("gtk-about", 32, 0)); //iconButton.Sensitive = true; selectIcon = new IconEntry("", "Select an Icon"); iconEntryBox.Add(selectIcon); selectIcon.ShowAll(); }
private void BuildLabelTreeView() { /* Move some stuff to LabelTreeView */ labelTreeView = new LabelTreeView (this, true); labelListStore = new ListStore (typeof (TorrentLabel)); labelTreeView.Model = labelListStore; labelTreeView.Selection.Changed += OnLabelSelectionChanged; labelViewScrolledWindow.AddWithViewport (labelTreeView); labelTreeView.Show (); //torrentFilter = new Gtk.TreeModelFilter (torrentListStore, null); //torrentFilter = new TorrentFilterModel(torrentListStore, null); //torrentFilter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc (FilterTorrentTree); torrentTreeView.Model = torrentListStore; //torrentTreeView.Model = torrentFilter; //ArrayList allList = new ArrayList (); //foreach(TorrentManager manager in torrents.Keys){ // allList.Add (manager); //} allLabel = new TorrentLabel (new ArrayList(), "All", "gtk-home"); downloadingLabel = new TorrentLabel (new ArrayList(), "Downloading", "gtk-go-down"); uploadLabel = new TorrentLabel (new ArrayList(), "Seeding", "gtk-go-up"); //labelListStore.AppendValues(Gtk.IconTheme.Default.LoadIcon("gtk-home", 16, 0), "All", "(0)"); //labelListStore.AppendValues(Gtk.IconTheme.Default.LoadIcon("gtk-go-down", 16, 0), "Downloading", "(0)"); //labelListStore.AppendValues(Gtk.IconTheme.Default.LoadIcon("gtk-go-up", 16, 0), "Seeding", "(0)"); labelListStore.AppendValues (allLabel); labelListStore.AppendValues (downloadingLabel); labelListStore.AppendValues (uploadLabel); TargetEntry [] targetEntries = new TargetEntry[]{ new TargetEntry("application/x-monotorrent-torrentmanager-objects", 0, 0) }; labelTreeView.EnableModelDragDest(targetEntries, Gdk.DragAction.Copy); labelTreeView.DragDataReceived += OnTorrentDragDataReceived; }