[gnome-builder] greeter: display greeter for "New Window" action



commit 34397ae0b23d61198ebd22018aea1f814dee7a66
Author: Christian Hergert <chergert redhat com>
Date:   Sun Jan 13 16:38:49 2019 -0800

    greeter: display greeter for "New Window" action
    
    I still think I'd rather see this grow more specific actions than the
    generic "New Window", but this at least gets things working.
    
    Fixes #754

 data/org.gnome.Builder.desktop.in.in                |  5 +++++
 src/plugins/greeter/gbp-greeter-application-addin.c | 15 +++++++++++++++
 2 files changed, 20 insertions(+)
---
diff --git a/data/org.gnome.Builder.desktop.in.in b/data/org.gnome.Builder.desktop.in.in
index c7f2c20a8..8906a8ae3 100644
--- a/data/org.gnome.Builder.desktop.in.in
+++ b/data/org.gnome.Builder.desktop.in.in
@@ -13,3 +13,8 @@ Categories=GNOME;GTK;Development;IDE;
 Keywords=Build;Develop;
 
MimeType=text/x-c;text/x-csrc;text/x-changelog;text/x-chdr;text/x-c++hdr;text/x-python;application/x-python;application/javascript;application/x-javascript;text/x-javascript;text/javascript;text/x-js;text/x-shellscript;application/x-shellscript;text/x-sh;text/x-vala;text/x-makefile;text/x-c++;text/x-cpp;text/x-c++src;text/css;application/x-gnome-app-info;application/x-desktop;text/x-go;text/html;text/x-markdown;application/json;application/x-m4;application/xml;text/xml;application/x-yaml;text/x-sql;application/x-ruby;text/x-ruby;text/x-pkg-config;text/x-lua;text/x-php;application/x-php;text/x-php-source;application/x-php-source;text/x-perl;application/x-perl;
 X-Flatpak-RenamedFrom=gnome-builder
+Actions=new-window;
+
+[Desktop Action new-window]
+Name=New Window
+Exec=gnome-builder --greeter
diff --git a/src/plugins/greeter/gbp-greeter-application-addin.c 
b/src/plugins/greeter/gbp-greeter-application-addin.c
index a0636f483..f999879a3 100644
--- a/src/plugins/greeter/gbp-greeter-application-addin.c
+++ b/src/plugins/greeter/gbp-greeter-application-addin.c
@@ -61,6 +61,20 @@ present_greeter_with_surface (GSimpleAction *action,
   ide_workbench_focus_workspace (workbench, IDE_WORKSPACE (workspace));
 }
 
+static void
+new_window (GSimpleAction *action,
+            GVariant      *param,
+            gpointer       user_data)
+{
+  GbpGreeterApplicationAddin *self = user_data;
+
+  g_assert (!action || G_IS_SIMPLE_ACTION (action));
+  g_assert (GBP_IS_GREETER_APPLICATION_ADDIN (self));
+  g_assert (IDE_IS_APPLICATION (self->application));
+
+  present_greeter_with_surface (NULL, NULL, self);
+}
+
 static void
 open_project (GSimpleAction *action,
               GVariant      *param,
@@ -89,6 +103,7 @@ open_project (GSimpleAction *action,
 static const GActionEntry actions[] = {
   { "present-greeter-with-surface", present_greeter_with_surface, "s" },
   { "open-project", open_project },
+  { "new-window", new_window },
 };
 
 static void


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