aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-10-19 04:00:29 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-10-19 04:00:29 +0800
commita133df0caffc738bb0db8e0f23c3eb628eac12a1 (patch)
tree3ae34c3440418424aae018e248067e2725873e3c /modules
parentf261f288c8dee85c36ff1b199f71a7730870ae47 (diff)
downloadgsoc2013-evolution-a133df0caffc738bb0db8e0f23c3eb628eac12a1.tar
gsoc2013-evolution-a133df0caffc738bb0db8e0f23c3eb628eac12a1.tar.gz
gsoc2013-evolution-a133df0caffc738bb0db8e0f23c3eb628eac12a1.tar.bz2
gsoc2013-evolution-a133df0caffc738bb0db8e0f23c3eb628eac12a1.tar.lz
gsoc2013-evolution-a133df0caffc738bb0db8e0f23c3eb628eac12a1.tar.xz
gsoc2013-evolution-a133df0caffc738bb0db8e0f23c3eb628eac12a1.tar.zst
gsoc2013-evolution-a133df0caffc738bb0db8e0f23c3eb628eac12a1.zip
Add an "ellipsize" property to EMFolderTree.
So we don't have to access GConf directly from EMFolderTree. The property gets bound to an EShellSettings property, which is in turn bound to the "no_folder_dots" GConf key by way of a transform function.
Diffstat (limited to 'modules')
-rw-r--r--modules/mail/e-mail-shell-settings.c50
-rw-r--r--modules/mail/e-mail-shell-sidebar.c7
2 files changed, 55 insertions, 2 deletions
diff --git a/modules/mail/e-mail-shell-settings.c b/modules/mail/e-mail-shell-settings.c
index 5452a1939a..503edaf121 100644
--- a/modules/mail/e-mail-shell-settings.c
+++ b/modules/mail/e-mail-shell-settings.c
@@ -31,6 +31,24 @@
#include <shell/e-shell.h>
+static gboolean
+transform_no_folder_dots_to_ellipsize (GBinding *binding,
+ const GValue *source_value,
+ GValue *target_value,
+ gpointer user_data)
+{
+ PangoEllipsizeMode ellipsize;
+
+ if (g_value_get_boolean (source_value))
+ ellipsize = PANGO_ELLIPSIZE_NONE;
+ else
+ ellipsize = PANGO_ELLIPSIZE_END;
+
+ g_value_set_enum (target_value, ellipsize);
+
+ return TRUE;
+}
+
void
e_mail_shell_settings_init (EShellBackend *shell_backend)
{
@@ -160,6 +178,11 @@ e_mail_shell_settings_init (EShellBackend *shell_backend)
"mail-message-text-part-limit",
"/apps/evolution/mail/display/message_text_part_limit");
+ /* Do not bind to this. Use "mail-sidebar-ellipsize" instead. */
+ e_shell_settings_install_property_for_key (
+ "mail-no-folder-dots",
+ "/apps/evolution/mail/display/no_folder_dots");
+
e_shell_settings_install_property_for_key (
"mail-only-local-photos",
"/apps/evolution/mail/display/photo_local");
@@ -192,7 +215,7 @@ e_mail_shell_settings_init (EShellBackend *shell_backend)
"/apps/evolution/mail/display/sender_photo");
e_shell_settings_install_property_for_key (
- "mail-side-bar-search",
+ "mail-sidebar-search",
"/apps/evolution/mail/display/side_bar_search");
e_shell_settings_install_property_for_key (
@@ -276,4 +299,29 @@ e_mail_shell_settings_init (EShellBackend *shell_backend)
e_shell_settings_install_property_for_key (
"composer-no-signature-delim",
"/apps/evolution/mail/composer/no_signature_delim");
+
+ /* These properties use transform functions to convert
+ * GConf values to forms more useful to Evolution. We
+ * have to use separate properties because GConfBridge
+ * does not support transform functions. Much of this
+ * is backward-compatibility cruft for poorly designed
+ * GConf schemas. */
+
+ e_shell_settings_install_property (
+ g_param_spec_enum (
+ "mail-sidebar-ellipsize",
+ NULL,
+ NULL,
+ PANGO_TYPE_ELLIPSIZE_MODE,
+ PANGO_ELLIPSIZE_NONE,
+ G_PARAM_READWRITE));
+
+ g_object_bind_property_full (
+ shell_settings, "mail-no-folder-dots",
+ shell_settings, "mail-sidebar-ellipsize",
+ G_BINDING_SYNC_CREATE,
+ transform_no_folder_dots_to_ellipsize,
+ NULL,
+ g_object_ref (shell_settings),
+ (GDestroyNotify) g_object_unref);
}
diff --git a/modules/mail/e-mail-shell-sidebar.c b/modules/mail/e-mail-shell-sidebar.c
index f938b3fae1..2b24aae5e1 100644
--- a/modules/mail/e-mail-shell-sidebar.c
+++ b/modules/mail/e-mail-shell-sidebar.c
@@ -169,7 +169,12 @@ mail_shell_sidebar_constructed (GObject *object)
G_BINDING_SYNC_CREATE);
g_object_bind_property (
- shell_settings, "mail-side-bar-search",
+ shell_settings, "mail-sidebar-ellipsize",
+ widget, "ellipsize",
+ G_BINDING_SYNC_CREATE);
+
+ g_object_bind_property (
+ shell_settings, "mail-sidebar-search",
widget, "enable-search",
G_BINDING_SYNC_CREATE);