[gnome-builder] plugins: port IdeTweaksCombo to using binding objects



commit b5c1dca74f4f741ec47c09341b076d8b7c3d2ae2
Author: Christian Hergert <chergert redhat com>
Date:   Wed Aug 24 21:52:55 2022 -0700

    plugins: port IdeTweaksCombo to using binding objects

 src/plugins/buildui/tweaks.ui           |  8 +++++--
 src/plugins/editorui/tweaks-language.ui | 13 +++++++++--
 src/plugins/editorui/tweaks.ui          | 40 ++++++++++++++++++++++++---------
 src/plugins/platformui/tweaks.ui        |  8 +++++--
 src/plugins/projectui/tweaks.ui         |  8 +++++--
 src/plugins/rust-analyzer/tweaks.ui     |  8 +++++--
 src/plugins/sysprof/tweaks.ui           |  8 +++++--
 src/plugins/valgrind/tweaks.ui          |  8 +++++--
 8 files changed, 77 insertions(+), 24 deletions(-)
---
diff --git a/src/plugins/buildui/tweaks.ui b/src/plugins/buildui/tweaks.ui
index 0d2ae9385..3e99ad119 100644
--- a/src/plugins/buildui/tweaks.ui
+++ b/src/plugins/buildui/tweaks.ui
@@ -43,8 +43,12 @@
                       <object class="IdeTweaksCombo">
                         <property name="title" translatable="yes">Build Parallelism</property>
                         <property name="subtitle" translatable="yes">Number of workers to use when 
performing builds</property>
-                        <property name="settings">settings_org_gnome_builder_build</property>
-                        <property name="key">parallel</property>
+                        <property name="binding">
+                          <object class="IdeTweaksSetting">
+                            <property name="schema-id">org.gnome.builder.build</property>
+                            <property name="schema-key">parallel</property>
+                          </object>
+                        </property>
                         <child>
                           <object class="IdeTweaksChoice">
                             <property name="title" translatable="yes">Default</property>
diff --git a/src/plugins/editorui/tweaks-language.ui b/src/plugins/editorui/tweaks-language.ui
index db2b27a9b..adf4e332d 100644
--- a/src/plugins/editorui/tweaks-language.ui
+++ b/src/plugins/editorui/tweaks-language.ui
@@ -56,8 +56,17 @@
                               <object class="IdeTweaksCombo" id="insert_spaces_instead_of_tabs">
                                 <property name="title" translatable="yes">Tab Character</property>
                                 <property name="subtitle" translatable="yes">The character to be inserted 
for Tab</property>
-                                <property name="settings">language_page_settings</property>
-                                <property name="key">insert-spaces-instead-of-tabs</property>
+                                <property name="binding">
+                                  <object class="IdeTweaksSetting">
+                                    <property name="schema-id">org.gnome.builder.editor.language</property>
+                                    <property name="schema-key">insert-spaces-instead-of-tabs</property>
+                                    <binding name="path-suffix">
+                                      <lookup name="id" type="GtkSourceLanguage">
+                                        <lookup name="item">language_page_factory</lookup>
+                                      </lookup>
+                                    </binding>
+                                  </object>
+                                </property>
                                 <child>
                                   <object class="IdeTweaksChoice" id="tab_choice">
                                     <property name="title" translatable="yes">Tab</property>
diff --git a/src/plugins/editorui/tweaks.ui b/src/plugins/editorui/tweaks.ui
index 89b795c72..be9ed4705 100644
--- a/src/plugins/editorui/tweaks.ui
+++ b/src/plugins/editorui/tweaks.ui
@@ -85,8 +85,12 @@
                           <object class="IdeTweaksCombo">
                             <property name="title" translatable="yes">Wrap Text</property>
                             <property name="subtitle" translatable="yes">How text should be wrapped when 
