[gnome-builder/wip/chergert/perspective] prefs: use checkmarks for draw spaces



commit 7303c98346a7ec069964aa7fd9477dae36834ec7
Author: Christian Hergert <chergert redhat com>
Date:   Sat Nov 7 03:46:28 2015 -0800

    prefs: use checkmarks for draw spaces

 libide/preferences/ide-preferences-builtin.c     |   22 +++++++++++-----------
 libide/preferences/ide-preferences-perspective.c |    4 +++-
 libide/preferences/ide-preferences.c             |    3 ++-
 libide/preferences/ide-preferences.h             |    2 ++
 4 files changed, 18 insertions(+), 13 deletions(-)
---
diff --git a/libide/preferences/ide-preferences-builtin.c b/libide/preferences/ide-preferences-builtin.c
index 181cb74..e08edba 100644
--- a/libide/preferences/ide-preferences-builtin.c
+++ b/libide/preferences/ide-preferences-builtin.c
@@ -88,7 +88,7 @@ ide_preferences_builtin_register_appearance (IdePreferences *preferences)
       scheme = gtk_source_style_scheme_manager_get_scheme (manager, scheme_ids [i]);
       title = gtk_source_style_scheme_get_name (scheme);
 
-      ide_preferences_add_radio (preferences, "appearance", "schemes", "org.gnome.builder.editor", 
"style-scheme-name", variant_str, title, NULL, title, i);
+      ide_preferences_add_radio (preferences, "appearance", "schemes", "org.gnome.builder.editor", 
"style-scheme-name", NULL, variant_str, title, NULL, title, i);
     }
 
   ide_preferences_add_list_group (preferences, "appearance", "background", NULL, 300);
@@ -101,9 +101,9 @@ ide_preferences_builtin_register_keyboard (IdePreferences *preferences)
   ide_preferences_add_page (preferences, "keyboard", _("Keyboard"), 400);
 
   ide_preferences_add_list_group (preferences, "keyboard", "mode", _("Emulation"), 0);
