[gnome-builder] workbench: update action when workspace changes
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] workbench: update action when workspace changes
- Date: Sun, 14 Dec 2014 08:33:16 +0000 (UTC)
commit af19f83955ac473a6d19b4e432ce6333c390cd72
Author: Christian Hergert <christian hergert me>
Date: Sun Dec 14 00:14:24 2014 -0800
workbench: update action when workspace changes
src/workbench/gb-workbench.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/workbench/gb-workbench.c b/src/workbench/gb-workbench.c
index 83601d0..c6da72a 100644
--- a/src/workbench/gb-workbench.c
+++ b/src/workbench/gb-workbench.c
@@ -191,6 +191,17 @@ gb_workbench_stack_child_changed (GbWorkbench *workbench,
if (child)
g_signal_emit (workbench, gSignals[WORKSPACE_CHANGED], 0, child);
+
+ if (GB_IS_WORKSPACE (child))
+ {
+ GAction *action;
+ gboolean enabled;
+
+ enabled = !!GB_WORKSPACE_GET_CLASS (child)->new_document;
+ action = g_action_map_lookup_action (G_ACTION_MAP (workbench),
+ "new-document");
+ g_simple_action_set_enabled (G_SIMPLE_ACTION (action), enabled);
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]