mirror of
https://gitlab.gnome.org/GNOME/gitg
synced 2024-09-17 23:12:14 +00:00
Handle showing upstream in history instead of selection
This commit is contained in:
parent
316d46c3ce
commit
01ce13d1a4
|
@ -590,11 +590,6 @@ public class RefsList : Gtk.ListBox
|
||||||
this,
|
this,
|
||||||
"reference-sort-order",
|
"reference-sort-order",
|
||||||
SettingsBindFlags.GET | SettingsBindFlags.SET);
|
SettingsBindFlags.GET | SettingsBindFlags.SET);
|
||||||
|
|
||||||
settings.bind("show-upstream-with-branch",
|
|
||||||
this,
|
|
||||||
"show-upstream-with-branch",
|
|
||||||
SettingsBindFlags.GET | SettingsBindFlags.SET);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Gee.List<Gitg.Ref> references
|
public Gee.List<Gitg.Ref> references
|
||||||
|
@ -616,24 +611,6 @@ public class RefsList : Gtk.ListBox
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool d_show_upstream_with_branch;
|
|
||||||
|
|
||||||
public bool show_upstream_with_branch
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return d_show_upstream_with_branch;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (d_show_upstream_with_branch != value)
|
|
||||||
{
|
|
||||||
d_show_upstream_with_branch = value;
|
|
||||||
changed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string reference_sort_order
|
public string reference_sort_order
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -1361,18 +1338,7 @@ public class RefsList : Gtk.ListBox
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var rref = ref_row.reference;
|
ret.add(ref_row.reference);
|
||||||
ret.add(rref);
|
|
||||||
|
|
||||||
if (d_show_upstream_with_branch && rref.is_branch())
|
|
||||||
{
|
|
||||||
var branch = rref as Gitg.Branch;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
ret.add(branch.get_upstream());
|
|
||||||
} catch {}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -134,6 +134,10 @@ namespace GitgHistory
|
||||||
update_walker();
|
update_walker();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
d_settings.changed["show-upstream-with-branch"].connect((s, k) => {
|
||||||
|
update_walker();
|
||||||
|
});
|
||||||
|
|
||||||
d_selected = new Gee.HashSet<Ggit.OId>((Gee.HashDataFunc<Ggit.OId>)Ggit.OId.hash,
|
d_selected = new Gee.HashSet<Ggit.OId>((Gee.HashDataFunc<Ggit.OId>)Ggit.OId.hash,
|
||||||
(Gee.EqualDataFunc<Ggit.OId>)Ggit.OId.equal);
|
(Gee.EqualDataFunc<Ggit.OId>)Ggit.OId.equal);
|
||||||
|
|
||||||
|
@ -924,6 +928,8 @@ namespace GitgHistory
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var show_upstream_with_branch = d_settings.get_boolean("show-upstream-with-branch");
|
||||||
|
|
||||||
foreach (var r in d_main.refs_list.selection)
|
foreach (var r in d_main.refs_list.selection)
|
||||||
{
|
{
|
||||||
var id = id_for_ref(r);
|
var id = id_for_ref(r);
|
||||||
|
@ -941,6 +947,21 @@ namespace GitgHistory
|
||||||
permanent += id;
|
permanent += id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (show_upstream_with_branch && r.is_branch())
|
||||||
|
{
|
||||||
|
var branch = r as Gitg.Branch;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var upid = id_for_ref(branch.get_upstream());
|
||||||
|
|
||||||
|
if (upid != null)
|
||||||
|
{
|
||||||
|
include.add(upid);
|
||||||
|
}
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue