3 using System
.Collections
;
4 using System
.Collections
.Generic
;
8 using Microsoft
.TeamFoundation
.Client
;
9 using Microsoft
.TeamFoundation
.VersionControl
.Common
;
10 using Microsoft
.TeamFoundation
.VersionControl
.Client
;
12 namespace Gtk
.TeamFoundation
14 public class DirectoryView
: Gtk
.ScrolledWindow
, IExploreViewChild
16 private Gtk
.TreeView directoryList
;
17 private Gtk
.ListStore directoryListStore
;
18 private SortableColumns sortableColumns
;
20 public DirectoryView()
22 directoryList
= new Gtk
.TreeView();
24 directoryListStore
= new Gtk
.ListStore (typeof(string), typeof(string), typeof(string), typeof(string));
25 directoryList
.Model
= directoryListStore
;
26 sortableColumns
= new SortableColumns(directoryList
, directoryListStore
);
28 #if HAVE_ATLEAST_GTK_210
29 directoryList
.EnableGridLines
= TreeViewGridLines
.Vertical
;
31 AppendColumn ("Name", 0);
32 AppendColumn ("Status", 1);
33 AppendColumn ("Owner", 2);
34 AppendColumn ("Latest", 3);
39 private TreeViewColumn
AppendColumn(string name
, int indx
)
41 TreeViewColumn column
= directoryList
.AppendColumn (name
, new Gtk
.CellRendererText (), "text", indx
);
43 column
.Clickable
= true;
44 column
.Resizable
= true;
45 column
.SortColumnId
= indx
;
46 column
.Clicked
+= new EventHandler (sortableColumns
.OnColumnClick
);
51 public void UpdatePath(VersionControlServer vcs
, string path
)
53 if (String
.IsNullOrEmpty(path
)) return;
54 directoryListStore
.Clear();
56 ExtendedItem
[] items
= vcs
.GetExtendedItems (path
, DeletedState
.NonDeleted
, ItemType
.Any
);
58 foreach (ExtendedItem item
in items
)
60 string latest
= item
.IsLatest
? "Yes" : "No";
62 string status
= item
.LockStatus
.ToString();
63 if (status
== "None") status
= String
.Empty
;
65 string shortPath
= item
.TargetServerItem
.Substring(item
.TargetServerItem
.LastIndexOf('/') + 1);
66 if (item
.ItemType
== ItemType
.Folder
) shortPath
+= "/";
68 directoryListStore
.AppendValues(shortPath
, status
, item
.LockOwner
, latest
);
71 // this would be nice be seems to cause a segfault
72 //changesetList.ColumnsAutosize();