[gnome-builder] genesis: Update the new-project action to use the new view
- From: Matthew Leeds <mwleeds src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] genesis: Update the new-project action to use the new view
- Date: Wed, 3 Aug 2016 01:11:18 +0000 (UTC)
commit 7746c8cd5b3290ae4d39a0aa27100254b715c990
Author: Matthew Leeds <mleeds redhat com>
Date: Tue Aug 2 20:22:44 2016 -0400
genesis: Update the new-project action to use the new view
The New Project view used to be handled by an IdeGenesisPerspective, but
is now handled by GbpCreateProjectGenesisAddin. The application's
new-project action (which can be accessed via the menu in the GNOME
Shell top bar) stopped working when the switch was made. This commit
fixes the issue by adding an interface to the IdeGreeterPerspective to
show a genesis view, and calling it from ide-application-actions.c.
https://bugzilla.gnome.org/show_bug.cgi?id=769454
libide/application/ide-application-actions.c | 10 +++++++++-
libide/greeter/ide-greeter-perspective.c | 13 +++++++++++--
libide/greeter/ide-greeter-perspective.h | 3 +++
3 files changed, 23 insertions(+), 3 deletions(-)
---
diff --git a/libide/application/ide-application-actions.c b/libide/application/ide-application-actions.c
index 1ec1049..ebeb975 100644
--- a/libide/application/ide-application-actions.c
+++ b/libide/application/ide-application-actions.c
@@ -30,6 +30,7 @@
#include "application/ide-application-private.h"
#include "keybindings/ide-shortcuts-window.h"
#include "workbench/ide-workbench.h"
+#include "greeter/ide-greeter-perspective.h"
static void
ide_application_actions_preferences (GSimpleAction *action,
@@ -180,6 +181,7 @@ ide_application_actions_new_project (GSimpleAction *action,
{
IdeApplication *self = user_data;
IdeWorkbench *workbench = NULL;
+ IdePerspective *greeter;
const GList *list;
g_assert (IDE_IS_APPLICATION (self));
@@ -207,7 +209,13 @@ ide_application_actions_new_project (GSimpleAction *action,
NULL);
}
- ide_workbench_set_visible_perspective_name (workbench, "genesis");
+ greeter = ide_workbench_get_perspective_by_name (workbench, "greeter");
+
+ if (greeter)
+ {
+ ide_greeter_perspective_show_genesis_view (IDE_GREETER_PERSPECTIVE (greeter),
+ "GbpCreateProjectGenesisAddin");
+ }
gtk_window_present (GTK_WINDOW (workbench));
}
diff --git a/libide/greeter/ide-greeter-perspective.c b/libide/greeter/ide-greeter-perspective.c
index a279600..2deb56d 100644
--- a/libide/greeter/ide-greeter-perspective.c
+++ b/libide/greeter/ide-greeter-perspective.c
@@ -747,6 +747,16 @@ ide_greeter_perspective_open_clicked (IdeGreeterPerspective *self,
gtk_window_present (GTK_WINDOW (dialog));
}
+void
+ide_greeter_perspective_show_genesis_view (IdeGreeterPerspective *self,
+ const gchar *genesis_addin_name)
+{
+ g_assert (IDE_IS_GREETER_PERSPECTIVE (self));
+
+ gtk_stack_set_visible_child_name (self->genesis_stack, genesis_addin_name);
+ egg_state_machine_set_state (self->state_machine, "genesis");
+}
+
static void
genesis_button_clicked (IdeGreeterPerspective *self,
GtkButton *button)
@@ -757,8 +767,7 @@ genesis_button_clicked (IdeGreeterPerspective *self,
g_assert (GTK_IS_BUTTON (button));
name = gtk_widget_get_name (GTK_WIDGET (button));
- gtk_stack_set_visible_child_name (self->genesis_stack, name);
- egg_state_machine_set_state (self->state_machine, "genesis");
+ ide_greeter_perspective_show_genesis_view (self, name);
}
static void
diff --git a/libide/greeter/ide-greeter-perspective.h b/libide/greeter/ide-greeter-perspective.h
index cf4c45a..122bbd7 100644
--- a/libide/greeter/ide-greeter-perspective.h
+++ b/libide/greeter/ide-greeter-perspective.h
@@ -29,6 +29,9 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (IdeGreeterPerspective, ide_greeter_perspective, IDE, GREETER_PERSPECTIVE, GtkBin)
+void ide_greeter_perspective_show_genesis_view (IdeGreeterPerspective *self,
+ const gchar *genesis_addin_name);
+
G_END_DECLS
#endif /* IDE_GREETER_PERSPECTIVE_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]