-  ide_preferences_add_radio (preferences, "keyboard", "mode", "org.gnome.builder.editor", "keybindings", 
"\"default\"", _("Builder"), _("Default keybinding mode which mimics Gedit"), NULL, 0);
-  ide_preferences_add_radio (preferences, "keyboard", "mode", "org.gnome.builder.editor", "keybindings", 
"\"emacs\"", _("Emacs"), _("Emulates the Emacs text editor"), NULL, 0);
-  ide_preferences_add_radio (preferences, "keyboard", "mode", "org.gnome.builder.editor", "keybindings", 
"\"vim\"", _("Vim"), _("Emulates the Vim text editor"), NULL, 0);
+  ide_preferences_add_radio (preferences, "keyboard", "mode", "org.gnome.builder.editor", "keybindings", 
NULL, "\"default\"", _("Builder"), _("Default keybinding mode which mimics Gedit"), NULL, 0);
+  ide_preferences_add_radio (preferences, "keyboard", "mode", "org.gnome.builder.editor", "keybindings", 
NULL, "\"emacs\"", _("Emacs"), _("Emulates the Emacs text editor"), NULL, 0);
+  ide_preferences_add_radio (preferences, "keyboard", "mode", "org.gnome.builder.editor", "keybindings", 
NULL, "\"vim\"", _("Vim"), _("Emulates the Vim text editor"), NULL, 0);
 
   ide_preferences_add_list_group (preferences, "keyboard", "movements", _("Movement"), 100);
   ide_preferences_add_switch (preferences, "keyboard", "movements", "org.gnome.builder.editor", 
"smart-home-end", NULL, NULL, _("Smart Home and End"), _("Home moves to first non-whitespace character"), 
NULL, 0);
@@ -131,13 +131,13 @@ ide_preferences_builtin_register_editor (IdePreferences *preferences)
   ide_preferences_add_switch (preferences, "editor", "overview", "org.gnome.builder.editor", 
"auto-hide-map", NULL, NULL, _("Automatically hide overview map"), _("Automatically hide the map when the 
editor loses focus"), NULL, 1);
 
   ide_preferences_add_list_group (preferences, "editor", "draw-spaces", _("Whitespace Characters"), 400);
-  ide_preferences_add_switch (preferences, "editor", "draw-spaces", "org.gnome.builder.editor", 
"draw-spaces", NULL, "\"space\"", _("Spaces"), NULL, NULL, 0);
-  ide_preferences_add_switch (preferences, "editor", "draw-spaces", "org.gnome.builder.editor", 
"draw-spaces", NULL, "\"tab\"", _("Tabs"), NULL, NULL, 1);
-  ide_preferences_add_switch (preferences, "editor", "draw-spaces", "org.gnome.builder.editor", 
"draw-spaces", NULL, "\"newline\"", _("New line and carriage return"), NULL, NULL, 2);
-  ide_preferences_add_switch (preferences, "editor", "draw-spaces", "org.gnome.builder.editor", 
"draw-spaces", NULL, "\"nbsp\"", _("Non-breaking spaces"), NULL, NULL, 3);
-  ide_preferences_add_switch (preferences, "editor", "draw-spaces", "org.gnome.builder.editor", 
"draw-spaces", NULL, "\"text\"", _("Spaces inside of text"), NULL, NULL, 4);
-  ide_preferences_add_switch (preferences, "editor", "draw-spaces", "org.gnome.builder.editor", 
"draw-spaces", NULL, "\"trailing\"", _("Trailing Only"), NULL, NULL, 5);
-  ide_preferences_add_switch (preferences, "editor", "draw-spaces", "org.gnome.builder.editor", 
"draw-spaces", NULL, "\"leading\"", _("Leading Only"), NULL, NULL, 6);
+  ide_preferences_add_radio (preferences, "editor", "draw-spaces", "org.gnome.builder.editor", 
"draw-spaces", NULL, "\"space\"", _("Spaces"), NULL, NULL, 0);
+  ide_preferences_add_radio (preferences, "editor", "draw-spaces", "org.gnome.builder.editor", 
"draw-spaces", NULL, "\"tab\"", _("Tabs"), NULL, NULL, 1);
+  ide_preferences_add_radio (preferences, "editor", "draw-spaces", "org.gnome.builder.editor", 
"draw-spaces", NULL, "\"newline\"", _("New line and carriage return"), NULL, NULL, 2);
+  ide_preferences_add_radio (preferences, "editor", "draw-spaces", "org.gnome.builder.editor", 
"draw-spaces", NULL, "\"nbsp\"", _("Non-breaking spaces"), NULL, NULL, 3);
+  ide_preferences_add_radio (preferences, "editor", "draw-spaces", "org.gnome.builder.editor", 
"draw-spaces", NULL, "\"text\"", _("Spaces inside of text"), NULL, NULL, 4);
+  ide_preferences_add_radio (preferences, "editor", "draw-spaces", "org.gnome.builder.editor", 
"draw-spaces", NULL, "\"trailing\"", _("Trailing Only"), NULL, NULL, 5);
+  ide_preferences_add_radio (preferences, "editor", "draw-spaces", "org.gnome.builder.editor", 
"draw-spaces", NULL, "\"leading\"", _("Leading Only"), NULL, NULL, 6);
 }
 
 static void
diff --git a/libide/preferences/ide-preferences-perspective.c 
b/libide/preferences/ide-preferences-perspective.c
index 99a3c6c..52ae1b2 100644
--- a/libide/preferences/ide-preferences-perspective.c
+++ b/libide/preferences/ide-preferences-perspective.c
@@ -256,6 +256,7 @@ ide_preferences_perspective_add_radio (IdePreferences *preferences,
                                        const gchar    *group_name,
                                        const gchar    *schema_id,
                                        const gchar    *key,
+                                       const gchar    *path,
                                        const gchar    *variant_string,
                                        const gchar    *title,
                                        const gchar    *subtitle,
@@ -306,10 +307,11 @@ ide_preferences_perspective_add_radio (IdePreferences *preferences,
     }
 
   widget = g_object_new (IDE_TYPE_PREFERENCES_SWITCH,
+                         "is-radio", TRUE,
                          "key", key,
                          "keywords", keywords,
+                         "path", path,
                          "priority", priority,
-                         "is-radio", TRUE,
                          "schema-id", schema_id,
                          "subtitle", subtitle,
                          "target", variant,
diff --git a/libide/preferences/ide-preferences.c b/libide/preferences/ide-preferences.c
index 8a31ea5..f3cffb2 100644
--- a/libide/preferences/ide-preferences.c
+++ b/libide/preferences/ide-preferences.c
@@ -131,6 +131,7 @@ guint ide_preferences_add_radio (IdePreferences *self,
                                  const gchar    *group_name,
                                  const gchar    *schema_id,
                                  const gchar    *key,
+                                 const gchar    *path,
                                  const gchar    *variant_string,
                                  const gchar    *title,
                                  const gchar    *subtitle,
@@ -144,7 +145,7 @@ guint ide_preferences_add_radio (IdePreferences *self,
   g_return_val_if_fail (key != NULL, 0);
   g_return_val_if_fail (title != NULL, 0);
 
-  return IDE_PREFERENCES_GET_IFACE (self)->add_radio (self, page_name, group_name, schema_id, key, 
variant_string, title, subtitle, keywords, priority);
+  return IDE_PREFERENCES_GET_IFACE (self)->add_radio (self, page_name, group_name, schema_id, key, path, 
variant_string, title, subtitle, keywords, priority);
 }
 
 guint
diff --git a/libide/preferences/ide-preferences.h b/libide/preferences/ide-preferences.h
index 76179c9..61efa21 100644
--- a/libide/preferences/ide-preferences.h
+++ b/libide/preferences/ide-preferences.h
@@ -50,6 +50,7 @@ struct _IdePreferencesInterface
                             const gchar    *group_name,
                             const gchar    *schema_id,
                             const gchar    *key,
+                            const gchar    *path,
                             const gchar    *variant_string,
                             const gchar    *title,
                             const gchar    *subtitle,
@@ -110,6 +111,7 @@ guint ide_preferences_add_radio       (IdePreferences *self,
                                        const gchar    *group_name,
                                        const gchar    *schema_id,
                                        const gchar    *key,
+                                       const gchar    *path,
                                        const gchar    *variant_string,
                                        const gchar    *title,
                                        const gchar    *subtitle,


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