Updated Traditional Chinese translation(Hong Kong and Taiwan)
[evolution.git] / modules / mail / e-mail-shell-settings.c
blob99402d5f290e54d10ceacfcbf4790fc0e862407b
1 /*
2 * e-mail-shell-settings.c
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) version 3.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with the program; if not, see <http://www.gnu.org/licenses/>
18 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
22 #ifdef HAVE_CONFIG_H
23 #include <config.h>
24 #endif
26 #include "e-mail-shell-settings.h"
28 #include <gconf/gconf-client.h>
30 #include <mail/e-mail-backend.h>
31 #include <mail/e-mail-label-list-store.h>
33 #include <shell/e-shell.h>
35 static gboolean
36 transform_no_folder_dots_to_ellipsize (GBinding *binding,
37 const GValue *source_value,
38 GValue *target_value,
39 gpointer user_data)
41 PangoEllipsizeMode ellipsize;
43 if (g_value_get_boolean (source_value))
44 ellipsize = PANGO_ELLIPSIZE_NONE;
45 else
46 ellipsize = PANGO_ELLIPSIZE_END;
48 g_value_set_enum (target_value, ellipsize);
50 return TRUE;
53 void
54 e_mail_shell_settings_init (EShellBackend *shell_backend)
56 EShell *shell;
57 EShellSettings *shell_settings;
58 EMailBackend *backend;
59 EMailSession *session;
60 gpointer object;
62 shell = e_shell_backend_get_shell (shell_backend);
63 shell_settings = e_shell_get_shell_settings (shell);
65 backend = E_MAIL_BACKEND (shell_backend);
66 session = e_mail_backend_get_session (backend);
68 /*** Global Objects ***/
70 e_shell_settings_install_property (
71 g_param_spec_object (
72 "mail-label-list-store",
73 NULL,
74 NULL,
75 E_TYPE_MAIL_LABEL_LIST_STORE,
76 G_PARAM_READWRITE));
78 object = e_mail_label_list_store_new ();
79 e_shell_settings_set_object (
80 shell_settings, "mail-label-list-store", object);
81 g_object_unref (object);
83 e_shell_settings_install_property (
84 g_param_spec_pointer (
85 "mail-session",
86 NULL,
87 NULL,
88 G_PARAM_READWRITE));
90 e_shell_settings_set_pointer (
91 shell_settings, "mail-session",
92 g_object_ref (session));
94 /*** Mail Preferences ***/
96 e_shell_settings_install_property_for_key (
97 "mail-address-compress",
98 "/apps/evolution/mail/display/address_compress");
100 e_shell_settings_install_property_for_key (
101 "mail-address-count",
102 "/apps/evolution/mail/display/address_count");
104 e_shell_settings_install_property_for_key (
105 "mail-charset",
106 "/apps/evolution/mail/display/charset");
108 e_shell_settings_install_property_for_key (
109 "mail-check-for-junk",
110 "/apps/evolution/mail/junk/check_incoming");
112 e_shell_settings_install_property_for_key (
113 "mail-check-on-start",
114 "/apps/evolution/mail/send_recv_on_start");
116 e_shell_settings_install_property_for_key (
117 "mail-check-all-on-start",
118 "/apps/evolution/mail/send_recv_all_on_start");
120 e_shell_settings_install_property_for_key (
121 "mail-citation-color",
122 "/apps/evolution/mail/display/citation_colour");
124 e_shell_settings_install_property_for_key (
125 "mail-confirm-expunge",
126 "/apps/evolution/mail/prompts/expunge");
128 e_shell_settings_install_property_for_key (
129 "mail-confirm-unwanted-html",
130 "/apps/evolution/mail/prompts/unwanted_html");
132 e_shell_settings_install_property_for_key (
133 "mail-empty-junk-on-exit",
134 "/apps/evolution/mail/junk/empty_on_exit");
136 e_shell_settings_install_property_for_key (
137 "mail-empty-trash-on-exit",
138 "/apps/evolution/mail/trash/empty_on_exit");
140 e_shell_settings_install_property_for_key (
141 "mail-enable-search-folders",
142 "/apps/evolution/mail/display/enable_vfolders");
144 e_shell_settings_install_property_for_key (
145 "mail-font-monospace",
146 "/apps/evolution/mail/display/fonts/monospace");
148 e_shell_settings_install_property_for_key (
149 "mail-font-variable",
150 "/apps/evolution/mail/display/fonts/variable");
152 e_shell_settings_install_property_for_key (
153 "mail-force-message-limit",
154 "/apps/evolution/mail/display/force_message_limit");
156 /* This value corresponds to the EMailForwardStyle enum. */
157 e_shell_settings_install_property_for_key (
158 "mail-forward-style",
159 "/apps/evolution/mail/format/forward_style");
161 /* This value corresponds to MailConfigHTTPMode enum. */
162 e_shell_settings_install_property_for_key (
163 "mail-image-loading-policy",
164 "/apps/evolution/mail/display/load_http_images");
166 e_shell_settings_install_property_for_key (
167 "mail-magic-spacebar",
168 "/apps/evolution/mail/display/magic_spacebar");
170 e_shell_settings_install_property_for_key (
171 "mail-global-view-setting",
172 "/apps/evolution/mail/display/global_view_setting");
174 e_shell_settings_install_property_for_key (
175 "mail-mark-citations",
176 "/apps/evolution/mail/display/mark_citations");
178 e_shell_settings_install_property_for_key (
179 "mail-mark-seen",
180 "/apps/evolution/mail/display/mark_seen");
182 e_shell_settings_install_property_for_key (
183 "mail-mark-seen-timeout",
184 "/apps/evolution/mail/display/mark_seen_timeout");
186 e_shell_settings_install_property_for_key (
187 "mail-message-text-part-limit",
188 "/apps/evolution/mail/display/message_text_part_limit");
190 /* Do not bind to this. Use "mail-sidebar-ellipsize" instead. */
191 e_shell_settings_install_property_for_key (
192 "mail-no-folder-dots",
193 "/apps/evolution/mail/display/no_folder_dots");
195 e_shell_settings_install_property_for_key (
196 "mail-only-local-photos",
197 "/apps/evolution/mail/display/photo_local");
199 e_shell_settings_install_property_for_key (
200 "mail-show-real-date",
201 "/apps/evolution/mail/display/show_real_date");
203 e_shell_settings_install_property_for_key (
204 "mail-prompt-delete-in-vfolder",
205 "/apps/evolution/mail/prompts/delete_in_vfolder");
207 /* This value corresponds to the EMailReplyStyle enum,
208 * but the ordering of the combo box items in preferences
209 * has changed. We use transformation functions there. */
210 e_shell_settings_install_property_for_key (
211 "mail-reply-style",
212 "/apps/evolution/mail/format/reply_style");
214 e_shell_settings_install_property_for_key (
215 "mail-safe-list",
216 "/apps/evolution/mail/display/safe_list");
218 e_shell_settings_install_property_for_key (
219 "mail-show-animated-images",
220 "/apps/evolution/mail/display/animated_images");
222 e_shell_settings_install_property_for_key (
223 "mail-show-sender-photo",
224 "/apps/evolution/mail/display/sender_photo");
226 e_shell_settings_install_property_for_key (
227 "mail-sidebar-search",
228 "/apps/evolution/mail/display/side_bar_search");
230 e_shell_settings_install_property_for_key (
231 "mail-thread-by-subject",
232 "/apps/evolution/mail/display/thread_subject");
234 e_shell_settings_install_property_for_key (
235 "mail-use-custom-fonts",
236 "/apps/evolution/mail/display/fonts/use_custom");
238 /*** Composer Preferences ***/
240 e_shell_settings_install_property_for_key (
241 "composer-charset",
242 "/apps/evolution/mail/composer/charset");
244 e_shell_settings_install_property_for_key (
245 "composer-format-html",
246 "/apps/evolution/mail/composer/send_html");
248 e_shell_settings_install_property_for_key (
249 "composer-inline-spelling",
250 "/apps/evolution/mail/composer/inline_spelling");
252 e_shell_settings_install_property_for_key (
253 "composer-magic-links",
254 "/apps/evolution/mail/composer/magic_links");
256 e_shell_settings_install_property_for_key (
257 "composer-magic-smileys",
258 "/apps/evolution/mail/composer/magic_smileys");
260 e_shell_settings_install_property_for_key (
261 "composer-outlook-filenames",
262 "/apps/evolution/mail/composer/outlook_filenames");
264 e_shell_settings_install_property_for_key (
265 "composer-ignore-list-reply-to",
266 "/apps/evolution/mail/composer/ignore_list_reply_to");
268 e_shell_settings_install_property_for_key (
269 "composer-group-reply-to-list",
270 "/apps/evolution/mail/composer/group_reply_to_list");
272 e_shell_settings_install_property_for_key (
273 "composer-prompt-only-bcc",
274 "/apps/evolution/mail/prompts/only_bcc");
276 e_shell_settings_install_property_for_key (
277 "composer-prompt-private-list-reply",
278 "/apps/evolution/mail/prompts/private_list_reply");
280 e_shell_settings_install_property_for_key (
281 "composer-prompt-reply-many-recips",
282 "/apps/evolution/mail/prompts/reply_many_recips");
284 e_shell_settings_install_property_for_key (
285 "composer-prompt-list-reply-to",
286 "/apps/evolution/mail/prompts/list_reply_to");
288 e_shell_settings_install_property_for_key (
289 "composer-prompt-empty-subject",
290 "/apps/evolution/mail/prompts/empty_subject");
292 e_shell_settings_install_property_for_key (
293 "composer-prompt-send-invalid-recip",
294 "/apps/evolution/mail/prompts/send_invalid_recip");
296 e_shell_settings_install_property_for_key (
297 "composer-reply-start-bottom",
298 "/apps/evolution/mail/composer/reply_start_bottom");
300 e_shell_settings_install_property_for_key (
301 "composer-request-receipt",
302 "/apps/evolution/mail/composer/request_receipt");
304 e_shell_settings_install_property_for_key (
305 "composer-spell-color",
306 "/apps/evolution/mail/composer/spell_color");
308 e_shell_settings_install_property_for_key (
309 "composer-top-signature",
310 "/apps/evolution/mail/composer/top_signature");
312 e_shell_settings_install_property_for_key (
313 "composer-no-signature-delim",
314 "/apps/evolution/mail/composer/no_signature_delim");
316 e_shell_settings_install_property_for_key (
317 "composer-gallery-path",
318 "/apps/evolution/mail/composer/gallery_path");
320 e_shell_settings_install_property_for_key (
321 "paned-view-headers-state",
322 "/apps/evolution/mail/display/paned_view_headers_state");
324 /* These properties use transform functions to convert
325 * GConf values to forms more useful to Evolution. We
326 * have to use separate properties because GConfBridge
327 * does not support transform functions. Much of this
328 * is backward-compatibility cruft for poorly designed
329 * GConf schemas. */
331 e_shell_settings_install_property (
332 g_param_spec_enum (
333 "mail-sidebar-ellipsize",
334 NULL,
335 NULL,
336 PANGO_TYPE_ELLIPSIZE_MODE,
337 PANGO_ELLIPSIZE_NONE,
338 G_PARAM_READWRITE));
340 g_object_bind_property_full (
341 shell_settings, "mail-no-folder-dots",
342 shell_settings, "mail-sidebar-ellipsize",
343 G_BINDING_SYNC_CREATE,
344 transform_no_folder_dots_to_ellipsize,
345 NULL,
346 g_object_ref (shell_settings),
347 (GDestroyNotify) g_object_unref);