[gnome-builder] plugins/terminal: add terminal tweaks



commit b9cf2169dbb023a757c073e6be0ef81bdd40fdfd
Author: Christian Hergert <chergert redhat com>
Date:   Thu Aug 18 22:16:14 2022 -0700

    plugins/terminal: add terminal tweaks

 po/POTFILES.in                                   |  1 +
 src/libide/gui/tweaks.ui                         |  6 ++
 src/plugins/terminal/gbp-terminal-tweaks-addin.c | 44 ++++++++++++
 src/plugins/terminal/gbp-terminal-tweaks-addin.h | 31 +++++++++
 src/plugins/terminal/meson.build                 |  2 +-
 src/plugins/terminal/terminal-plugin.c           |  8 +--
 src/plugins/terminal/terminal.gresource.xml      |  1 +
 src/plugins/terminal/tweaks.ui                   | 89 ++++++++++++++++++++++++
 8 files changed, 176 insertions(+), 6 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 8b6c24859..46442bfc5 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -282,6 +282,7 @@ src/plugins/sysroot/gbp-sysroot-toolchain-provider.c
 src/plugins/terminal/gbp-terminal-preferences-addin.c
 src/plugins/terminal/gbp-terminal-workspace-addin.c
 src/plugins/terminal/gtk/menus.ui
+src/plugins/terminal/tweaks.ui
 src/plugins/testui/gbp-testui-item.c
 src/plugins/testui/gbp-testui-output-panel.c
 src/plugins/testui/gbp-testui-output-panel.ui
diff --git a/src/libide/gui/tweaks.ui b/src/libide/gui/tweaks.ui
index 01cd996ab..d96d550d0 100644
--- a/src/libide/gui/tweaks.ui
+++ b/src/libide/gui/tweaks.ui
@@ -16,6 +16,12 @@
             <property name="title" translatable="yes">Text Editor</property>
           </object>
         </child>
+        <child>
+          <object class="IdeTweaksPage" id="terminal_page">
+            <property name="icon-name">utilities-terminal-symbolic</property>
+            <property name="title" translatable="yes">Terminal</property>
+          </object>
+        </child>
         <child>
           <object class="IdeTweaksPage" id="shortcuts_page">
             <property name="icon-name">preferences-desktop-keyboard-shortcuts-symbolic</property>