wider than the frame</property>
-                            <property name="settings">settings_org_gnome_builder_editor</property>
-                            <property name="key">wrap-text</property>
+                            <property name="binding">
+                              <object class="IdeTweaksSetting">
+                                <property name="schema-id">org.gnome.builder.editor</property>
+                                <property name="schema-key">wrap-text</property>
+                              </object>
+                            </property>
                             <child>
                               <object class="IdeTweaksChoice">
                                 <property name="title" translatable="yes">Never</property>
@@ -115,8 +119,12 @@
                           <object class="IdeTweaksCombo" id="editor_grid_lines">
                             <property name="title" translatable="yes">Background Pattern</property>
                             <property name="subtitle" translatable="yes">Show a background pattern 
underneath source code</property>
-                            <property name="settings">settings_org_gnome_builder_editor</property>
-                            <property name="key">show-grid-lines</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>
                             <child>
                               <object class="IdeTweaksChoice">
                                 <property name="title" translatable="yes">No Pattern</property>
@@ -140,8 +148,12 @@
                           <object class="IdeTweaksCombo" id="editor_map">
                             <property name="title" translatable="yes">Source Code Overview</property>
                             <property name="subtitle" translatable="yes">Display an overview of source code 
next to the editor</property>
-                            <property name="settings">settings_org_gnome_builder_editor</property>
-                            <property name="key">map-policy</property>
+                            <property name="binding">
+                              <object class="IdeTweaksSetting">
+                                <property name="schema-id">org.gnome.builder.editor</property>
+                                <property name="schema-key">map-policy</property>
+                              </object>
+                            </property>
                             <child>
                               <object class="IdeTweaksChoice">
                                 <property name="title" translatable="yes">Prefer Scrollbars</property>
@@ -309,8 +321,12 @@
                           <object class="IdeTweaksCombo" id="shortcut_theme_combo">
                             <property name="title" translatable="yes">Keyboard Theme</property>
                             <property name="subtitle" translatable="yes">Shortcut themes provide a keyboard 
experience similar to other IDEs and editors</property>
-                            <property name="settings">settings_org_gnome_builder_editor</property>
-                            <property name="key">keybindings</property>
+                            <property name="binding">
+                              <object class="IdeTweaksSetting">
+                                <property name="schema-id">org.gnome.builder.editor</property>
+                                <property name="schema-key">keybindings</property>
+                              </object>
+                            </property>
                             <child>
                               <object class="IdeTweaksChoice">
                                 <property name="title" translatable="yes">Builder</property>
@@ -335,8 +351,12 @@
                           <object class="IdeTweaksCombo" id="smart_home_end">
                             <property name="title" translatable="yes">Smart Home/End</property>
                             <property name="subtitle" translatable="yes">Navigate to non-space 
characters</property>
-                            <property name="settings">settings_org_gnome_builder_editor</property>
-                            <property name="key">smart-home-end</property>
+                            <property name="binding">
+                              <object class="IdeTweaksSetting">
+                                <property name="schema-id">org.gnome.builder.editor</property>
+                                <property name="schema-key">smart-home-end</property>
+                              </object>
+                            </property>
                             <child>
                               <object class="IdeTweaksChoice">
                                 <property name="title" translatable="yes">Before line boundaries</property>
diff --git a/src/plugins/platformui/tweaks.ui b/src/plugins/platformui/tweaks.ui
index 848e968b9..745863ea5 100644
--- a/src/plugins/platformui/tweaks.ui
+++ b/src/plugins/platformui/tweaks.ui
@@ -25,9 +25,13 @@
               <object class="IdeTweaksGroup" id="appearance_page_interface_group">
                 <child>
                   <object class="IdeTweaksCombo">
-                    <property name="settings">settings_org_gnome_builder</property>
-                    <property name="key">interface-style</property>
                     <property name="title" translatable="yes">Document Navigation</property>
+                    <property name="binding">
+                      <object class="IdeTweaksSetting">
+                        <property name="schema-id">org.gnome.builder</property>
+                        <property name="schema-key">interface-style</property>
+                      </object>
+                    </property>
                     <child>
                       <object class="IdeTweaksChoice">
                         <property name="title" translatable="yes">Tab Bar</property>
