private void RenderIcon(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) { Waypoint pt = (Waypoint)model.GetValue(iter, 0); CellRendererPixbuf icon = cell as CellRendererPixbuf; if (pt is Geocache) { icon.Pixbuf = IconManager.GetSmallCacheIcon((pt as Geocache).TypeOfCache); } else { icon.Pixbuf = IconManager.GetSmallWaypointIcon(pt.Symbol); } }
private void RenderCacheIcon(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) { Geocache cache = (Geocache)model.GetValue(iter, 0); if (cache == null) { return; } CellRendererPixbuf icon = cell as CellRendererPixbuf; cell.CellBackground = null; if (m_app.AppConfig.ShowStaleCaches) { if ((DateTime.Now - cache.Updated) > (new TimeSpan(m_app.AppConfig.StaleCacheInterval, 0, 0, 0, 0))) { cell.CellBackground = "gold"; } } if (m_app.AppConfig.ShowNewCaches) { if ((DateTime.Now - cache.Time) <= (new TimeSpan(m_app.AppConfig.NewCacheInterval, 0, 0, 0, 0))) { cell.CellBackground = "light green"; } } if (cache.FTF) { icon.Pixbuf = IconManager.FTF_S; } else if (cache.DNF && Config.ShowDNFIcon) { icon.Pixbuf = IconManager.DNF_S; } else if (cache.Found) { icon.Pixbuf = IconManager.GetSmallCacheIcon(Geocache.CacheType.FOUND); } else if (m_app.OwnerIDs.Contains(cache.OwnerID) || m_app.OwnerIDs.Contains(cache.CacheOwner)) { icon.Pixbuf = IconManager.GetSmallCacheIcon(Geocache.CacheType.MINE); } else if (cache.HasCorrected || cache.HasFinal) { if (Config.SolvedModeState == SolvedMode.ALL) { icon.Pixbuf = IconManager.CORRECTED_S; } else if ((Config.SolvedModeState == SolvedMode.PUZZLES) && (cache.TypeOfCache == Geocache.CacheType.MYSTERY)) { icon.Pixbuf = IconManager.CORRECTED_S; } else { icon.Pixbuf = IconManager.GetSmallCacheIcon(cache.TypeOfCache); } } else { icon.Pixbuf = IconManager.GetSmallCacheIcon(cache.TypeOfCache); } }