aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-12-19 00:56:11 +0800
committerMilan Crha <mcrha@redhat.com>2009-12-19 00:56:11 +0800
commit10590768038b2f3172040da50533ca4f7802fc34 (patch)
tree64e23fda77958e0a421d828ccf54c4ee784bacf2 /e-util
parentf148a0b0e3aaee26c42c7fc03f7a6359ead71abb (diff)
downloadgsoc2013-evolution-10590768038b2f3172040da50533ca4f7802fc34.tar
gsoc2013-evolution-10590768038b2f3172040da50533ca4f7802fc34.tar.gz
gsoc2013-evolution-10590768038b2f3172040da50533ca4f7802fc34.tar.bz2
gsoc2013-evolution-10590768038b2f3172040da50533ca4f7802fc34.tar.lz
gsoc2013-evolution-10590768038b2f3172040da50533ca4f7802fc34.tar.xz
gsoc2013-evolution-10590768038b2f3172040da50533ca4f7802fc34.tar.zst
gsoc2013-evolution-10590768038b2f3172040da50533ca4f7802fc34.zip
Bug #596967 - Per-folder setting for threading and preview panel
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,