[gnome-builder] plugins/buildui: move expired artifacts to buildui
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] plugins/buildui: move expired artifacts to buildui
- Date: Thu, 18 Aug 2022 18:10:29 +0000 (UTC)
commit eb7a7ed77493f18ac63e0b103b6af3e3d8311daa
Author: Christian Hergert <chergert redhat com>
Date: Thu Aug 18 11:10:24 2022 -0700
plugins/buildui: move expired artifacts to buildui
This was part of buildui and so lets keep it there. Also, start the
tweaks addin for buildui.
src/plugins/buildui/buildui-plugin.c | 4 +++
src/plugins/buildui/buildui.gresource.xml | 1 +
src/plugins/buildui/gbp-buildui-tweaks-addin.c | 44 ++++++++++++++++++++++++++
src/plugins/buildui/gbp-buildui-tweaks-addin.h | 31 ++++++++++++++++++
src/plugins/buildui/meson.build | 1 +
src/plugins/buildui/tweaks.ui | 26 +++++++++++++++
src/plugins/projectui/tweaks.ui | 11 -------
7 files changed, 107 insertions(+), 11 deletions(-)
---
diff --git a/src/plugins/buildui/buildui-plugin.c b/src/plugins/buildui/buildui-plugin.c
index 4846bb30d..78998112d 100644
--- a/src/plugins/buildui/buildui-plugin.c
+++ b/src/plugins/buildui/buildui-plugin.c
@@ -29,6 +29,7 @@
//#include "gbp-buildui-config-view-addin.h"
#include "gbp-buildui-editor-page-addin.h"
#include "gbp-buildui-preferences-addin.h"
+#include "gbp-buildui-tweaks-addin.h"
#include "gbp-buildui-workspace-addin.h"
_IDE_EXTERN void
@@ -45,6 +46,9 @@ _gbp_buildui_register_types (PeasObjectModule *module)
peas_object_module_register_extension_type (module,
IDE_TYPE_PREFERENCES_ADDIN,
GBP_TYPE_BUILDUI_PREFERENCES_ADDIN);
+ peas_object_module_register_extension_type (module,
+ IDE_TYPE_TWEAKS_ADDIN,
+ GBP_TYPE_BUILDUI_TWEAKS_ADDIN);
peas_object_module_register_extension_type (module,
IDE_TYPE_WORKSPACE_ADDIN,
GBP_TYPE_BUILDUI_WORKSPACE_ADDIN);
diff --git a/src/plugins/buildui/buildui.gresource.xml b/src/plugins/buildui/buildui.gresource.xml
index 565085148..9de612586 100644
--- a/src/plugins/buildui/buildui.gresource.xml
+++ b/src/plugins/buildui/buildui.gresource.xml
@@ -13,5 +13,6 @@
<file preprocess="xml-stripblanks">gbp-buildui-status-popover-row.ui</file>
<file preprocess="xml-stripblanks">gbp-buildui-targets-dialog.ui</file>
<file preprocess="xml-stripblanks">gtk/menus.ui</file>
+ <file preprocess="xml-stripblanks">tweaks.ui</file>
</gresource>
</gresources>
diff --git a/src/plugins/buildui/gbp-buildui-tweaks-addin.c b/src/plugins/buildui/gbp-buildui-tweaks-addin.c
new file mode 100644
index 000000000..57cb838a6
--- /dev/null
+++ b/src/plugins/buildui/gbp-buildui-tweaks-addin.c
@@ -0,0 +1,44 @@
+/* gbp-buildui-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-buildui-tweaks-addin"
+
+#include "config.h"
+
+#include "gbp-buildui-tweaks-addin.h"
+
+struct _GbpBuilduiTweaksAddin
+{
+ IdeTweaksAddin parent_instance;
+};
+
+G_DEFINE_FINAL_TYPE (GbpBuilduiTweaksAddin, gbp_buildui_tweaks_addin, IDE_TYPE_TWEAKS_ADDIN)
+
+static void
+gbp_buildui_tweaks_addin_class_init (GbpBuilduiTweaksAddinClass *klass)
+{
+}
+
+static void
+gbp_buildui_tweaks_addin_init (GbpBuilduiTweaksAddin *self)
+{
+ ide_tweaks_addin_set_resource_paths (IDE_TWEAKS_ADDIN (self),
+ IDE_STRV_INIT ("/plugins/buildui/tweaks.ui"));
+}
diff --git a/src/plugins/buildui/gbp-buildui-tweaks-addin.h b/src/plugins/buildui/gbp-buildui-tweaks-addin.h
new file mode 100644
index 000000000..cdf8656a8
--- /dev/null
+++ b/src/plugins/buildui/gbp-buildui-tweaks-addin.h
@@ -0,0 +1,31 @@
+/* gbp-buildui-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_BUILDUI_TWEAKS_ADDIN (gbp_buildui_tweaks_addin_get_type())
+
+G_DECLARE_FINAL_TYPE (GbpBuilduiTweaksAddin, gbp_buildui_tweaks_addin, GBP, BUILDUI_TWEAKS_ADDIN,
IdeTweaksAddin)
+
+G_END_DECLS
diff --git a/src/plugins/buildui/meson.build b/src/plugins/buildui/meson.build
index 920fa05ce..12c5c46d1 100644
--- a/src/plugins/buildui/meson.build
+++ b/src/plugins/buildui/meson.build
@@ -12,6 +12,7 @@ plugins_sources += files([
'gbp-buildui-status-indicator.c',
'gbp-buildui-status-popover.c',
'gbp-buildui-targets-dialog.c',
+ 'gbp-buildui-tweaks-addin.c',
'gbp-buildui-workspace-addin.c',
])
diff --git a/src/plugins/buildui/tweaks.ui b/src/plugins/buildui/tweaks.ui
new file mode 100644
index 000000000..2eebbbe00
--- /dev/null
+++ b/src/plugins/buildui/tweaks.ui
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <template class="IdeTweaks">
+ <child internal-child="foundry_section">
+ <object class="IdeTweaksSection">
+ <child>
+ <object class="IdeTweaksPage" id="build_page">
+ <property name="icon-name">builder-build-symbolic</property>
+ <property name="title" translatable="yes">Build</property>
+ <child>
+ <object class="IdeTweaksGroup">
+ <child>
+ <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>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </template>
+</interface>
diff --git a/src/plugins/projectui/tweaks.ui b/src/plugins/projectui/tweaks.ui
index 790fe073c..071273da1 100644
--- a/src/plugins/projectui/tweaks.ui
+++ b/src/plugins/projectui/tweaks.ui
@@ -72,17 +72,6 @@
</child>
</object>
</child>
- <child>
- <object class="IdeTweaksGroup">
- <child>
- <object class="IdeTweaksSwitch">
- <property name="title" translatable="yes">Clear Cache at Startup</property>
- <property name="subtitle" translatable="yes">Delete expired cache items at
startup</property>
- <property name="action-name">settings.org.gnome.builder.clear-cache-at-startup</property>
- </object>
- </child>
- </object>
- </child>
</object>
</child>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]