Example #1
0
        void AuthorIconFunc(Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            CellRendererPixbuf renderer = (CellRendererPixbuf)cell;
            var rev = (Revision)model.GetValue(iter, 0);

            if (string.IsNullOrEmpty(rev.Email))
            {
                return;
            }
            ImageLoader img = ImageService.GetUserIcon(rev.Email, 16);

            if (img.LoadOperation.IsCompleted)
            {
                renderer.Pixbuf = img.Pixbuf;
            }
            else
            {
                renderer.Pixbuf              = null;
                img.LoadOperation.Completed += delegate {
                    Gtk.Application.Invoke(delegate {
                        if (logstore.IterIsValid(iter))
                        {
                            model.EmitRowChanged(model.GetPath(iter), iter);
                        }
                    });
                };
            }
        }
Example #2
0
        private void RenderStatusDownload(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            DownloadItem downloadItem = (DownloadItem)model.GetValue(iter, 0);

            (cell as Gtk.CellRendererText).Text = downloadItem.Status;
            model.EmitRowChanged(model.GetPath(iter), iter);
        }
Example #3
0
        private void RenderProgressDownload(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            DownloadItem downloadItem = (DownloadItem)model.GetValue(iter, 0);
            string       progress     = downloadItem.Progress.ToString();

            if (progress.Length > 5)
            {
                progress = progress.Substring(0, 5);
            }

            (cell as Gtk.CellRendererProgress).Text = progress;
            (cell as CellRendererProgress).Value    = (int)downloadItem.Progress;
            model.EmitRowChanged(model.GetPath(iter), iter);
        }
Example #4
0
        static void AuthorIconFunc(Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            CellRendererImage renderer = (CellRendererImage)cell;
            var rev = (Revision)model.GetValue(iter, 0);

            if (string.IsNullOrEmpty(rev.Email))
            {
                return;
            }
            ImageLoader img = ImageService.GetUserIcon(rev.Email, 16);

            renderer.Image = img.Image;
            if (img.Downloading)
            {
                img.Completed += (sender, e) => {
                    renderer.Image = img.Image;
                    if (((ListStore)model).IterIsValid(iter))
                    {
                        model.EmitRowChanged(model.GetPath(iter), iter);
                    }
                };
            }
        }
 private void UpdateMaps(Gtk.TreeModel model, Gtk.TreeIter itr)
 {
     model.EmitRowChanged(model.GetPath(itr), itr);
 }