[nautilus] navigation-state: add API to sync a boolean value on a tracked action



commit f3eff82082f4ebd88e01d3efbe2631a15989cfa9
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Fri Jan 6 14:10:49 2012 +0100

    navigation-state: add API to sync a boolean value on a tracked action

 src/nautilus-navigation-state.c |   17 +++++++++++++++++
 src/nautilus-navigation-state.h |    4 ++++
 2 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-navigation-state.c b/src/nautilus-navigation-state.c
index af76849..7ca7450 100644
--- a/src/nautilus-navigation-state.c
+++ b/src/nautilus-navigation-state.c
@@ -243,3 +243,20 @@ nautilus_navigation_state_get_master (NautilusNavigationState *self)
 {
 	return self->priv->master;
 }
+
+void
+nautilus_navigation_state_set_boolean (NautilusNavigationState *self,
+				       const gchar *action_name,
+				       gboolean value)
+{
+	GtkAction *action;
+
+	action = gtk_action_group_get_action (self->priv->master,
+					      action_name);
+
+	if (action == NULL) {
+		return;
+	}
+
+	gtk_action_set_sensitive (action, value);
+}
diff --git a/src/nautilus-navigation-state.h b/src/nautilus-navigation-state.h
index 2fe09d1..a984424 100644
--- a/src/nautilus-navigation-state.h
+++ b/src/nautilus-navigation-state.h
@@ -68,4 +68,8 @@ GtkActionGroup * nautilus_navigation_state_get_master (NautilusNavigationState *
 
 void nautilus_navigation_state_sync_all (NautilusNavigationState *state);
 
+void nautilus_navigation_state_set_boolean (NautilusNavigationState *self,
+					    const gchar *action_name,
+					    gboolean value);
+
 #endif /* __NAUTILUS_NAVIGATION_STATE_H__ */



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