[gitg/vala] Bind topological-order setting to model sort mode
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg/vala] Bind topological-order setting to model sort mode
- Date: Thu, 19 Jul 2012 08:28:14 +0000 (UTC)
commit fb0a809aebc67bb67ff8f552d73a58ac093e1910
Author: Jesse van den Kieboom <jesse vandenkieboom epfl ch>
Date: Thu Jul 19 10:28:02 2012 +0200
Bind topological-order setting to model sort mode
plugins/history/gitg-history.vala | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/plugins/history/gitg-history.vala b/plugins/history/gitg-history.vala
index 3bc07ac..0418a13 100644
--- a/plugins/history/gitg-history.vala
+++ b/plugins/history/gitg-history.vala
@@ -33,6 +33,7 @@ namespace GitgHistory
private GitgGtk.CommitModel? d_model;
private Gee.HashSet<Ggit.OId> d_selected;
private ulong d_insertsig;
+ private Settings d_settings;
private Gtk.Widget d_main;
@@ -61,9 +62,28 @@ namespace GitgHistory
d_model.started.connect(on_commit_model_started);
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);
}
+ 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)
{
if (d_insertsig == 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]