[gnome-builder/wip/gtk4-port] plugins/buildui: add action to show error/warning popover



commit 58dee46e916e0697f47a84494e17e43f3b40a055
Author: Christian Hergert <chergert redhat com>
Date:   Fri May 20 15:38:59 2022 -0700

    plugins/buildui: add action to show error/warning popover

 src/plugins/buildui/gbp-buildui-workspace-addin.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
---
diff --git a/src/plugins/buildui/gbp-buildui-workspace-addin.c 
b/src/plugins/buildui/gbp-buildui-workspace-addin.c
index 654540e8a..3aea73dac 100644
--- a/src/plugins/buildui/gbp-buildui-workspace-addin.c
+++ b/src/plugins/buildui/gbp-buildui-workspace-addin.c
@@ -203,9 +203,32 @@ select_build_target_action (GSimpleAction *action,
   gtk_window_present (GTK_WINDOW (dialog));
 }
 
+static void
+show_status_popover (GSimpleAction *action,
+                     GVariant      *param,
+                     gpointer       user_data)
+{
+  GbpBuilduiWorkspaceAddin *self = user_data;
+  GtkPopover *popover;
+
+  IDE_ENTRY;
+
+  g_assert (G_IS_SIMPLE_ACTION (action));
+  g_assert (g_variant_is_of_type (param, G_VARIANT_TYPE_STRING));
+  g_assert (GBP_IS_BUILDUI_WORKSPACE_ADDIN (self));
+
+  popover = gtk_menu_button_get_popover (self->status_button);
+  gbp_buildui_status_popover_set_page (GBP_BUILDUI_STATUS_POPOVER (popover),
+                                       g_variant_get_string (param, NULL));
+  gtk_menu_button_popup (self->status_button);
+
+  IDE_EXIT;
+}
+
 static const GActionEntry actions[] = {
   { "show-build-log", on_view_output_cb },
   { "select-build-target", select_build_target_action },
+  { "show-build-status-popover", show_status_popover, "s" },
 };
 
 static void


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