Example #1
0
        void HandleNodeview1RowActivated(object o, RowActivatedArgs args)
        {
            TreeIter iter;

            store.GetIter(out iter, args.Path);
            GuiComponents.TvEpisodeNodeItem node = store.GetValue(iter, 0) as GuiComponents.TvEpisodeNodeItem;
            if (node == null)
            {
                return;                 // must be a season parent node
            }
            using (EpisodesEditorGui editor = new EpisodesEditorGui(node.Meta))
            {
                editor.Run();
                editor.Destroy();
            }
        }
Example #2
0
        protected virtual void RenderTreeCell(Gtk.TreeViewColumn _column, Gtk.CellRenderer _cell, Gtk.TreeModel _model, Gtk.TreeIter _iter)
        {
            object o = _model.GetValue(_iter, 0);

            GuiComponents.TvEpisodeNodeItem node = o as GuiComponents.TvEpisodeNodeItem;
            Gdk.Color background = new Gdk.Color(255, 255, 255);
            if (node != null && (_model.GetPath(_iter).Indices[1] % 2) == 0)
            {
                background = new Gdk.Color(240, 240, 255);
            }
            if (_cell is Gtk.CellRendererText)
            {
                if (node != null)
                {
                    switch (_column.SortColumnId)
                    {
                    case 1: (_cell as Gtk.CellRendererText).Text = node.EpisodeNames; break;

                    case 3: (_cell as Gtk.CellRendererText).Text = node.Filename; break;
                    }
                }
                else if (o is KeyNode && _column.SortColumnId == 0)
                {
                    (_cell as Gtk.CellRendererText).Markup = ((KeyNode)o).Markup;
                }
                else
                {
                    (_cell as Gtk.CellRendererText).Text = "";
                }
                (_cell as Gtk.CellRendererText).BackgroundGdk = background;
            }
            else if (_cell is TreeItemCellRenderer)
            {
                TreeItemCellRenderer render = (TreeItemCellRenderer)_cell;
                render.CellBackgroundGdk = background;
                render.Pixbuf            = null;
                if (node != null)
                {
                    render.Text   = node.EpisodeNumbersString;
                    render.Pixbuf = node.StatusIcon;
                }
                else
                {
                    render.Text = ((KeyNode)o).Key;
                }
            }
            else
            {
                if (node != null)
                {
                    switch (_column.SortColumnId)
                    {
                    case 2: (_cell as Gtk.CellRendererPixbuf).Pixbuf = node.RatingIcon; break;
                    }
                }
                else
                {
                    (_cell as Gtk.CellRendererPixbuf).Pixbuf = Images.Empty;
                }
                (_cell as Gtk.CellRendererPixbuf).CellBackgroundGdk = background;
            }
        }