blam r623 - trunk/src



Author: cmartin
Date: Thu Sep  4 13:20:09 2008
New Revision: 623
URL: http://svn.gnome.org/viewvc/blam?rev=623&view=rev

Log:
Add the "old" status for items.

Once we leave a channel, we mark all items in it as old. Old and unread
entries get a special distinction.

Modified:
   trunk/src/ChannelList.cs
   trunk/src/Item.cs
   trunk/src/ItemList.cs

Modified: trunk/src/ChannelList.cs
==============================================================================
--- trunk/src/ChannelList.cs	(original)
+++ trunk/src/ChannelList.cs	Thu Sep  4 13:20:09 2008
@@ -34,6 +34,8 @@
 
         private IEnumerator channelEnumerator;
 
+        private Channel LastChannel = null;
+
         public ChannelList(IList channels)
         { 
             TreeViewColumn col;
@@ -305,6 +307,14 @@
 
         private void EmitChannelSelected(Channel channel)
         {
+            if(LastChannel != null){
+                foreach(Item item in LastChannel.Items){
+                    item.Old = true;
+                }
+            }
+
+            LastChannel = channel;
+
             if (ChannelSelectedEvent != null) {
                 ChannelSelectedEvent(channel);
             }

Modified: trunk/src/Item.cs
==============================================================================
--- trunk/src/Item.cs	(original)
+++ trunk/src/Item.cs	Thu Sep  4 13:20:09 2008
@@ -13,6 +13,7 @@
 	public class Item {
 		[XmlAttribute] public string   Id = "";
 		[XmlAttribute] public bool     Unread = true;
+		[XmlAttribute] public bool     Old = false;
 		[XmlAttribute] public bool     Permanent = false;
 
 		[XmlAttribute] public string   Title = "";

Modified: trunk/src/ItemList.cs
==============================================================================
--- trunk/src/ItemList.cs	(original)
+++ trunk/src/ItemList.cs	Thu Sep  4 13:20:09 2008
@@ -284,12 +284,19 @@
 				       TreeIter       iter)
     {
         Item item = model.GetValue(iter, 0) as Imendio.Blam.Item;
+        string icon = null;
 
         if(item.Unread == true){
-            ((CellRendererPixbuf)cell).StockId = "gtk-file";
+            icon = "gtk-file";
         } else {
-            ((CellRendererPixbuf)cell).StockId = "gtk-find";
+            icon = "gtk-find";
         }
+
+        if(item.Old == true && item.Unread == true){
+            icon = "gtk-about";
+        }
+
+        (cell as CellRendererPixbuf).StockId = icon;
     }
 	
 	private void EmitItemSelected (Imendio.Blam.Item item) 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]