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




commit 0aeedf6d4f2c304d81a8eb022e597a66261b3162
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 054218c43..c0a2579da 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 },
@@ -2676,12 +2677,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)
@@ -2717,4 +2722,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]