[gnome-builder/wip/vim] prefs: wire vim mode to gsettings schema.
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/vim] prefs: wire vim mode to gsettings schema.
- Date: Fri, 3 Oct 2014 20:13:33 +0000 (UTC)
commit 3e76e7e43cc3e4f24d1d09fdb7e619f998c043e5
Author: Christian Hergert <christian hergert me>
Date: Fri Oct 3 13:10:40 2014 -0700
prefs: wire vim mode to gsettings schema.
src/preferences/gb-preferences-window.c | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/src/preferences/gb-preferences-window.c b/src/preferences/gb-preferences-window.c
index a33fd43..7e87c1c 100644
--- a/src/preferences/gb-preferences-window.c
+++ b/src/preferences/gb-preferences-window.c
@@ -35,6 +35,8 @@ struct _GbPreferencesWindowPrivate
GtkSearchBar *search_bar;
GtkStack *stack;
+ GtkSwitch *vim_switch;
+
GtkEntry *git_author_name_entry;
GtkEntry *git_author_email_entry;
};
@@ -78,6 +80,21 @@ gb_preferences_window_section_changed (GtkStack *stack,
}
static void
+load_editor (GbPreferencesWindow *window)
+{
+ GSettings *settings;
+
+ g_return_if_fail (GB_IS_PREFERENCES_WINDOW (window));
+
+ settings = g_settings_new ("org.gnome.builder.editor");
+
+ g_settings_bind (settings, "vim-mode", window->priv->vim_switch, "active",
+ G_SETTINGS_BIND_DEFAULT);
+
+ g_object_unref (settings);
+}
+
+static void
load_git (GbPreferencesWindow *window)
{
GgitConfig *config;
@@ -116,6 +133,7 @@ gb_preferences_window_constructed (GObject *object)
window);
gb_preferences_window_section_changed (window->priv->stack, NULL, window);
+ load_editor (window);
load_git (window);
}
@@ -184,6 +202,9 @@ gb_preferences_window_class_init (GbPreferencesWindowClass *klass)
stack);
gtk_widget_class_bind_template_child_private (widget_class,
GbPreferencesWindow,
+ vim_switch);
+ gtk_widget_class_bind_template_child_private (widget_class,
+ GbPreferencesWindow,
git_author_name_entry);
gtk_widget_class_bind_template_child_private (widget_class,
GbPreferencesWindow,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]