mirror of
https://gitlab.gnome.org/GNOME/gitg
synced 2024-10-30 06:40:39 +00:00
Bind topological-order setting to model sort mode
This commit is contained in:
parent
c4b196d558
commit
fb0a809aeb
1 changed files with 20 additions and 0 deletions
|
@ -33,6 +33,7 @@ namespace GitgHistory
|
||||||
private GitgGtk.CommitModel? d_model;
|
private GitgGtk.CommitModel? d_model;
|
||||||
private Gee.HashSet<Ggit.OId> d_selected;
|
private Gee.HashSet<Ggit.OId> d_selected;
|
||||||
private ulong d_insertsig;
|
private ulong d_insertsig;
|
||||||
|
private Settings d_settings;
|
||||||
|
|
||||||
private Gtk.Widget d_main;
|
private Gtk.Widget d_main;
|
||||||
|
|
||||||
|
@ -61,9 +62,28 @@ namespace GitgHistory
|
||||||
d_model.started.connect(on_commit_model_started);
|
d_model.started.connect(on_commit_model_started);
|
||||||
d_model.finished.connect(on_commit_model_finished);
|
d_model.finished.connect(on_commit_model_finished);
|
||||||
|
|
||||||
|
d_settings = new Settings("org.gnome.gitg.history.preferences");
|
||||||
|
d_settings.changed["topological-order"].connect((s, k) => {
|
||||||
|
update_sort_mode();
|
||||||
|
});
|
||||||
|
|
||||||
|
update_sort_mode();
|
||||||
|
|
||||||
application.bind_property("repository", d_model, "repository", BindingFlags.DEFAULT);
|
application.bind_property("repository", d_model, "repository", BindingFlags.DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void update_sort_mode()
|
||||||
|
{
|
||||||
|
if (d_settings.get_boolean("topological-order"))
|
||||||
|
{
|
||||||
|
d_model.sort_mode |= Ggit.SortMode.TOPOLOGICAL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
d_model.sort_mode &= ~Ggit.SortMode.TOPOLOGICAL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void on_commit_model_started(Gitg.CommitModel model)
|
private void on_commit_model_started(Gitg.CommitModel model)
|
||||||
{
|
{
|
||||||
if (d_insertsig == 0)
|
if (d_insertsig == 0)
|
||||||
|
|
Loading…
Reference in a new issue