No issues found
1 /*
2 * e-cal-config-comp-editor.c
3 *
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.
8 *
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.
13 *
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/>
16 *
17 */
18
19 #ifdef HAVE_CONFIG_H
20 #include <config.h>
21 #endif
22
23 #include "e-cal-config-comp-editor.h"
24
25 #include <shell/e-shell.h>
26 #include <calendar/gui/dialogs/comp-editor.h>
27
28 #define E_CAL_CONFIG_COMP_EDITOR_GET_PRIVATE(obj) \
29 (G_TYPE_INSTANCE_GET_PRIVATE \
30 ((obj), E_TYPE_CAL_CONFIG_COMP_EDITOR, ECalConfigCompEditorPrivate))
31
32 struct _ECalConfigCompEditorPrivate {
33 gint placeholder;
34 };
35
36 G_DEFINE_DYNAMIC_TYPE (
37 ECalConfigCompEditor,
38 e_cal_config_comp_editor,
39 E_TYPE_EXTENSION)
40
41 static void
42 cal_config_comp_editor_constructed (GObject *object)
43 {
44 EExtension *extension;
45 EExtensible *extensible;
46 EShellSettings *shell_settings;
47 EShell *shell;
48
49 extension = E_EXTENSION (object);
50 extensible = e_extension_get_extensible (extension);
51
52 shell = e_shell_get_default ();
53 shell_settings = e_shell_get_shell_settings (shell);
54
55 g_object_bind_property (
56 shell_settings, "cal-timezone",
57 extensible, "timezone",
58 G_BINDING_SYNC_CREATE);
59
60 g_object_bind_property (
61 shell_settings, "cal-use-24-hour-format",
62 extensible, "use-24-hour-format",
63 G_BINDING_SYNC_CREATE);
64
65 g_object_bind_property (
66 shell_settings, "cal-work-day-end-hour",
67 extensible, "work-day-end-hour",
68 G_BINDING_SYNC_CREATE);
69
70 g_object_bind_property (
71 shell_settings, "cal-work-day-end-minute",
72 extensible, "work-day-end-minute",
73 G_BINDING_SYNC_CREATE);
74
75 g_object_bind_property (
76 shell_settings, "cal-work-day-start-hour",
77 extensible, "work-day-start-hour",
78 G_BINDING_SYNC_CREATE);
79
80 g_object_bind_property (
81 shell_settings, "cal-work-day-start-minute",
82 extensible, "work-day-start-minute",
83 G_BINDING_SYNC_CREATE);
84
85 /* Chain up to parent's constructed() method. */
86 G_OBJECT_CLASS (e_cal_config_comp_editor_parent_class)->
87 constructed (object);
88 }
89
90 static void
91 e_cal_config_comp_editor_class_init (ECalConfigCompEditorClass *class)
92 {
93 GObjectClass *object_class;
94 EExtensionClass *extension_class;
95
96 g_type_class_add_private (class, sizeof (ECalConfigCompEditorPrivate));
97
98 object_class = G_OBJECT_CLASS (class);
99 object_class->constructed = cal_config_comp_editor_constructed;
100
101 extension_class = E_EXTENSION_CLASS (class);
102 extension_class->extensible_type = TYPE_COMP_EDITOR;
103 }
104
105 static void
106 e_cal_config_comp_editor_class_finalize (ECalConfigCompEditorClass *class)
107 {
108 }
109
110 static void
111 e_cal_config_comp_editor_init (ECalConfigCompEditor *extension)
112 {
113 extension->priv = E_CAL_CONFIG_COMP_EDITOR_GET_PRIVATE (extension);
114 }
115
116 void
117 e_cal_config_comp_editor_type_register (GTypeModule *type_module)
118 {
119 /* XXX G_DEFINE_DYNAMIC_TYPE declares a static type registration
120 * function, so we have to wrap it with a public function in
121 * order to register types from a separate compilation unit. */
122 e_cal_config_comp_editor_register_type (type_module);
123 }