aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-settings.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2009-01-27 11:50:19 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2009-01-27 11:50:19 +0800
commit98d262b594caefd053a2d075e2d8482b2d8a12c8 (patch)
tree1474ebf4401477049436bf89a1432447995d0b00 /shell/e-shell-settings.c
parente0f414941dd4e13ea074996d10606b0dae7e494b (diff)
downloadgsoc2013-evolution-98d262b594caefd053a2d075e2d8482b2d8a12c8.tar
gsoc2013-evolution-98d262b594caefd053a2d075e2d8482b2d8a12c8.tar.gz
gsoc2013-evolution-98d262b594caefd053a2d075e2d8482b2d8a12c8.tar.bz2
gsoc2013-evolution-98d262b594caefd053a2d075e2d8482b2d8a12c8.tar.lz
gsoc2013-evolution-98d262b594caefd053a2d075e2d8482b2d8a12c8.tar.xz
gsoc2013-evolution-98d262b594caefd053a2d075e2d8482b2d8a12c8.tar.zst
gsoc2013-evolution-98d262b594caefd053a2d075e2d8482b2d8a12c8.zip
Add action groups to support lockdown, starting with printing.
Other categories to follow. Editors still need lockdown support. svn path=/branches/kill-bonobo/; revision=37136
Diffstat (limited to 'shell/e-shell-settings.c')
-rw-r--r--shell/e-shell-settings.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/shell/e-shell-settings.c b/shell/e-shell-settings.c
index b494aa17c8..b529130fd1 100644
--- a/shell/e-shell-settings.c
+++ b/shell/e-shell-settings.c
@@ -29,6 +29,7 @@
struct _EShellSettingsPrivate {
GArray *value_array;
+ guint debug : 1;
};
static GList *instances;
@@ -51,6 +52,16 @@ shell_settings_set_property (GObject *object,
g_value_copy (value, dest_value);
g_object_notify (object, pspec->name);
+
+ if (priv->debug) {
+ gchar *contents;
+
+ contents = g_strdup_value_contents (value);
+ g_debug (
+ "Setting '%s' set to '%s' (%s)",
+ pspec->name, contents, G_VALUE_TYPE_NAME (value));
+ g_free (contents);
+ }
}
static void
@@ -106,6 +117,8 @@ shell_settings_init (EShellSettings *shell_settings,
GObjectClass *object_class)
{
GArray *value_array;
+ GParamSpec **pspecs;
+ guint ii;
instances = g_list_prepend (instances, shell_settings);
@@ -114,6 +127,22 @@ shell_settings_init (EShellSettings *shell_settings,
shell_settings->priv = E_SHELL_SETTINGS_GET_PRIVATE (shell_settings);
shell_settings->priv->value_array = value_array;
+
+ g_object_freeze_notify (G_OBJECT (shell_settings));
+
+ pspecs = g_object_class_list_properties (object_class, NULL);
+ for (ii = 0; ii < property_count; ii++) {
+ GParamSpec *pspec = pspecs[ii];
+ GValue *value;
+
+ value = &g_array_index (value_array, GValue, ii);
+ g_value_init (value, G_PARAM_SPEC_VALUE_TYPE (pspec));
+ g_param_value_set_default (pspec, value);
+ g_object_notify (G_OBJECT (shell_settings), pspec->name);
+ }
+ g_free (pspecs);
+
+ g_object_thaw_notify (G_OBJECT (shell_settings));
}
GType
@@ -227,6 +256,20 @@ e_shell_settings_bind_to_gconf (EShellSettings *shell_settings,
}
/**
+ * e_shell_settings_enable_debug:
+ * @shell_settings: an #EShellSettings
+ *
+ * Print a debug message to standard output when a property value changes.
+ **/
+void
+e_shell_settings_enable_debug (EShellSettings *shell_settings)
+{
+ g_return_if_fail (E_IS_SHELL_SETTINGS (shell_settings));
+
+ shell_settings->priv->debug = TRUE;
+}
+
+/**
* e_shell_settings_get_boolean:
* @shell_settings: an #EShellSettings
* @property_name: an installed property name