[gnome-builder] GbPreferencesPageEditor: add keywords for widgets



commit 695bd1af1012180f4ce7aa785d851ff3d5338cf0
Author: Christian Hergert <christian hergert me>
Date:   Fri Dec 12 03:44:35 2014 -0800

    GbPreferencesPageEditor: add keywords for widgets

 src/preferences/gb-preferences-page-editor.c   |   45 ++++++++++++++++++++++++
 src/resources/ui/gb-preferences-page-editor.ui |    8 ++--
 2 files changed, 49 insertions(+), 4 deletions(-)
---
diff --git a/src/preferences/gb-preferences-page-editor.c b/src/preferences/gb-preferences-page-editor.c
index 6dd80e2..a4540e3 100644
--- a/src/preferences/gb-preferences-page-editor.c
+++ b/src/preferences/gb-preferences-page-editor.c
@@ -16,6 +16,10 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#define G_LOG_DOMAIN "prefs-page-editor"
+
+#include <glib/gi18n.h>
+
 #include "gb-preferences-page-editor.h"
 #include "gb-source-style-scheme-button.h"
 
@@ -23,12 +27,19 @@ struct _GbPreferencesPageEditorPrivate
 {
   GSettings                 *settings;
 
+  /* Widgets owned by Template */
   GtkSwitch                 *restore_insert_mark_switch;
   GtkSwitch                 *show_diff_switch;
   GtkSwitch                 *vim_mode_switch;
   GtkSwitch                 *word_completion_switch;
   GtkFontButton             *font_button;
   GbSourceStyleSchemeButton *style_scheme_button;
+
+  /* Template widgets used for filtering */
+  GtkWidget                 *vim_container;
+  GtkWidget                 *restore_insert_mark_container;
+  GtkWidget                 *word_completion_container;
+  GtkWidget                 *show_diff_container;
 };
 
 G_DEFINE_TYPE_WITH_PRIVATE (GbPreferencesPageEditor, gb_preferences_page_editor,
@@ -96,6 +107,11 @@ gb_preferences_page_editor_class_init (GbPreferencesPageEditorClass *klass)
   gtk_widget_class_bind_template_child_private (widget_class, GbPreferencesPageEditor, vim_mode_switch);
   gtk_widget_class_bind_template_child_private (widget_class, GbPreferencesPageEditor, 
word_completion_switch);
 
+  gtk_widget_class_bind_template_child_private (widget_class, GbPreferencesPageEditor, vim_container);
+  gtk_widget_class_bind_template_child_private (widget_class, GbPreferencesPageEditor, 
restore_insert_mark_container);
+  gtk_widget_class_bind_template_child_private (widget_class, GbPreferencesPageEditor, 
word_completion_container);
+  gtk_widget_class_bind_template_child_private (widget_class, GbPreferencesPageEditor, show_diff_container);
+
   g_type_ensure (GB_TYPE_SOURCE_STYLE_SCHEME_BUTTON);
 }
 
@@ -105,4 +121,33 @@ gb_preferences_page_editor_init (GbPreferencesPageEditor *self)
   self->priv = gb_preferences_page_editor_get_instance_private (self);
 
   gtk_widget_init_template (GTK_WIDGET (self));
+
+  gb_preferences_page_set_keywords_for_widget (GB_PREFERENCES_PAGE (self),
+                                               _("vim modal"),
+                                               self->priv->vim_container,
+                                               self->priv->vim_mode_switch,
+                                               NULL);
+  gb_preferences_page_set_keywords_for_widget (GB_PREFERENCES_PAGE (self),
+                                               _("restore insert cursor mark"),
+                                               self->priv->restore_insert_mark_container,
+                                               self->priv->restore_insert_mark_switch,
+                                               NULL);
+  gb_preferences_page_set_keywords_for_widget (GB_PREFERENCES_PAGE (self),
+                                               _("word words auto completion suggest found document"),
+                                               self->priv->word_completion_container,
+                                               self->priv->word_completion_switch,
+                                               NULL);
+  gb_preferences_page_set_keywords_for_widget (GB_PREFERENCES_PAGE (self),
+                                               _("diff renderer gutter changes git vcs"),
+                                               self->priv->show_diff_container,
+                                               self->priv->show_diff_switch,
+                                               NULL);
+  gb_preferences_page_set_keywords_for_widget (GB_PREFERENCES_PAGE (self),
+                                               _("font document editor monospace"),
+                                               GTK_WIDGET (self->priv->font_button),
+                                               NULL);
+  gb_preferences_page_set_keywords_for_widget (GB_PREFERENCES_PAGE (self),
+                                               _("source style scheme source tango solarized builder"),
+                                               GTK_WIDGET (self->priv->style_scheme_button),
+                                               NULL);
 }
diff --git a/src/resources/ui/gb-preferences-page-editor.ui b/src/resources/ui/gb-preferences-page-editor.ui
index 32af755..9ef3eb9 100644
--- a/src/resources/ui/gb-preferences-page-editor.ui
+++ b/src/resources/ui/gb-preferences-page-editor.ui
@@ -59,7 +59,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkBox" id="box8">
+              <object class="GtkBox" id="vim_container">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="hexpand">True</property>
@@ -103,7 +103,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkBox" id="box9">
+              <object class="GtkBox" id="restore_insert_mark_container">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="hexpand">True</property>
@@ -147,7 +147,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkBox" id="box10">
+              <object class="GtkBox" id="word_completion_container">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="hexpand">True</property>
@@ -191,7 +191,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkBox">
+              <object class="GtkBox" id="show_diff_container">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="hexpand">True</property>


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