[gnome-builder/wip/gtk4-port] libide/gui: action for project prefs w/ page set



commit d78eeb130e9ca6c13afbadba7d78cfdf3abe9db7
Author: Christian Hergert <chergert redhat com>
Date:   Fri Jun 10 17:42:09 2022 -0700

    libide/gui: action for project prefs w/ page set

 src/libide/gui/ide-workbench.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/src/libide/gui/ide-workbench.c b/src/libide/gui/ide-workbench.c
index 3b54fc061..8cf7d81e4 100644
--- a/src/libide/gui/ide-workbench.c
+++ b/src/libide/gui/ide-workbench.c
@@ -140,6 +140,7 @@ IDE_DEFINE_ACTION_GROUP (IdeWorkbench, ide_workbench, {
   { "reload-files", ide_workbench_action_reload_all },
   { "global-search", ide_workbench_action_global_search },
   { "configure", ide_workbench_action_configure },
+  { "configure-page", ide_workbench_action_configure, "s" },
   { "-inspector", ide_workbench_action_inspector },
   { "-object-tree", ide_workbench_action_object_tree },
   { "-dump-tasks", ide_workbench_action_dump_tasks },
@@ -2671,12 +2672,16 @@ static void
 ide_workbench_action_configure (IdeWorkbench *self,
                                 GVariant     *param)
 {
+  const char *page = NULL;
   GtkWindow *window;
   GList *windows;
   gboolean found = FALSE;
 
   g_assert (IDE_IS_WORKBENCH (self));
 
+  if (param && g_variant_is_of_type (param, G_VARIANT_TYPE_STRING))
+    page = g_variant_get_string (param, NULL);
+
   windows = gtk_window_group_list_windows (GTK_WINDOW_GROUP (self));
 
   for (const GList *iter = windows; iter; iter = iter->next)
@@ -2712,4 +2717,7 @@ ide_workbench_action_configure (IdeWorkbench *self,
       gtk_window_group_add_window (GTK_WINDOW_GROUP (self), window);
       gtk_window_present (window);
     }
+
+  if (page != NULL)
+    ide_preferences_window_set_page (IDE_PREFERENCES_WINDOW (window), page);
 }


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