diff --git a/src/plugins/terminal/gbp-terminal-tweaks-addin.c 
b/src/plugins/terminal/gbp-terminal-tweaks-addin.c
new file mode 100644
index 000000000..7fdcdc015
--- /dev/null
+++ b/src/plugins/terminal/gbp-terminal-tweaks-addin.c
@@ -0,0 +1,44 @@
+/* gbp-terminal-tweaks-addin.c
+ *
+ * Copyright 2022 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#define G_LOG_DOMAIN "gbp-terminal-tweaks-addin"
+
+#include "config.h"
+
+#include "gbp-terminal-tweaks-addin.h"
+
+struct _GbpTerminalTweaksAddin
+{
+  IdeTweaksAddin parent_instance;
+};
+
+G_DEFINE_FINAL_TYPE (GbpTerminalTweaksAddin, gbp_terminal_tweaks_addin, IDE_TYPE_TWEAKS_ADDIN)
+
+static void
+gbp_terminal_tweaks_addin_class_init (GbpTerminalTweaksAddinClass *klass)
+{
+}
+
+static void
+gbp_terminal_tweaks_addin_init (GbpTerminalTweaksAddin *self)
+{
+  ide_tweaks_addin_set_resource_paths (IDE_TWEAKS_ADDIN (self),
+                                       IDE_STRV_INIT ("/plugins/terminal/tweaks.ui"));
+}
diff --git a/src/plugins/terminal/gbp-terminal-tweaks-addin.h 
b/src/plugins/terminal/gbp-terminal-tweaks-addin.h
new file mode 100644
index 000000000..bf27cb7a3
--- /dev/null
+++ b/src/plugins/terminal/gbp-terminal-tweaks-addin.h
@@ -0,0 +1,31 @@
+/* gbp-terminal-tweaks-addin.h
+ *
+ * Copyright 2022 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#pragma once
+
+#include <libide-tweaks.h>
+
+G_BEGIN_DECLS
+
+#define GBP_TYPE_TERMINAL_TWEAKS_ADDIN (gbp_terminal_tweaks_addin_get_type())
+
+G_DECLARE_FINAL_TYPE (GbpTerminalTweaksAddin, gbp_terminal_tweaks_addin, GBP, TERMINAL_TWEAKS_ADDIN, 
IdeTweaksAddin)
+
+G_END_DECLS
diff --git a/src/plugins/terminal/meson.build b/src/plugins/terminal/meson.build
index 0af36541b..dac9ecd07 100644
--- a/src/plugins/terminal/meson.build
+++ b/src/plugins/terminal/meson.build
@@ -1,5 +1,5 @@
 plugins_sources += files([
-  # 'gbp-terminal-preferences-addin.c',
+  'gbp-terminal-tweaks-addin.c',
   'gbp-terminal-workspace-addin.c',
   'terminal-plugin.c',
 ])
diff --git a/src/plugins/terminal/terminal-plugin.c b/src/plugins/terminal/terminal-plugin.c
index ce2cf89ba..80f259619 100644
--- a/src/plugins/terminal/terminal-plugin.c
+++ b/src/plugins/terminal/terminal-plugin.c
@@ -26,17 +26,15 @@
 #include <libide-gui.h>
 #include <libide-terminal.h>
 
-//#include "gbp-terminal-preferences-addin.h"
+#include "gbp-terminal-tweaks-addin.h"
 #include "gbp-terminal-workspace-addin.h"
 
 _IDE_EXTERN void
 _gbp_terminal_register_types (PeasObjectModule *module)
 {
-#if 0
   peas_object_module_register_extension_type (module,
-                                              IDE_TYPE_PREFERENCES_ADDIN,
-                                              GBP_TYPE_TERMINAL_PREFERENCES_ADDIN);
-#endif
+                                              IDE_TYPE_TWEAKS_ADDIN,
+                                              GBP_TYPE_TERMINAL_TWEAKS_ADDIN);
   peas_object_module_register_extension_type (module,
                                               IDE_TYPE_WORKSPACE_ADDIN,
                                               GBP_TYPE_TERMINAL_WORKSPACE_ADDIN);
diff --git a/src/plugins/terminal/terminal.gresource.xml b/src/plugins/terminal/terminal.gresource.xml
index 02ecabed2..dfa36cc85 100644
--- a/src/plugins/terminal/terminal.gresource.xml
+++ b/src/plugins/terminal/terminal.gresource.xml
@@ -2,6 +2,7 @@
 <gresources>
   <gresource prefix="/plugins/terminal">
     <file preprocess="xml-stripblanks">gtk/menus.ui</file>
+    <file preprocess="xml-stripblanks">tweaks.ui</file>
     <file>gtk/keybindings.json</file>
     <file>terminal.plugin</file>
   </gresource>
diff --git a/src/plugins/terminal/tweaks.ui b/src/plugins/terminal/tweaks.ui
new file mode 100644
index 000000000..86b3f89a7
--- /dev/null
+++ b/src/plugins/terminal/tweaks.ui
@@ -0,0 +1,89 @@
+<?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">
+          <object class="IdeTweaksPage">
+            <child>
+              <object class="IdeTweaksGroup" id="terminal_page_font_group">
+                <property name="title" translatable="yes">Fonts &amp; Styling</property>
+                <child>
+                  <object class="IdeTweaksFont" id="terminal_font">
+                    <property name="title" translatable="yes">Font</property>
+                    <property name="subtitle" translatable="yes">The font used within terminals</property>
+                    <property name="settings">settings_org_gnome_builder_terminal</property>
+                    <property name="key">font-name</property>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="IdeTweaksGroup">
+                <child>
+                  <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>
+                  </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>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="IdeTweaksGroup">
+                <property name="title" translatable="yes">Scrolling</property>
+                <child>
+                  <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>
+                  </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>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="IdeTweaksGroup">
+                <property name="title" translatable="yes">History</property>
+                <child>
+                  <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>
+                  </object>
+                </child>
+                <child>
+                  <object class="IdeTweaksSpin">
+                    <property name="title" translatable="yes">Maximum Lines in Scrollback</property>
+                    <property name="subtitle" translatable="yes">The maximum number of lines stored in 
history when limiting scrollback</property>
+                    <property name="settings">settings_org_gnome_builder_terminal</property>
+                    <property name="key">scrollback-lines</property>
+                  </object>
+                </child>
+              </object>
+            </child>
+          </object>
+        </child>
+      </object>
+    </child>
+  </template>
+</interface>


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