[gnome-builder] libide/tweaks: port IdeTweaksSwitch to IdeTweaksBinding
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libide/tweaks: port IdeTweaksSwitch to IdeTweaksBinding
- Date: Fri, 26 Aug 2022 21:35:07 +0000 (UTC)
commit 46e13dcf375e6d59cc59fe4c6e45e4e77af182d6
Author: Christian Hergert <chergert redhat com>
Date: Fri Aug 26 14:34:26 2022 -0700
libide/tweaks: port IdeTweaksSwitch to IdeTweaksBinding
This make our last IdeTweaksWidget that was using actions to instead use
our IdeTweaksBinding abstraction.
src/libide/tweaks/demo/010-visual-appearance.ui | 7 +-
src/libide/tweaks/demo/041-code-language.ui | 60 +++++++++++-
src/libide/tweaks/ide-tweaks-switch.c | 104 +++------------------
src/libide/tweaks/ide-tweaks-switch.h | 24 ++---
src/plugins/buildui/tweaks.ui | 14 ++-
src/plugins/clang/tweaks.ui | 20 ++--
src/plugins/copyright/tweaks.ui | 13 ++-
src/plugins/ctags/tweaks.ui | 7 +-
src/plugins/debuggerui/tweaks.ui | 27 ++++--
src/plugins/editorui/tweaks-language.ui | 85 +++++++++++++----
src/plugins/editorui/tweaks.ui | 116 +++++++++++++++++-------
src/plugins/project-tree/tweaks.ui | 21 ++++-
src/plugins/projectui/tweaks.ui | 7 +-
src/plugins/sdkui/tweaks.ui | 7 +-
src/plugins/terminal/tweaks.ui | 43 ++++++---
src/plugins/valgrind/tweaks.ui | 13 ++-
16 files changed, 354 insertions(+), 214 deletions(-)
---
diff --git a/src/libide/tweaks/demo/010-visual-appearance.ui b/src/libide/tweaks/demo/010-visual-appearance.ui
index e0d7d5207..f2c2c4127 100644
--- a/src/libide/tweaks/demo/010-visual-appearance.ui
+++ b/src/libide/tweaks/demo/010-visual-appearance.ui
@@ -29,9 +29,14 @@
<property name="title" translatable="yes">Color</property>
<child>
<object class="IdeTweaksSwitch">
- <property name="action-name">settings.org.gnome.builder.editor.show-grid-lines</property>
<property name="title" translatable="yes">Grid Pattern</property>
<property name="subtitle" translatable="yes">Display a grid pattern underneath source
code</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.editor</property>
+ <property name="schema-key">show-grid-lines</property>
+ </object>
+ </property>
</object>
</child>
</object>
diff --git a/src/libide/tweaks/demo/041-code-language.ui b/src/libide/tweaks/demo/041-code-language.ui
index 8d2084ffa..04ae4f05a 100644
--- a/src/libide/tweaks/demo/041-code-language.ui
+++ b/src/libide/tweaks/demo/041-code-language.ui
@@ -16,28 +16,68 @@
<object class="IdeTweaksSwitch" id="language_page_general_group_trim_switch">
<property name="title" translatable="yes">Trim Trailing Whitespace</property>
<property name="subtitle" translatable="yes">Upon saving, trailing whitespace
will be removed from modified lines</property>
- <property name="action-name"
translatable="yes">settings.org.gnome.builder.editor.language.trim-trailing-whitespace</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.editor.language</property>
+ <property name="schema-key">trim-trailing-whitespace</property>
+ <binding name="path-suffix">
+ <lookup name="id" type="GtkSourceLanguage">
+ <lookup name="item">language_page_factory</lookup>
+ </lookup>
+ </binding>
+ </object>
+ </property>
</object>
</child>
<child>
<object class="IdeTweaksSwitch"
id="language_page_general_group_overwrite_braces_switch">
<property name="title" translatable="yes">Overwrite Braces</property>
<property name="subtitle" translatable="yes">Overwrite closing braces, brackets,
and parenthesis</property>
- <property name="action-name"
translatable="yes">settings.org.gnome.builder.editor.language.overwrite-braces</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.editor.language</property>
+ <property name="schema-key">overwrite-braces</property>
+ <binding name="path-suffix">
+ <lookup name="id" type="GtkSourceLanguage">
+ <lookup name="item">language_page_factory</lookup>
+ </lookup>
+ </binding>
+ </object>
+ </property>
</object>
</child>
<child>
<object class="IdeTweaksSwitch"
id="language_page_general_group_insert_matching_switch">
<property name="title" translatable="yes">Insert Matching Braces</property>
<property name="subtitle" translatable="yes">Automatically close braces,
brackets, and parenthesis</property>
- <property name="action-name"
translatable="yes">settings.org.gnome.builder.editor.language.insert-matching-brace</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.editor.language</property>
+ <property name="schema-key">insert-matching-brace</property>
+ <binding name="path-suffix">
+ <lookup name="id" type="GtkSourceLanguage">
+ <lookup name="item">language_page_factory</lookup>
+ </lookup>
+ </binding>
+ </object>
+ </property>
</object>
</child>
<child>
<object class="IdeTweaksSwitch"
id="language_page_general_group_insert_trailing_newline_switch">
<property name="title" translatable="yes">Insert Trailing Line</property>
<property name="subtitle" translatable="yes">Ensure files end with a new
line</property>
- <property name="action-name"
translatable="yes">settings.org.gnome.builder.editor.language.insert-trailing-newline</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.editor.language</property>
+ <property name="schema-key">insert-trailing-newline</property>
+ <binding name="path-suffix">
+ <lookup name="id" type="GtkSourceLanguage">
+ <lookup name="item">language_page_factory</lookup>
+ </lookup>
+ </binding>
+ </object>
+ </property>
</object>
</child>
</object>
@@ -49,7 +89,17 @@
<object class="IdeTweaksSwitch" id="language_page_margins_group_right_margin">
<property name="title" translatable="yes">Show Right Margin</property>
<property name="subtitle" translatable="yes">Display a margin in the editor to
indicate maximum desired width</property>
- <property name="action-name"
translatable="yes">settings.org.gnome.builder.editor.language.show-right-margin</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.editor.language</property>
+ <property name="schema-key">show-right-margin</property>
+ <binding name="path-suffix">
+ <lookup name="id" type="GtkSourceLanguage">
+ <lookup name="item">language_page_factory</lookup>
+ </lookup>
+ </binding>
+ </object>
+ </property>
</object>
</child>
</object>
diff --git a/src/libide/tweaks/ide-tweaks-switch.c b/src/libide/tweaks/ide-tweaks-switch.c
index f89d844d1..9bdae086e 100644
--- a/src/libide/tweaks/ide-tweaks-switch.c
+++ b/src/libide/tweaks/ide-tweaks-switch.c
@@ -31,16 +31,12 @@ struct _IdeTweaksSwitch
IdeTweaksWidget parent_instance;
char *title;
char *subtitle;
- char *action_name;
- GVariant *action_target;
};
enum {
PROP_0,
PROP_TITLE,
PROP_SUBTITLE,
- PROP_ACTION_NAME,
- PROP_ACTION_TARGET,
N_PROPS
};
@@ -53,15 +49,17 @@ ide_tweaks_switch_create_for_item (IdeTweaksWidget *instance,
IdeTweaksItem *widget)
{
IdeTweaksSwitch *self = (IdeTweaksSwitch *)widget;
+ IdeTweaksBinding *binding;
AdwActionRow *row;
GtkSwitch *switch_;
g_assert (IDE_IS_TWEAKS_WIDGET (widget));
+ if (!(binding = ide_tweaks_widget_get_binding (IDE_TWEAKS_WIDGET (self))))
+ return NULL;
+
switch_ = g_object_new (GTK_TYPE_SWITCH,
"valign", GTK_ALIGN_CENTER,
- "action-name", self->action_name,
- "action-target", self->action_target,
NULL);
row = g_object_new (ADW_TYPE_ACTION_ROW,
"title", self->title,
@@ -69,6 +67,7 @@ ide_tweaks_switch_create_for_item (IdeTweaksWidget *instance,
"activatable-widget", switch_,
NULL);
adw_action_row_add_suffix (row, GTK_WIDGET (switch_));
+ ide_tweaks_binding_bind (binding, switch_, "active");
return GTK_WIDGET (row);
}
@@ -80,8 +79,6 @@ ide_tweaks_switch_dispose (GObject *object)
g_clear_pointer (&self->title, g_free);
g_clear_pointer (&self->subtitle, g_free);
- g_clear_pointer (&self->action_name, g_free);
- g_clear_pointer (&self->action_target, g_variant_unref);
G_OBJECT_CLASS (ide_tweaks_switch_parent_class)->dispose (object);
}
@@ -96,14 +93,6 @@ ide_tweaks_switch_get_property (GObject *object,
switch (prop_id)
{
- case PROP_ACTION_NAME:
- g_value_set_string (value, ide_tweaks_switch_get_action_name (self));
- break;
-
- case PROP_ACTION_TARGET:
- g_value_set_variant (value, ide_tweaks_switch_get_action_target (self));
- break;
-
case PROP_SUBTITLE:
g_value_set_string (value, ide_tweaks_switch_get_subtitle (self));
break;
@@ -127,14 +116,6 @@ ide_tweaks_switch_set_property (GObject *object,
switch (prop_id)
{
- case PROP_ACTION_NAME:
- ide_tweaks_switch_set_action_name (self, g_value_get_string (value));
- break;
-
- case PROP_ACTION_TARGET:
- ide_tweaks_switch_set_action_target (self, g_value_get_variant (value));
- break;
-
case PROP_SUBTITLE:
ide_tweaks_switch_set_subtitle (self, g_value_get_string (value));
break;
@@ -160,17 +141,6 @@ ide_tweaks_switch_class_init (IdeTweaksSwitchClass *klass)
widget_class->create_for_item = ide_tweaks_switch_create_for_item;
- properties[PROP_ACTION_NAME] =
- g_param_spec_string ("action-name", NULL, NULL,
- NULL,
- (G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS));
-
- properties[PROP_ACTION_TARGET] =
- g_param_spec_variant ("action-target", NULL, NULL,
- G_VARIANT_TYPE_ANY,
- NULL,
- (G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS));
-
properties[PROP_SUBTITLE] =
g_param_spec_string ("subtitle", NULL, NULL,
NULL,
@@ -189,28 +159,6 @@ ide_tweaks_switch_init (IdeTweaksSwitch *self)
{
}
-const char *
-ide_tweaks_switch_get_action_name (IdeTweaksSwitch *self)
-{
- g_return_val_if_fail (IDE_IS_TWEAKS_SWITCH (self), NULL);
-
- return self->action_name;
-}
-
-/**
- * ide_tweaks_switch_get_action_target:
- * @self: a #IdeTweaksSwitch
- *
- * Returns: (transfer none) (nullable): a #GVariant or %NULL
- */
-GVariant *
-ide_tweaks_switch_get_action_target (IdeTweaksSwitch *self)
-{
- g_return_val_if_fail (IDE_IS_TWEAKS_SWITCH (self), NULL);
-
- return self->action_target;
-}
-
const char *
ide_tweaks_switch_get_subtitle (IdeTweaksSwitch *self)
{
@@ -219,51 +167,27 @@ ide_tweaks_switch_get_subtitle (IdeTweaksSwitch *self)
return self->subtitle;
}
-const char *
-ide_tweaks_switch_get_title (IdeTweaksSwitch *self)
-{
- g_return_val_if_fail (IDE_IS_TWEAKS_SWITCH (self), NULL);
-
- return self->title;
-}
-
-void
-ide_tweaks_switch_set_action_name (IdeTweaksSwitch *self,
- const char *action_name)
-{
- g_return_if_fail (IDE_IS_TWEAKS_SWITCH (self));
-
- if (ide_set_string (&self->action_name, action_name))
- g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_ACTION_NAME]);
-}
-
void
-ide_tweaks_switch_set_action_target (IdeTweaksSwitch *self,
- GVariant *action_target)
+ide_tweaks_switch_set_subtitle (IdeTweaksSwitch *self,
+ const char *subtitle)
{
g_return_if_fail (IDE_IS_TWEAKS_SWITCH (self));
- if (action_target == self->action_target)
- return;
-
- g_clear_pointer (&self->action_target, g_variant_unref);
- self->action_target = action_target ? g_variant_ref_sink (action_target) : NULL;
- g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_ACTION_TARGET]);
+ if (ide_set_string (&self->subtitle, subtitle))
+ g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_SUBTITLE]);
}
-void
-ide_tweaks_switch_set_subtitle (IdeTweaksSwitch *self,
- const char *subtitle)
+const char *
+ide_tweaks_switch_get_title (IdeTweaksSwitch *self)
{
- g_return_if_fail (IDE_IS_TWEAKS_SWITCH (self));
+ g_return_val_if_fail (IDE_IS_TWEAKS_SWITCH (self), NULL);
- if (ide_set_string (&self->subtitle, subtitle))
- g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_SUBTITLE]);
+ return self->title;
}
void
ide_tweaks_switch_set_title (IdeTweaksSwitch *self,
- const char *title)
+ const char *title)
{
g_return_if_fail (IDE_IS_TWEAKS_SWITCH (self));
diff --git a/src/libide/tweaks/ide-tweaks-switch.h b/src/libide/tweaks/ide-tweaks-switch.h
index f2250edb1..350e43256 100644
--- a/src/libide/tweaks/ide-tweaks-switch.h
+++ b/src/libide/tweaks/ide-tweaks-switch.h
@@ -30,26 +30,16 @@ IDE_AVAILABLE_IN_ALL
G_DECLARE_FINAL_TYPE (IdeTweaksSwitch, ide_tweaks_switch, IDE, TWEAKS_SWITCH, IdeTweaksWidget)
IDE_AVAILABLE_IN_ALL
-IdeTweaksSwitch *ide_tweaks_switch_new (void);
+IdeTweaksSwitch *ide_tweaks_switch_new (void);
IDE_AVAILABLE_IN_ALL
-const char *ide_tweaks_switch_get_title (IdeTweaksSwitch *self);
+const char *ide_tweaks_switch_get_title (IdeTweaksSwitch *self);
IDE_AVAILABLE_IN_ALL
-void ide_tweaks_switch_set_title (IdeTweaksSwitch *self,
- const char *title);
+void ide_tweaks_switch_set_title (IdeTweaksSwitch *self,
+ const char *title);
IDE_AVAILABLE_IN_ALL
-const char *ide_tweaks_switch_get_subtitle (IdeTweaksSwitch *self);
+const char *ide_tweaks_switch_get_subtitle (IdeTweaksSwitch *self);
IDE_AVAILABLE_IN_ALL
-void ide_tweaks_switch_set_subtitle (IdeTweaksSwitch *self,
- const char *subtitle);
-IDE_AVAILABLE_IN_ALL
-const char *ide_tweaks_switch_get_action_name (IdeTweaksSwitch *self);
-IDE_AVAILABLE_IN_ALL
-void ide_tweaks_switch_set_action_name (IdeTweaksSwitch *self,
- const char *action_name);
-IDE_AVAILABLE_IN_ALL
-GVariant *ide_tweaks_switch_get_action_target (IdeTweaksSwitch *self);
-IDE_AVAILABLE_IN_ALL
-void ide_tweaks_switch_set_action_target (IdeTweaksSwitch *self,
- GVariant *action_target);
+void ide_tweaks_switch_set_subtitle (IdeTweaksSwitch *self,
+ const char *subtitle);
G_END_DECLS
diff --git a/src/plugins/buildui/tweaks.ui b/src/plugins/buildui/tweaks.ui
index 3e99ad119..220ead4f5 100644
--- a/src/plugins/buildui/tweaks.ui
+++ b/src/plugins/buildui/tweaks.ui
@@ -24,14 +24,24 @@
<object class="IdeTweaksSwitch">
<property name="title" translatable="yes">Clear Expired Artifacts</property>
<property name="subtitle" translatable="yes">Artifacts which have expired will be
deleted when Builder is started</property>
- <property
name="action-name">settings.org.gnome.builder.clear-cache-at-startup</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder</property>
+ <property name="schema-key">clear-cache-at-startup</property>
+ </object>
+ </property>
</object>
</child>
<child>
<object class="IdeTweaksSwitch">
<property name="title" translatable="yes">Clear Build Logs</property>
<property name="subtitle" translatable="yes">Clear the build log history when a new
build begins</property>
- <property
name="action-name">settings.org.gnome.builder.build.clear-build-log-pane</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.build</property>
+ <property name="schema-key">clear-build-log-pane</property>
+ </object>
+ </property>
</object>
</child>
</object>
diff --git a/src/plugins/clang/tweaks.ui b/src/plugins/clang/tweaks.ui
index 06767401c..5685b1a88 100644
--- a/src/plugins/clang/tweaks.ui
+++ b/src/plugins/clang/tweaks.ui
@@ -9,12 +9,6 @@
<object class="IdeTweaksSection">
<child internal-child="editor_code_completion_page">
<object class="IdeTweaksPage">
- <child>
- <object class="IdeTweaksSettings" id="settings_org_gnome_builder_clang">
- <property name="schema-id">org.gnome.builder.clang</property>
- <property name="application-only">true</property>
- </object>
- </child>
<child>
<object class="IdeTweaksGroup">
<property name="title" translatable="yes">Clang</property>
@@ -22,14 +16,24 @@
<object class="IdeTweaksSwitch">
<property name="title" translatable="yes">Complete Parentheses</property>
<property name="subtitle" translatable="yes">Include parentheses when completing
clang proposals</property>
- <property
name="action-name">settings.org.gnome.builder.clang.complete-parens</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.clang</property>
+ <property name="schema-key">complete-parens</property>
+ </object>
+ </property>
</object>
</child>
<child>
<object class="IdeTweaksSwitch">
<property name="title" translatable="yes">Complete Parameters</property>
<property name="subtitle" translatable="yes">Include parameters and type
information when completing clang proposals</property>
- <property
name="action-name">settings.org.gnome.builder.clang.complete-params</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.clang</property>
+ <property name="schema-key">complete-params</property>
+ </object>
+ </property>
</object>
</child>
</object>
diff --git a/src/plugins/copyright/tweaks.ui b/src/plugins/copyright/tweaks.ui
index 34078c9cc..95df385e3 100644
--- a/src/plugins/copyright/tweaks.ui
+++ b/src/plugins/copyright/tweaks.ui
@@ -9,19 +9,18 @@
<object class="IdeTweaksSection">
<child internal-child="editor_session_page">
<object class="IdeTweaksPage">
- <child>
- <object class="IdeTweaksSettings" id="settings_org_gnome_builder_copyright">
- <property name="schema-id">org.gnome.builder.copyright</property>
- <property name="application-only">true</property>
- </object>
- </child>
<child>
<object class="IdeTweaksGroup">
<child>
<object class="IdeTweaksSwitch">
<property name="title" translatable="yes">Update Copyright</property>
<property name="subtitle" translatable="yes">Update copyright headers when
saving documents</property>
- <property
name="action-name">settings.org.gnome.builder.copyright.update-on-save</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.copyright</property>
+ <property name="schema-key">update-on-save</property>
+ </object>
+ </property>
</object>
</child>
</object>
diff --git a/src/plugins/ctags/tweaks.ui b/src/plugins/ctags/tweaks.ui
index 30c72f800..1096755ee 100644
--- a/src/plugins/ctags/tweaks.ui
+++ b/src/plugins/ctags/tweaks.ui
@@ -16,7 +16,12 @@
<object class="IdeTweaksSwitch">
<property name="title" translatable="yes">Suggest Completions</property>
<property name="subtitle" translatable="yes">Use CTags to suggest code
completion proposals</property>
- <property
name="action-name">settings.org.gnome.builder.code-insight.ctags-autocompletion</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.code-insight</property>
+ <property name="schema-key">ctags-autocompletion</property>
+ </object>
+ </property>
</object>
</child>
</object>
diff --git a/src/plugins/debuggerui/tweaks.ui b/src/plugins/debuggerui/tweaks.ui
index 5730d94ed..c10455d8e 100644
--- a/src/plugins/debuggerui/tweaks.ui
+++ b/src/plugins/debuggerui/tweaks.ui
@@ -9,11 +9,6 @@
<object class="IdeTweaksPage" id="debugger_page">
<property name="title" translatable="yes">Debugger</property>
<property name="icon-name">builder-debugger-symbolic</property>
- <child>
- <object class="IdeTweaksSettings">
- <property name="schema-id">org.gnome.builder.debug</property>
- </object>
- </child>
<child>
<object class="IdeTweaksGroup" id="breakpoints_group">
<property name="title" translatable="yes">Breakpoints</property>
@@ -21,21 +16,37 @@
<object class="IdeTweaksSwitch">
<property name="title" translatable="yes">Stop After Launching Program</property>
<property name="subtitle" translatable="yes">Automatically insert a breakpoint at
the start of the application</property>
- <property
name="action-name">settings.org.gnome.builder.debug.insert-breakpoint-at-main</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.debug</property>
+ <property name="schema-key">insert-breakpoint-at-main</property>
+ </object>
+ </property>
</object>
</child>
<child>
<object class="IdeTweaksSwitch">
<property name="title" translatable="yes">Stop at Warnings</property>
<property name="subtitle" translatable="yes">Automatically insert a breakpoint on
warning logs</property>
- <property
name="action-name">settings.org.gnome.builder.debug.insert-breakpoint-at-warnings</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.debug</property>
+ <property name="schema-key">insert-breakpoint-at-warnings</property>
+ </object>
+ </property>
</object>
</child>
<child>
<object class="IdeTweaksSwitch">
<property name="title" translatable="yes">Stop at Criticals</property>
<property name="subtitle" translatable="yes">Automatically insert a breakpoint on
critical logs</property>
- <property
name="action-name">settings.org.gnome.builder.debug.insert-breakpoint-at-criticals</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.debug</property>
+ <property name="schema-key">insert-breakpoint-at-main</property>
+ <property name="schema-key">insert-breakpoint-at-criticals</property>
+ </object>
+ </property>
</object>
</child>
</object>
diff --git a/src/plugins/editorui/tweaks-language.ui b/src/plugins/editorui/tweaks-language.ui
index 1680544cf..b56375574 100644
--- a/src/plugins/editorui/tweaks-language.ui
+++ b/src/plugins/editorui/tweaks-language.ui
@@ -27,19 +27,6 @@
<lookup name="item">language_page_factory</lookup>
</lookup>
</binding>
- <child>
- <object class="IdeTweaksSettings" id="language_page_settings">
- <property name="schema-id">org.gnome.builder.editor.language</property>
- <binding name="schema-path">
- <closure type="gchararray" function="format">
- <constant type="gchararray">/org/gnome/builder/editor/language/%s/</constant>
- <lookup name="id" type="GtkSourceLanguage">
- <lookup name="item">language_page_factory</lookup>
- </lookup>
- </closure>
- </binding>
- </object>
- </child>
<child>
<object class="IdeTweaksGroup" id="language_top_group">
<child>
@@ -85,14 +72,34 @@
<object class="IdeTweaksSwitch" id="insert_trailing_newline">
<property name="title" translatable="yes">Insert Trailing Newline</property>
<property name="subtitle" translatable="yes">Ensure files end with a
newline</property>
- <property
name="action-name">settings.org.gnome.builder.editor.language.insert-trailing-newline</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.editor.language</property>
+ <property name="schema-key">insert-trailing-newline</property>
+ <binding name="path-suffix">
+ <lookup name="id" type="GtkSourceLanguage">
+ <lookup name="item">language_page_factory</lookup>
+ </lookup>
+ </binding>
+ </object>
+ </property>
</object>
</child>
<child>
<object class="IdeTweaksSwitch" id="trim_whitespace">
<property name="title" translatable="yes">Trim Trailing Space</property>
<property name="subtitle" translatable="yes">Upon saving, trailing
whitespace from modified lines will be trimmed</property>
- <property
name="action-name">settings.org.gnome.builder.editor.language.trim-trailing-whitespace</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.editor.language</property>
+ <property name="schema-key">trim-trailing-whitespace</property>
+ <binding name="path-suffix">
+ <lookup name="id" type="GtkSourceLanguage">
+ <lookup name="item">language_page_factory</lookup>
+ </lookup>
+ </binding>
+ </object>
+ </property>
</object>
</child>
</object>
@@ -103,7 +110,17 @@
<object class="IdeTweaksSwitch" id="auto_indent">
<property name="title" translatable="yes">Auto Indent</property>
<property name="subtitle" translatable="yes">Automatically indent source
code as you type</property>
- <property
name="action-name">settings.org.gnome.builder.editor.language.auto-indent</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.editor.language</property>
+ <property name="schema-key">auto-indent</property>
+ <binding name="path-suffix">
+ <lookup name="id" type="GtkSourceLanguage">
+ <lookup name="item">language_page_factory</lookup>
+ </lookup>
+ </binding>
+ </object>
+ </property>
</object>
</child>
<child>
@@ -149,7 +166,17 @@
<object class="IdeTweaksSwitch" id="show_right_margin">
<property name="title" translatable="yes">Show Right Margin</property>
<property name="subtitle" translatable="yes">Display a margin in the editor
to indicate maximum desired width</property>
- <property
name="action-name">settings.org.gnome.builder.editor.language.show-right-margin</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.editor.language</property>
+ <property name="schema-key">show-right-margin</property>
+ <binding name="path-suffix">
+ <lookup name="id" type="GtkSourceLanguage">
+ <lookup name="item">language_page_factory</lookup>
+ </lookup>
+ </binding>
+ </object>
+ </property>
</object>
</child>
<child>
@@ -178,14 +205,34 @@
<object class="IdeTweaksSwitch" id="overwrite_braces">
<property name="title" translatable="yes">Overwrite Braces</property>
<property name="subtitle" translatable="yes">Overwrite closing braces,
brackets, parenthesis, and quotes</property>
- <property
name="action-name">settings.org.gnome.builder.editor.language.overwrite-braces</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.editor.language</property>
+ <property name="schema-key">overwrite-braces</property>
+ <binding name="path-suffix">
+ <lookup name="id" type="GtkSourceLanguage">
+ <lookup name="item">language_page_factory</lookup>
+ </lookup>
+ </binding>
+ </object>
+ </property>
</object>
</child>
<child>
<object class="IdeTweaksSwitch" id="insert_matching_braces">
<property name="title" translatable="yes">Insert Matching Brace</property>
<property name="subtitle" translatable="yes">Insert matching character for
braces, brackets, parenthesis, and quotes</property>
- <property
name="action-name">settings.org.gnome.builder.editor.language.insert-matching-brace</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.editor.language</property>
+ <property name="schema-key">insert-matching-brace</property>
+ <binding name="path-suffix">
+ <lookup name="id" type="GtkSourceLanguage">
+ <lookup name="item">language_page_factory</lookup>
+ </lookup>
+ </binding>
+ </object>
+ </property>
</object>
</child>
</object>
diff --git a/src/plugins/editorui/tweaks.ui b/src/plugins/editorui/tweaks.ui
index 62199e822..1feaa8ba4 100644
--- a/src/plugins/editorui/tweaks.ui
+++ b/src/plugins/editorui/tweaks.ui
@@ -1,24 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="IdeTweaks">
- <child>
- <object class="IdeTweaksSettings" id="settings_org_gnome_builder_editor">
- <property name="schema-id">org.gnome.builder.editor</property>
- <property name="application-only">true</property>
- </object>
- </child>
- <child>
- <object class="IdeTweaksSettings" id="settings_org_gnome_builder_spelling">
- <property name="schema-id">org.gnome.builder.spelling</property>
- <property name="application-only">true</property>
- </object>
- </child>
- <child>
- <object class="IdeTweaksSettings" id="settings_org_gnome_builder_code_insight">
- <property name="schema-id">org.gnome.builder.code-insight</property>
- <property name="application-only">true</property>
- </object>
- </child>
<child internal-child="visual_section">
<object class="IdeTweaksSection">
<child internal-child="appearance_page">
@@ -192,21 +174,36 @@
<object class="IdeTweaksSwitch" id="editor_show_lines">
<property name="title" translatable="yes">Show Line Numbers</property>
<property name="subtitle" translatable="yes">Display line numbers next to each
line of code</property>
- <property
name="action-name">settings.org.gnome.builder.editor.show-line-numbers</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.editor</property>
+ <property name="schema-key">show-line-numbers</property>
+ </object>
+ </property>
</object>
</child>
<child>
<object class="IdeTweaksSwitch" id="editor_show_relative_lines">
<property name="title" translatable="yes">Use Relative Line Numbers</property>
<property name="subtitle" translatable="yes">Show line numbers relative to the
current line</property>
- <property
name="action-name">settings.org.gnome.builder.editor.show-relative-line-numbers</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.editor</property>
+ <property name="schema-key">show-relative-line-numbers</property>
+ </object>
+ </property>
</object>
</child>
<child>
<object class="IdeTweaksSwitch" id="editor_show_diagnostics">
<property name="title" translatable="yes">Show Diagnostics</property>
<property name="subtitle" translatable="yes">Display diagnostics next to the
line number</property>
- <property
name="action-name">settings.org.gnome.builder.editor.show-line-diagnostics</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.editor</property>
+ <property name="schema-key">show-line-diagnostics</property>
+ </object>
+ </property>
</object>
</child>
</object>
@@ -218,21 +215,36 @@
<object class="IdeTweaksSwitch" id="editor_highlight_line">
<property name="title" translatable="yes">Highlight Current Line</property>
<property name="subtitle" translatable="yes">Make the current line stand out
with highlights</property>
- <property
name="action-name">settings.org.gnome.builder.editor.highlight-current-line</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.editor</property>
+ <property name="schema-key">highlight-current-line</property>
+ </object>
+ </property>
</object>
</child>
<child>
<object class="IdeTweaksSwitch" id="editor_highlight_brackets">
<property name="title" translatable="yes">Highlight Matching Brackets</property>
<property name="subtitle" translatable="yes">Use cursor position to highlight
matching brackets, braces, parenthesis, and more</property>
- <property
name="action-name">settings.org.gnome.builder.editor.highlight-matching-brackets</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.editor</property>
+ <property name="schema-key">highlight-matching-brackets</property>
+ </object>
+ </property>
</object>
</child>
<child>
<object class="IdeTweaksSwitch" id="editor_semantic_highlight">
<property name="title" translatable="yes">Semantic Highlighting</property>
<property name="subtitle" translatable="yes">Use symbol information to highlight
namespaces, functions, and variables within source code</property>
- <property
name="action-name">settings.org.gnome.builder.code-insight.semantic-highlighting</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.code-insight</property>
+ <property name="schema-key">semantic-highlighting</property>
+ </object>
+ </property>
</object>
</child>
</object>
@@ -250,7 +262,12 @@
<object class="IdeTweaksSwitch">
<property name="title" translatable="yes">Check Spelling</property>
<property name="subtitle" translatable="yes">Underline potential spelling
mistakes as you type</property>
- <property
name="action-name">settings.org.gnome.builder.spelling.check-spelling</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.spelling</property>
+ <property name="schema-key">check-spelling</property>
+ </object>
+ </property>
</object>
</child>
</object>
@@ -279,7 +296,12 @@
<object class="IdeTweaksSwitch" id="enable_snippets">
<property name="title" translatable="yes">Expand Snippets</property>
<property name="subtitle" translatable="yes">Use “Tab” to expand configured
snippets in the editor</property>
- <property
name="action-name">settings.org.gnome.builder.editor.enable-snippets</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.editor</property>
+ <property name="schema-key">enable-snippets</property>
+ </object>
+ </property>
</object>
</child>
</object>
@@ -297,14 +319,24 @@
<object class="IdeTweaksSwitch" id="suggest_code_completions">
<property name="title" translatable="yes">Suggest Code Completions</property>
<property name="subtitle" translatable="yes">Automatically suggest code
completions while typing</property>
- <property
name="action-name">settings.org.gnome.builder.editor.interactive-completion</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.editor</property>
+ <property name="schema-key">interactive-completion</property>
+ </object>
+ </property>
</object>
</child>
<child>
<object class="IdeTweaksSwitch" id="select_first_completion">
<property name="title" translatable="yes">Select First Completion
Proposal</property>
<property name="subtitle" translatable="yes">Automatically select the first
completion proposal when displayed</property>
- <property
name="action-name">settings.org.gnome.builder.editor.select-first-completion</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.editor</property>
+ <property name="schema-key">select-first-completion</property>
+ </object>
+ </property>
</object>
</child>
</object>
@@ -361,7 +393,12 @@
<object class="IdeTweaksSwitch" id="smart_backspace">
<property name="title" translatable="yes">Smart Backspace</property>
<property name="subtitle" translatable="yes">Backspace will remove extra space
to keep you aligned with your indentation</property>
- <property
name="action-name">settings.org.gnome.builder.editor.smart-backspace</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.editor</property>
+ <property name="schema-key">smart-backspace</property>
+ </object>
+ </property>
</object>
</child>
<child>
@@ -415,7 +452,12 @@
<object class="IdeTweaksSwitch">
<property name="title" translatable="yes">Auto-Save</property>
<property name="subtitle" translatable="yes">Regularly save the document as you
type</property>
- <property
name="action-name">settings.org.gnome.builder.editor.auto-save</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.editor</property>
+ <property name="schema-key">auto-save</property>
+ </object>
+ </property>
</object>
</child>
<child>
@@ -438,7 +480,12 @@
<object class="IdeTweaksSwitch">
<property name="title" translatable="yes">Format on Save</property>
<property name="subtitle" translatable="yes">Reformat sources when saving to
disk</property>
- <property name="action-name">settings.org.gnome.builder.format-on-save</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder</property>
+ <property name="schema-key">format-on-save</property>
+ </object>
+ </property>
</object>
</child>
</object>
@@ -449,7 +496,12 @@
<object class="IdeTweaksSwitch">
<property name="title" translatable="yes">Restore Cursor Position</property>
<property name="subtitle" translatable="yes">Jump to the last position when
re-opening a file</property>
- <property
name="action-name">settings.org.gnome.builder.editor.restore-insert-mark</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.editor</property>
+ <property name="schema-key">restore-insert-mark</property>
+ </object>
+ </property>
</object>
</child>
</object>
diff --git a/src/plugins/project-tree/tweaks.ui b/src/plugins/project-tree/tweaks.ui
index d183168b0..6c2847762 100644
--- a/src/plugins/project-tree/tweaks.ui
+++ b/src/plugins/project-tree/tweaks.ui
@@ -18,21 +18,36 @@
<object class="IdeTweaksSwitch">
<property name="title" translatable="yes">Show Icons</property>
<property name="subtitle" translatable="yes">Display icons next to files within the
project tree</property>
- <property
name="action-name">settings.org.gnome.builder.project-tree.show-icons</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.project-tree</property>
+ <property name="schema-key">show-icons</property>
+ </object>
+ </property>
</object>
</child>
<child>
<object class="IdeTweaksSwitch">
<property name="title" translatable="yes">Show Ignored Files</property>
<property name="subtitle" translatable="yes">Show files which are typically
ignored</property>
- <property
name="action-name">settings.org.gnome.builder.project-tree.show-ignored-files</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.project-tree</property>
+ <property name="schema-key">show-ignored-files</property>
+ </object>
+ </property>
</object>
</child>
<child>
<object class="IdeTweaksSwitch">
<property name="title" translatable="yes">Sort Directories First</property>
<property name="subtitle" translatable="yes">Sort directories before files in the same
directory</property>
- <property
name="action-name">settings.org.gnome.builder.project-tree.sort-directories-first</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.project-tree</property>
+ <property name="schema-key">sort-directories-first</property>
+ </object>
+ </property>
</object>
</child>
</object>
diff --git a/src/plugins/projectui/tweaks.ui b/src/plugins/projectui/tweaks.ui
index d9d2a76b0..0d8a41297 100644
--- a/src/plugins/projectui/tweaks.ui
+++ b/src/plugins/projectui/tweaks.ui
@@ -13,7 +13,12 @@
<object class="IdeTweaksSwitch">
<property name="title" translatable="yes">Restore Previous Session</property>
<property name="subtitle" translatable="yes">Open previously opened files when loading a
project</property>
- <property name="action-name">settings.org.gnome.builder.restore-previous-files</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder</property>
+ <property name="schema-key">restore-previous-files</property>
+ </object>
+ </property>
</object>
</child>
</object>
diff --git a/src/plugins/sdkui/tweaks.ui b/src/plugins/sdkui/tweaks.ui
index 4565ef83c..fac90c52a 100644
--- a/src/plugins/sdkui/tweaks.ui
+++ b/src/plugins/sdkui/tweaks.ui
@@ -14,7 +14,12 @@
<object class="IdeTweaksSwitch">
<property name="title" translatable="yes">Download on Metered Connections</property>
<property name="subtitle" translatable="yes">Allow the download of SDKs and dependencies
when on metered internet connections</property>
- <property
name="action-name">settings.org.gnome.builder.build.allow-network-when-metered</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.build</property>
+ <property name="schema-key">allow-network-when-metered</property>
+ </object>
+ </property>
</object>
</child>
</object>
diff --git a/src/plugins/terminal/tweaks.ui b/src/plugins/terminal/tweaks.ui
index f3e3a4399..9548eafdc 100644
--- a/src/plugins/terminal/tweaks.ui
+++ b/src/plugins/terminal/tweaks.ui
@@ -1,12 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="IdeTweaks">
- <child>
- <object class="IdeTweaksSettings" id="settings_org_gnome_builder_terminal">
- <property name="schema-id">org.gnome.builder.terminal</property>
- <property name="application-only">true</property>
- </object>
- </child>
<child internal-child="visual_section">
<object class="IdeTweaksSection">
<child internal-child="terminal_page">
@@ -34,14 +28,24 @@
<object class="IdeTweaksSwitch">
<property name="title" translatable="yes">Allow Bold</property>
<property name="subtitle" translatable="yes">Allows the use of bold escape
sequences</property>
- <property name="action-name">settings.org.gnome.builder.terminal.allow-bold</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.terminal</property>
+ <property name="schema-key">allow-bold</property>
+ </object>
+ </property>
</object>
</child>
<child>
<object class="IdeTweaksSwitch">
<property name="title" translatable="yes">Allow Hyperlinks</property>
<property name="subtitle" translatable="yes">Allows the use of hyperlink escape
sequences</property>
- <property
name="action-name">settings.org.gnome.builder.terminal.allow-hyperlink</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.terminal</property>
+ <property name="schema-key">allow-hyperlink</property>
+ </object>
+ </property>
</object>
</child>
</object>
@@ -53,14 +57,24 @@
<object class="IdeTweaksSwitch">
<property name="title" translatable="yes">Scroll On Output</property>
<property name="subtitle" translatable="yes">Automatically scroll when applications
within the terminal output text</property>
- <property
name="action-name">settings.org.gnome.builder.terminal.scroll-on-output</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.terminal</property>
+ <property name="schema-key">scroll-on-output</property>
+ </object>
+ </property>
</object>
</child>
<child>
<object class="IdeTweaksSwitch">
<property name="title" translatable="yes">Scroll On Keyboard Input</property>
<property name="subtitle" translatable="yes">Automatically scroll when typing to insert
text</property>
- <property
name="action-name">settings.org.gnome.builder.terminal.scroll-on-keystroke</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.terminal</property>
+ <property name="schema-key">scroll-on-keystroke</property>
+ </object>
+ </property>
</object>
</child>
</object>
@@ -72,7 +86,12 @@
<object class="IdeTweaksSwitch">
<property name="title" translatable="yes">Limit Scrollback</property>
<property name="subtitle" translatable="yes">Limit the number of lines that are stored
in memory for terminal scrollback</property>
- <property
name="action-name">settings.org.gnome.builder.terminal.limit-scrollback</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.terminal</property>
+ <property name="schema-key">limit-scrollback</property>
+ </object>
+ </property>
</object>
</child>
<child>
@@ -81,7 +100,7 @@
<property name="subtitle" translatable="yes">The maximum number of lines stored in
history when limiting scrollback</property>
<property name="binding">
<object class="IdeTweaksSetting">
- <property name="schema-id">org.gnome.builder.editor.terminal</property>
+ <property name="schema-id">org.gnome.builder.terminal</property>
<property name="schema-key">scrollback-lines</property>
</object>
</property>
diff --git a/src/plugins/valgrind/tweaks.ui b/src/plugins/valgrind/tweaks.ui
index 217139bff..14e4b8946 100644
--- a/src/plugins/valgrind/tweaks.ui
+++ b/src/plugins/valgrind/tweaks.ui
@@ -1,12 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="IdeTweaks">
- <child>
- <object class="IdeTweaksSettings" id="settings_org_gnome_builder_valgrind">
- <property name="schema-id">org.gnome.builder.valgrind</property>
- <property name="application-only">true</property>
- </object>
- </child>
<child internal-child="foundry_section">
<object class="IdeTweaksSection">
<child internal-child="build_page">
@@ -74,7 +68,12 @@
<object class="IdeTweaksSwitch">
<property name="title" translatable="yes">Track Origins</property>
<property name="subtitle" translatable="yes">Show origin of undefined
values</property>
- <property
name="action-name">settings.org.gnome.builder.valgrind.track-origins</property>
+ <property name="binding">
+ <object class="IdeTweaksSetting">
+ <property name="schema-id">org.gnome.builder.valgrind</property>
+ <property name="schema-key">track-origins</property>
+ </object>
+ </property>
</object>
</child>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]