aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
Diffstat (limited to 'e-util')
-rw-r--r--e-util/gconf-bridge.c40
-rw-r--r--e-util/gconf-bridge.h18
2 files changed, 58 insertions, 0 deletions
diff --git a/e-util/gconf-bridge.c b/e-util/gconf-bridge.c
index be2a0cabd7..03f82f43ca 100644
--- a/e-util/gconf-bridge.c
+++ b/e-util/gconf-bridge.c
@@ -550,6 +550,46 @@ gconf_bridge_bind_property_full (GConfBridge *bridge,
return binding->id;
}
+static void
+prop_binding_block_cb (gpointer hkey, PropBinding *binding, const gchar *key)
+{
+ g_return_if_fail (binding != NULL);
+ g_return_if_fail (key != NULL);
+ g_return_if_fail (binding->key != NULL);
+
+ if (binding->type == BINDING_PROP && g_ascii_strcasecmp (binding->key, key) == 0)
+ g_signal_handler_block (binding->object, binding->prop_notify_id);
+}
+
+static void
+prop_binding_unblock_cb (gpointer hkey, PropBinding *binding, const gchar *key)
+{
+ g_return_if_fail (binding != NULL);
+ g_return_if_fail (key != NULL);
+ g_return_if_fail (binding->key != NULL);
+
+ if (binding->type == BINDING_PROP && g_ascii_strcasecmp (binding->key, key) == 0)
+ g_signal_handler_unblock (binding->object, binding->prop_notify_id);
+}
+
+void
+gconf_bridge_block_property_bindings (GConfBridge *bridge, const gchar *key)
+{
+ g_return_if_fail (bridge != NULL);
+ g_return_if_fail (key != NULL);
+
+ g_hash_table_foreach (bridge->bindings, (GHFunc) prop_binding_block_cb, (gpointer)key);
+}
+
+void
+gconf_bridge_unblock_property_bindings (GConfBridge *bridge, const gchar *key)
+{
+ g_return_if_fail (bridge != NULL);
+ g_return_if_fail (key != NULL);
+
+ g_hash_table_foreach (bridge->bindings, (GHFunc) prop_binding_unblock_cb, (gpointer)key);
+}
+
/* Unbinds a property binding */
static void
prop_binding_unbind (PropBinding *binding)
diff --git a/e-util/gconf-bridge.h b/e-util/gconf-bridge.h
index 7c7f53b0ce..371f1173e5 100644
--- a/e-util/gconf-bridge.h
+++ b/e-util/gconf-bridge.h
@@ -70,6 +70,24 @@ guint gconf_bridge_bind_property_full (GConfBridge *bridge,
gconf_bridge_bind_property_full ((bridge), (key), \
(object), (prop), TRUE)
+/**
+ * gconf_bridge_block_property_bindings
+ * @bridge: A #GConfBridge
+ * @key: A GConf key to be blocked
+ *
+ * Blocks property bindings for @key. To unblock it call #gconf_bridge_unblock_property_bindings.
+ **/
+void gconf_bridge_block_property_bindings (GConfBridge *bridge, const gchar *key);
+
+/**
+ * gconf_bridge_unblock_property_bindings
+ * @bridge: A #GConfBridge
+ * @key: A GConf key to be unblocked
+ *
+ * Unblocks property bindings for @key, these should be previously blocked with #gconf_bridge_unblock_property_bindings.
+ **/
+void gconf_bridge_unblock_property_bindings (GConfBridge *bridge, const gchar *key);
+
guint gconf_bridge_bind_window (GConfBridge *bridge,
const gchar *key_prefix,
GtkWindow *window,