[gnome-builder/wip/gtk4-port] libide/gui: include context to global preferences when possible
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port] libide/gui: include context to global preferences when possible
- Date: Sat, 14 May 2022 21:55:42 +0000 (UTC)
commit 2d74e5e83879426b90b45371e9ce3b9d2c1d1958
Author: Christian Hergert <chergert redhat com>
Date: Sat May 14 14:53:47 2022 -0700
libide/gui: include context to global preferences when possible
This can be used by some plugins which might allow tweaking global options
but still require an IdeContext for integration (such as gnome-builder-git
subprocess worker).
src/libide/gui/ide-application-actions.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/src/libide/gui/ide-application-actions.c b/src/libide/gui/ide-application-actions.c
index d3e51da41..5c76de0b2 100644
--- a/src/libide/gui/ide-application-actions.c
+++ b/src/libide/gui/ide-application-actions.c
@@ -33,6 +33,7 @@
#include "ide-application-private.h"
#include "ide-gui-global.h"
#include "ide-preferences-window.h"
+#include "ide-primary-workspace.h"
static void
ide_application_actions_preferences (GSimpleAction *action,
@@ -40,6 +41,7 @@ ide_application_actions_preferences (GSimpleAction *action,
gpointer user_data)
{
IdeApplication *self = user_data;
+ IdeContext *context = NULL;
GtkWindow *toplevel = NULL;
GtkWindow *window;
GList *windows;
@@ -63,15 +65,20 @@ ide_application_actions_preferences (GSimpleAction *action,
return;
}
- if (toplevel == NULL && IDE_IS_WORKBENCH (win))
+ if (toplevel == NULL && IDE_IS_PRIMARY_WORKSPACE (win))
toplevel = win;
}
+ /* We want to make a context available if necessary */
+ if (IDE_IS_WORKSPACE (toplevel))
+ context = ide_workspace_get_context (IDE_WORKSPACE (toplevel));
+
/* Create a new window for preferences, with enough space for
* 2 columns of preferences. The window manager will automatically
* maximize the window if necessary.
*/
window = g_object_new (IDE_TYPE_PREFERENCES_WINDOW,
+ "context", context,
"mode", IDE_PREFERENCES_MODE_APPLICATION,
"transient-for", toplevel,
"default-width", 1050,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]