[gnome-builder] workbench: disable close-project until project is loaded



commit 88964ddc0936432c75cf1b85a49b2d8e9a20b632
Author: Christian Hergert <chergert redhat com>
Date:   Tue Sep 25 22:49:20 2018 -0700

    workbench: disable close-project until project is loaded

 src/libide/workbench/ide-workbench-actions.c | 4 ++++
 src/libide/workbench/ide-workbench.c         | 4 ++++
 2 files changed, 8 insertions(+)
---
diff --git a/src/libide/workbench/ide-workbench-actions.c b/src/libide/workbench/ide-workbench-actions.c
index f46ad7b67..1c1ec0b9d 100644
--- a/src/libide/workbench/ide-workbench-actions.c
+++ b/src/libide/workbench/ide-workbench-actions.c
@@ -333,6 +333,10 @@ ide_workbench_actions_init (IdeWorkbench *self)
 
   g_action_map_add_action_entries (G_ACTION_MAP (self), actions, G_N_ELEMENTS (actions), self);
 
+  dzl_gtk_widget_action_set (GTK_WIDGET (self), "win", "close-project",
+                             "enabled", FALSE,
+                             NULL);
+
   action = g_property_action_new ("perspective", self, "visible-perspective-name");
   g_action_map_add_action (G_ACTION_MAP (self), G_ACTION (action));
   g_object_unref (action);
diff --git a/src/libide/workbench/ide-workbench.c b/src/libide/workbench/ide-workbench.c
index f7ccb0a69..8e6ebb516 100644
--- a/src/libide/workbench/ide-workbench.c
+++ b/src/libide/workbench/ide-workbench.c
@@ -691,6 +691,10 @@ ide_workbench_set_context (IdeWorkbench *self,
 
   _ide_context_set_workbench (context, GTK_WIDGET (self));
 
+  dzl_gtk_widget_action_set (GTK_WIDGET (self), "win", "close-project",
+                             "enabled", TRUE,
+                             NULL);
+
   project = ide_context_get_project (context);
   g_object_bind_property_full (project, "name",
                                self, "title",


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