[gnome-builder] plugins/debuggerui: add debugger tweaks
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] plugins/debuggerui: add debugger tweaks
- Date: Thu, 18 Aug 2022 05:08:46 +0000 (UTC)
commit ca98dbd61f14016da3cd56477d16249d5bdd2674
Author: Christian Hergert <chergert redhat com>
Date: Wed Aug 17 22:08:40 2022 -0700
plugins/debuggerui: add debugger tweaks
src/plugins/debuggerui/debuggerui-plugin.c | 4 ++
src/plugins/debuggerui/debuggerui.gresource.xml | 1 +
.../debuggerui/gbp-debuggerui-tweaks-addin.c | 44 +++++++++++++++++++++
.../debuggerui/gbp-debuggerui-tweaks-addin.h | 31 +++++++++++++++
src/plugins/debuggerui/meson.build | 1 +
src/plugins/debuggerui/tweaks.ui | 46 ++++++++++++++++++++++
6 files changed, 127 insertions(+)
---
diff --git a/src/plugins/debuggerui/debuggerui-plugin.c b/src/plugins/debuggerui/debuggerui-plugin.c
index ddcc054d7..28df131df 100644
--- a/src/plugins/debuggerui/debuggerui-plugin.c
+++ b/src/plugins/debuggerui/debuggerui-plugin.c
@@ -28,6 +28,7 @@
#include <libide-gui.h>
#include "gbp-debugger-tool.h"
+#include "gbp-debuggerui-tweaks-addin.h"
#include "ide-debugger-hover-provider.h"
#include "ide-debugger-workspace-addin.h"
@@ -40,6 +41,9 @@ _gbp_debuggerui_register_types (PeasObjectModule *module)
peas_object_module_register_extension_type (module,
GTK_SOURCE_TYPE_HOVER_PROVIDER,
IDE_TYPE_DEBUGGER_HOVER_PROVIDER);
+ peas_object_module_register_extension_type (module,
+ IDE_TYPE_TWEAKS_ADDIN,
+ GBP_TYPE_DEBUGGERUI_TWEAKS_ADDIN);
peas_object_module_register_extension_type (module,
IDE_TYPE_WORKSPACE_ADDIN,
IDE_TYPE_DEBUGGER_WORKSPACE_ADDIN);
diff --git a/src/plugins/debuggerui/debuggerui.gresource.xml b/src/plugins/debuggerui/debuggerui.gresource.xml
index dc3e411ac..1c1365b6d 100644
--- a/src/plugins/debuggerui/debuggerui.gresource.xml
+++ b/src/plugins/debuggerui/debuggerui.gresource.xml
@@ -5,6 +5,7 @@
<file>gtk/menus.ui</file>
<file>gtk/keybindings.json</file>
<file>style.css</file>
+ <file preprocess="xml-stripblanks">tweaks.ui</file>
<file preprocess="xml-stripblanks">ide-debugger-breakpoints-view.ui</file>
<file preprocess="xml-stripblanks">ide-debugger-controls.ui</file>
<file preprocess="xml-stripblanks">ide-debugger-disassembly-view.ui</file>
diff --git a/src/plugins/debuggerui/gbp-debuggerui-tweaks-addin.c
b/src/plugins/debuggerui/gbp-debuggerui-tweaks-addin.c
new file mode 100644
index 000000000..33bdc4fda
--- /dev/null
+++ b/src/plugins/debuggerui/gbp-debuggerui-tweaks-addin.c
@@ -0,0 +1,44 @@
+/* gbp-debuggerui-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-debuggerui-tweaks-addin"
+
+#include "config.h"
+
+#include "gbp-debuggerui-tweaks-addin.h"
+
+struct _GbpDebuggeruiTweaksAddin
+{
+ IdeTweaksAddin parent_instance;
+};
+
+G_DEFINE_FINAL_TYPE (GbpDebuggeruiTweaksAddin, gbp_debuggerui_tweaks_addin, IDE_TYPE_TWEAKS_ADDIN)
+
+static void
+gbp_debuggerui_tweaks_addin_class_init (GbpDebuggeruiTweaksAddinClass *klass)
+{
+}
+
+static void
+gbp_debuggerui_tweaks_addin_init (GbpDebuggeruiTweaksAddin *self)
+{
+ ide_tweaks_addin_set_resource_paths (IDE_TWEAKS_ADDIN (self),
+ IDE_STRV_INIT ("/plugins/debuggerui/tweaks.ui"));
+}
diff --git a/src/plugins/debuggerui/gbp-debuggerui-tweaks-addin.h
b/src/plugins/debuggerui/gbp-debuggerui-tweaks-addin.h
new file mode 100644
index 000000000..1629392df
--- /dev/null
+++ b/src/plugins/debuggerui/gbp-debuggerui-tweaks-addin.h
@@ -0,0 +1,31 @@
+/* gbp-debuggerui-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_DEBUGGERUI_TWEAKS_ADDIN (gbp_debuggerui_tweaks_addin_get_type())
+
+G_DECLARE_FINAL_TYPE (GbpDebuggeruiTweaksAddin, gbp_debuggerui_tweaks_addin, GBP, DEBUGGERUI_TWEAKS_ADDIN,
IdeTweaksAddin)
+
+G_END_DECLS
diff --git a/src/plugins/debuggerui/meson.build b/src/plugins/debuggerui/meson.build
index eadaf71ef..61ffef165 100644
--- a/src/plugins/debuggerui/meson.build
+++ b/src/plugins/debuggerui/meson.build
@@ -1,5 +1,6 @@
plugins_sources += files([
'debuggerui-plugin.c',
+ 'gbp-debuggerui-tweaks-addin.c',
'gbp-debugger-tool.c',
'ide-debugger-breakpoints-view.c',
'ide-debugger-controls.c',
diff --git a/src/plugins/debuggerui/tweaks.ui b/src/plugins/debuggerui/tweaks.ui
new file mode 100644
index 000000000..017d67b91
--- /dev/null
+++ b/src/plugins/debuggerui/tweaks.ui
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <template class="IdeTweaks">
+ <child internal-child="foundry_section">
+ <object class="IdeTweaksSection">
+ <child>
+ <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>
+ <child>
+ <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>
+ </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>
+ </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>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </template>
+</interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]