Notify the navigation when repository changes

This commit is contained in:
Techlive Zheng 2013-05-23 21:55:17 +08:00 committed by Ignacio Casal Quinteiro
parent 47f6acdd33
commit 01b8ee2ccc
2 changed files with 20 additions and 0 deletions

View file

@ -93,6 +93,17 @@ namespace GitgHistory
populate(d_repository);
}
[Notify]
public Gitg.Repository repository
{
get { return d_repository; }
set
{
d_repository = value;
reload();
}
}
private static int sort_refs(Gitg.Ref a, Gitg.Ref b)
{
return a.parsed_name.shortname.ascii_casecmp(b.parsed_name.shortname);
@ -399,6 +410,12 @@ namespace GitgHistory
d_callbacks.length = 0;
}
public void reload()
{
clear();
populate(d_repository);
}
public void activate(Gtk.TreeIter iter, int numclick)
{
uint oid;

View file

@ -186,6 +186,9 @@ namespace GitgHistory
d_navigation.model.ref_activated.connect((r) => {
on_ref_activated(d_navigation.model, r);
});
application.bind_property("repository", d_navigation.model, "repository", BindingFlags.DEFAULT);
d_navigation.set_show_expanders(d_navigation.model.show_expanders);
if (d_navigation.model.show_expanders)
{