[gnome-builder/wip/gtk4-port: 1544/1774] plugins/buildui: fix new run command button
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port: 1544/1774] plugins/buildui: fix new run command button
- Date: Mon, 11 Jul 2022 22:31:49 +0000 (UTC)
commit 0e7a3da06b2e6e81d3d263c6e6d0bd08ff0b6f81
Author: Christian Hergert <chergert redhat com>
Date: Wed Jun 15 21:31:45 2022 -0700
plugins/buildui: fix new run command button
src/plugins/buildui/gbp-buildui-runnables-dialog.c | 23 ++++++++++++++++++++++
1 file changed, 23 insertions(+)
---
diff --git a/src/plugins/buildui/gbp-buildui-runnables-dialog.c
b/src/plugins/buildui/gbp-buildui-runnables-dialog.c
index d095cb654..30429786d 100644
--- a/src/plugins/buildui/gbp-buildui-runnables-dialog.c
+++ b/src/plugins/buildui/gbp-buildui-runnables-dialog.c
@@ -186,6 +186,27 @@ gbp_buildui_runnables_dialog_set_context (GbpBuilduiRunnablesDialog *self,
IDE_EXIT;
}
+static void
+new_run_command_action (GtkWidget *widget,
+ const char *action_name,
+ GVariant *param)
+{
+ GbpBuilduiRunnablesDialog *self = (GbpBuilduiRunnablesDialog *)widget;
+ IdeWorkspace *workspace;
+
+ IDE_ENTRY;
+
+ g_assert (GBP_IS_BUILDUI_RUNNABLES_DIALOG (self));
+
+ workspace = ide_widget_get_workspace (GTK_WIDGET (self));
+ gtk_widget_activate_action (GTK_WIDGET (workspace),
+ "workbench.configure-page",
+ "s", "commands");
+ gtk_window_destroy (GTK_WINDOW (self));
+
+ IDE_EXIT;
+}
+
static void
gbp_buildui_runnables_dialog_get_property (GObject *object,
guint prop_id,
@@ -245,6 +266,8 @@ gbp_buildui_runnables_dialog_class_init (GbpBuilduiRunnablesDialogClass *klass)
g_object_class_install_properties (object_class, N_PROPS, properties);
+ gtk_widget_class_install_action (widget_class, "run-command.new", NULL, new_run_command_action);
+
gtk_widget_class_add_binding_action (widget_class, GDK_KEY_Escape, 0, "window.close", NULL);
gtk_widget_class_set_template_from_resource (widget_class,
"/plugins/buildui/gbp-buildui-runnables-dialog.ui");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]