diff --git a/src/plugins/projectui/tweaks.ui b/src/plugins/projectui/tweaks.ui
index 0b32f667c..2c3626ee3 100644
--- a/src/plugins/projectui/tweaks.ui
+++ b/src/plugins/projectui/tweaks.ui
@@ -41,8 +41,12 @@
                   <object class="IdeTweaksCombo">
                     <property name="title" translatable="yes">License</property>
                     <property name="subtitle" translatable="yes">The default license when creating new 
projects</property>
-                    <property name="settings">settings_org_gnome_builder</property>
-                    <property name="key">default-license</property>
+                    <property name="binding">
+                      <object class="IdeTweaksSetting">
+                        <property name="schema-id">org.gnome.builder</property>
+                        <property name="schema-key">default-license</property>
+                      </object>
+                    </property>
                     <child>
                       <object class="IdeTweaksChoice">
                         <property name="title">AGPL-3.0-or-later</property>
diff --git a/src/plugins/rust-analyzer/tweaks.ui b/src/plugins/rust-analyzer/tweaks.ui
index d0ef0aff9..22a62ea80 100644
--- a/src/plugins/rust-analyzer/tweaks.ui
+++ b/src/plugins/rust-analyzer/tweaks.ui
@@ -22,8 +22,12 @@
                       <object class="IdeTweaksCombo" id="rust_analyzer_clippy_combo">
                         <property name="title" translatable="yes">Cargo Command</property>
                         <property name="subtitle" translatable="yes">The default cargo command to run with 
rust-analyzer</property>
-                        <property name="settings">settings_org_gnome_builder_rust_analyzer</property>
-                        <property name="key">cargo-command</property>
+                        <property name="binding">
+                          <object class="IdeTweaksSetting">
+                            <property name="schema-id">org.gnome.builder.rust.analyzer</property>
+                            <property name="schema-key">cargo-command</property>
+                          </object>
+                        </property>
                         <child>
                           <object class="IdeTweaksChoice">
                             <property name="title">check</property>
diff --git a/src/plugins/sysprof/tweaks.ui b/src/plugins/sysprof/tweaks.ui
index 22e4fb5b0..6f5648e36 100644
--- a/src/plugins/sysprof/tweaks.ui
+++ b/src/plugins/sysprof/tweaks.ui
@@ -36,8 +36,12 @@
                       <object class="IdeTweaksCombo">
                         <property name="title" translatable="yes">CPU Governor</property>
                         <property name="subtitle" translatable="yes">Force performance mode while 
profiling</property>
-                        <property name="settings">settings_org_gnome_builder_sysprof</property>
-                        <property name="key">allow-throttle</property>
+                        <property name="binding">
+                          <object class="IdeTweaksSetting">
+                            <property name="schema-id">org.gnome.builder.sysprof</property>
+                            <property name="schema-key">allow-throttle</property>
+                          </object>
+                        </property>
                         <child>
                           <object class="IdeTweaksChoice">
                             <property name="title" translatable="yes">Don't Change Governor</property>
diff --git a/src/plugins/valgrind/tweaks.ui b/src/plugins/valgrind/tweaks.ui
index 837a98d9f..e3ae2184e 100644
--- a/src/plugins/valgrind/tweaks.ui
+++ b/src/plugins/valgrind/tweaks.ui
@@ -65,8 +65,12 @@
                       <object class="IdeTweaksCombo">
                         <property name="title" translatable="yes">Leak Check</property>
                         <property name="subtitle" translatable="yes">Search for memory leaks at 
exit</property>
-                        <property name="settings">settings_org_gnome_builder_valgrind</property>
-                        <property name="key">leak-check</property>
+                        <property name="binding">
+                          <object class="IdeTweaksSetting">
+                            <property name="schema-id">org.gnome.builder.valgrind</property>
+                            <property name="schema-key">leak-check</property>
+                          </object>
+                        </property>
                         <child>
                           <object class="IdeTweaksChoice">
                             <property name="title">No</property>


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