Bug 794832 - Option to close window on deletion, not open next mail
[evolution.git] / src / modules / settings / e-settings-mail-browser.c
blob3c137c06e288ae3511585f1c42d93490e5856e2d
1 /*
2 * e-settings-mail-browser.c
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * for more details.
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program; if not, see <http://www.gnu.org/licenses/>.
18 #include "e-settings-mail-browser.h"
20 #include <mail/e-mail-browser.h>
22 #define E_SETTINGS_MAIL_BROWSER_GET_PRIVATE(obj) \
23 (G_TYPE_INSTANCE_GET_PRIVATE \
24 ((obj), E_TYPE_SETTINGS_MAIL_BROWSER, ESettingsMailBrowserPrivate))
26 G_DEFINE_DYNAMIC_TYPE (
27 ESettingsMailBrowser,
28 e_settings_mail_browser,
29 E_TYPE_EXTENSION)
31 static void
32 settings_mail_browser_constructed (GObject *object)
34 EExtensible *extensible;
35 GSettings *settings;
37 /* Chain up parent's constructed() method. */
38 G_OBJECT_CLASS (e_settings_mail_browser_parent_class)->constructed (object);
40 extensible = e_extension_get_extensible (E_EXTENSION (object));
42 settings = e_util_ref_settings ("org.gnome.evolution.mail");
44 /* This preference is selected directly from the mail
45 * browser window, so the binding must be bi-directional. */
46 g_settings_bind (
47 settings, "browser-close-on-reply-policy",
48 extensible, "close-on-reply-policy",
49 G_SETTINGS_BIND_GET |
50 G_SETTINGS_BIND_SET);
52 g_settings_bind (
53 settings, "show-deleted",
54 extensible, "show-deleted",
55 G_SETTINGS_BIND_GET);
57 g_settings_bind (
58 settings, "show-junk",
59 extensible, "show-junk",
60 G_SETTINGS_BIND_GET);
62 g_settings_bind (
63 settings, "browser-close-on-delete-or-junk",
64 extensible, "close-on-delete-or-junk",
65 G_SETTINGS_BIND_GET);
67 g_object_unref (settings);
70 static void
71 e_settings_mail_browser_class_init (ESettingsMailBrowserClass *class)
73 GObjectClass *object_class;
74 EExtensionClass *extension_class;
76 object_class = G_OBJECT_CLASS (class);
77 object_class->constructed = settings_mail_browser_constructed;
79 extension_class = E_EXTENSION_CLASS (class);
80 extension_class->extensible_type = E_TYPE_MAIL_BROWSER;
83 static void
84 e_settings_mail_browser_class_finalize (ESettingsMailBrowserClass *class)
88 static void
89 e_settings_mail_browser_init (ESettingsMailBrowser *extension)
93 void
94 e_settings_mail_browser_type_register (GTypeModule *type_module)
96 /* XXX G_DEFINE_DYNAMIC_TYPE declares a static type registration
97 * function, so we have to wrap it with a public function in
98 * order to register types from a separate compilation unit. */
99 e_settings_mail_browser_register_type (type_module);