[gitg] Added commit preferences panel class



commit f8563bc638b2295ad65cae1b193b1ba96f7f2ae1
Author: Jesse van den Kieboom <jessevdk gmail com>
Date:   Sat Jul 6 19:07:39 2013 +0200

    Added commit preferences panel class

 gitg/preferences/gitg-preferences-commit.vala |   71 +++++++++++++++++++++++++
 1 files changed, 71 insertions(+), 0 deletions(-)
---
diff --git a/gitg/preferences/gitg-preferences-commit.vala b/gitg/preferences/gitg-preferences-commit.vala
new file mode 100644
index 0000000..d6e1f8a
--- /dev/null
+++ b/gitg/preferences/gitg-preferences-commit.vala
@@ -0,0 +1,71 @@
+/*
+ * This file is part of gitg
+ *
+ * Copyright (C) 2013 - Jesse van den Kieboom
+ *
+ * gitg is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * gitg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with gitg. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+namespace Gitg
+{
+
+[GtkTemplate (ui = "/org/gnome/gitg/ui/gitg-preferences-commit.ui")]
+public class PreferencesCommit : Gtk.Grid, GitgExt.Preferences
+{
+       // Do this to pull in config.h before glib.h (for gettext...)
+       private const string version = Gitg.Config.VERSION;
+
+       [GtkChild (name = "check_button_show_right_margin")]
+       private Gtk.CheckButton d_check_button_show_right_margin;
+
+       [GtkChild (name = "spin_button_right_margin")]
+       private Gtk.SpinButton d_spin_button_right_margin;
+
+       construct
+       {
+               var settings = new Settings("org.gnome.gitg.preferences.commit.message");
+
+               settings.bind("show-right-margin",
+                             d_check_button_show_right_margin,
+                             "active",
+                             SettingsBindFlags.GET | SettingsBindFlags.SET);
+
+               settings.bind("right-margin-at",
+                             d_spin_button_right_margin,
+                             "value",
+                             SettingsBindFlags.GET | SettingsBindFlags.SET);
+       }
+
+       public Gtk.Widget widget
+       {
+               owned get
+               {
+                       return this;
+               }
+       }
+
+       public string id
+       {
+               owned get { return "/org/gnome/gitg/Preferences/Commit"; }
+       }
+
+       public string display_name
+       {
+               owned get { return _("Commit"); }
+       }
+}
+
+}
+
+// vi:ts=4



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]