aboutsummaryrefslogblamecommitdiffstats
path: root/modules/calendar/e-cal-shell-settings.c
blob: 3852de0a52334eb6e9e0d96b1656c26ffc1b8b64 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
  
                         











                                                                    
                                                                             





                                                        
                                 

                               

                               

                             



























































































































































































































































































































































































































































                                                                             

    
                                                 




                                                            

                                                   

                                                                     
                                                   







                                                                   



                                                                              



                                                             











                                                                       
                                                  

                                                                               

                                                   

                                                                               

                                                   

                                                                      

                                                   

                                                                     
                                                   







                                                                
                                           

                                                                   
                                                   



                                                                             







                                                                   
                                     

                                                                   




                                                               

                                                   

                                                                      

                                                   
                                                                        
 
                                                                     
                                                   
                                           

                                                                   

                                                   

                                                                 

                                                   

                                                                   

                                                   

                                                                   

                                                   

                                                                     
                                                   
                                          
                                                                 















                                                              

                                                      

                                                 

                                                











                                             

                                                           















                                                                    

                                                          












                                                        

                                                          












                                                        

                                                           












                                                         

                                                             












                                                           

                                                            












                                                          

                                                          












                                                        

                                                            

                                                          

                                                
 
/*
 * e-cal-shell-settings.c
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) version 3.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with the program; if not, see <http://www.gnu.org/licenses/>
 *
 *
 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
 *
 */

#include "e-cal-shell-settings.h"

#include <gconf/gconf-client.h>
#include <libecal/e-cal-util.h>

#include "e-util/e-binding.h"

static gboolean
transform_string_to_icaltimezone (const GValue *src_value,
                                  GValue *dst_value,
                                  gpointer user_data)
{
    EShellSettings *shell_settings;
    gboolean use_system_timezone;
    const gchar *location = NULL;
    icaltimezone *timezone = NULL;

    shell_settings = E_SHELL_SETTINGS (user_data);

    use_system_timezone = e_shell_settings_get_boolean (
        shell_settings, "cal-use-system-timezone");

    if (use_system_timezone)
        timezone = e_cal_util_get_system_timezone ();
    else
        location = g_value_get_string (src_value);

    if (location != NULL && *location != '\0')
        timezone = icaltimezone_get_builtin_timezone (location);

    if (timezone == NULL)
        timezone = icaltimezone_get_utc_timezone ();

    g_value_set_pointer (dst_value, timezone);

    return TRUE;
}

static gboolean
transform_icaltimezone_to_string (const GValue *src_value,
                                  GValue *dst_value,
                                  gpointer user_data)
{
    const gchar *location = NULL;
    icaltimezone *timezone;

    timezone = g_value_get_pointer (src_value);

    if (timezone != NULL)
        location = icaltimezone_get_location (timezone);

    if (location == NULL)
        location = "UTC";

    g_value_set_string (dst_value, location);

    return TRUE;
}

static gboolean
transform_weekdays_gconf_to_evolution (const GValue *src_value,
                                       GValue *dst_value,
                                       gpointer user_data)
{
    GDateWeekday weekday;

    /* XXX At some point, Evolution changed its weekday numbering
     *     from 0 = Sunday to 0 = Monday, but did not migrate the
     *     "week_start_day" key.  Both enumerations are of course
     *     different from GDateWeekday.  We should have saved the
     *     weekday as a string instead. */

    /* This is purposefully verbose for better readability. */

    /* GConf numbering */
    switch (g_value_get_int (src_value)) {
        case 0:
            weekday = G_DATE_SUNDAY;
            break;
        case 1:
            weekday = G_DATE_MONDAY;
            break;
        case 2:
            weekday = G_DATE_TUESDAY;
            break;
        case 3:
            weekday = G_DATE_WEDNESDAY;
            break;
        case 4:
            weekday = G_DATE_THURSDAY;
            break;
        case 5:
            weekday = G_DATE_FRIDAY;
            break;
        case 6:
            weekday = G_DATE_SATURDAY;
            break;
        default:
            return FALSE;
    }

    /* Evolution numbering */
    switch (weekday) {
        case G_DATE_MONDAY:
            g_value_set_int (dst_value, 0);
            break;
        case G_DATE_TUESDAY:
            g_value_set_int (dst_value, 1);
            break;
        case G_DATE_WEDNESDAY:
            g_value_set_int (dst_value, 2);
            break;
        case G_DATE_THURSDAY:
            g_value_set_int (dst_value, 3);
            break;
        case G_DATE_FRIDAY:
            g_value_set_int (dst_value, 4);
            break;
        case G_DATE_SATURDAY:
            g_value_set_int (dst_value, 5);
            break;
        case G_DATE_SUNDAY:
            g_value_set_int (dst_value, 6);
            break;
        default:
            return FALSE;
    }

    return TRUE;
}

static gboolean
transform_weekdays_evolution_to_gconf (const GValue *src_value,
                                       GValue *dst_value,
                                       gpointer user_data)
{
    GDateWeekday weekday;

    /* XXX At some point, Evolution changed its weekday numbering
     *     from 0 = Sunday to 0 = Monday, but did not migrate the
     *     "week_start_day" key.  Both enumerations are of course
     *     different from GDateWeekday.  We should have saved the
     *     weekday as a string instead. */

    /* This is purposefully verbose for better readability. */

    /* GConf numbering */
    switch (g_value_get_int (src_value)) {
        case 0:
            weekday = G_DATE_MONDAY;
            break;
        case 1:
            weekday = G_DATE_TUESDAY;
            break;
        case 2:
            weekday = G_DATE_WEDNESDAY;
            break;
        case 3:
            weekday = G_DATE_THURSDAY;
            break;
        case 4:
            weekday = G_DATE_FRIDAY;
            break;
        case 5:
            weekday = G_DATE_SATURDAY;
            break;
        case 6:
            weekday = G_DATE_SUNDAY;
            break;
        default:
            return FALSE;
    }

    /* Evolution numbering */
    switch (weekday) {
        case G_DATE_MONDAY:
            g_value_set_int (dst_value, 1);
            break;
        case G_DATE_TUESDAY:
            g_value_set_int (dst_value, 2);
            break;
        case G_DATE_WEDNESDAY:
            g_value_set_int (dst_value, 3);
            break;
        case G_DATE_THURSDAY:
            g_value_set_int (dst_value, 4);
            break;
        case G_DATE_FRIDAY:
            g_value_set_int (dst_value, 5);
            break;
        case G_DATE_SATURDAY:
            g_value_set_int (dst_value, 6);
            break;
        case G_DATE_SUNDAY:
            g_value_set_int (dst_value, 0);
            break;
        default:
            return FALSE;
    }

    return TRUE;
}

/* Working day flags */
enum {
    WORKING_DAY_SUNDAY  = 1 << 0,
    WORKING_DAY_MONDAY  = 1 << 1,
    WORKING_DAY_TUESDAY = 1 << 2,
    WORKING_DAY_WEDNESDAY   = 1 << 3,
    WORKING_DAY_THURSDAY    = 1 << 4,
    WORKING_DAY_FRIDAY  = 1 << 5,
    WORKING_DAY_SATURDAY    = 1 << 6
};

static gboolean
transform_working_days_bitset_to_sunday (const GValue *src_value,
                                         GValue *dst_value,
                                         gpointer user_data)
{
    gint bitset;
    gboolean working_day;

    bitset = g_value_get_int (src_value);
    working_day = ((bitset & WORKING_DAY_SUNDAY) != 0);
    g_value_set_boolean (dst_value, working_day);

    return TRUE;
}

static gboolean
transform_working_days_sunday_to_bitset (const GValue *src_value,
                                         GValue *dst_value,
                                         gpointer user_data)
{
    EShellSettings *shell_settings;
    gint bitset, bit;

    shell_settings = E_SHELL_SETTINGS (user_data);

    bitset = e_shell_settings_get_int (
        shell_settings, "cal-working-days-bitset");

    bit = g_value_get_boolean (src_value) ? WORKING_DAY_SUNDAY : 0;
    g_value_set_int (dst_value, (bitset & ~WORKING_DAY_SUNDAY) | bit);

    return TRUE;
}

static gboolean
transform_working_days_bitset_to_monday (const GValue *src_value,
                                         GValue *dst_value,
                                         gpointer user_data)
{
    gint bitset;
    gboolean working_day;

    bitset = g_value_get_int (src_value);
    working_day = ((bitset & WORKING_DAY_MONDAY) != 0);
    g_value_set_boolean (dst_value, working_day);

    return TRUE;
}

static gboolean
transform_working_days_monday_to_bitset (const GValue *src_value,
                                         GValue *dst_value,
                                         gpointer user_data)
{
    EShellSettings *shell_settings;
    gint bitset, bit;

    shell_settings = E_SHELL_SETTINGS (user_data);

    bitset = e_shell_settings_get_int (
        shell_settings, "cal-working-days-bitset");

    bit = g_value_get_boolean (src_value) ? WORKING_DAY_MONDAY : 0;
    g_value_set_int (dst_value, (bitset & ~WORKING_DAY_MONDAY) | bit);

    return TRUE;
}

static gboolean
transform_working_days_bitset_to_tuesday (const GValue *src_value,
                                          GValue *dst_value,
                                          gpointer user_data)
{
    gint bitset;
    gboolean working_day;

    bitset = g_value_get_int (src_value);
    working_day = ((bitset & WORKING_DAY_TUESDAY) != 0);
    g_value_set_boolean (dst_value, working_day);

    return TRUE;
}

static gboolean
transform_working_days_tuesday_to_bitset (const GValue *src_value,
                                          GValue *dst_value,
                                          gpointer user_data)
{
    EShellSettings *shell_settings;
    gint bitset, bit;

    shell_settings = E_SHELL_SETTINGS (user_data);

    bitset = e_shell_settings_get_int (
        shell_settings, "cal-working-days-bitset");

    bit = g_value_get_boolean (src_value) ? WORKING_DAY_TUESDAY : 0;
    g_value_set_int (dst_value, (bitset & ~WORKING_DAY_TUESDAY) | bit);

    return TRUE;
}

static gboolean
transform_working_days_bitset_to_wednesday (const GValue *src_value,
                                            GValue *dst_value,
                                            gpointer user_data)
{
    gint bitset;
    gboolean working_day;

    bitset = g_value_get_int (src_value);
    working_day = ((bitset & WORKING_DAY_WEDNESDAY) != 0);
    g_value_set_boolean (dst_value, working_day);

    return TRUE;
}

static gboolean
transform_working_days_wednesday_to_bitset (const GValue *src_value,
                                            GValue *dst_value,
                                            gpointer user_data)
{
    EShellSettings *shell_settings;
    gint bitset, bit;

    shell_settings = E_SHELL_SETTINGS (user_data);

    bitset = e_shell_settings_get_int (
        shell_settings, "cal-working-days-bitset");

    bit = g_value_get_boolean (src_value) ? WORKING_DAY_WEDNESDAY : 0;
    g_value_set_int (dst_value, (bitset & ~WORKING_DAY_WEDNESDAY) | bit);

    return TRUE;
}

static gboolean
transform_working_days_bitset_to_thursday (const GValue *src_value,
                                           GValue *dst_value,
                                           gpointer user_data)
{
    gint bitset;
    gboolean working_day;

    bitset = g_value_get_int (src_value);
    working_day = ((bitset & WORKING_DAY_THURSDAY) != 0);
    g_value_set_boolean (dst_value, working_day);

    return TRUE;
}

static gboolean
transform_working_days_thursday_to_bitset (const GValue *src_value,
                                           GValue *dst_value,
                                           gpointer user_data)
{
    EShellSettings *shell_settings;
    gint bitset, bit;

    shell_settings = E_SHELL_SETTINGS (user_data);

    bitset = e_shell_settings_get_int (
        shell_settings, "cal-working-days-bitset");

    bit = g_value_get_boolean (src_value) ? WORKING_DAY_THURSDAY : 0;
    g_value_set_int (dst_value, (bitset & ~WORKING_DAY_THURSDAY) | bit);

    return TRUE;
}

static gboolean
transform_working_days_bitset_to_friday (const GValue *src_value,
                                         GValue *dst_value,
                                         gpointer user_data)
{
    gint bitset;
    gboolean working_day;

    bitset = g_value_get_int (src_value);
    working_day = ((bitset & WORKING_DAY_FRIDAY) != 0);
    g_value_set_boolean (dst_value, working_day);

    return TRUE;
}

static gboolean
transform_working_days_friday_to_bitset (const GValue *src_value,
                                         GValue *dst_value,
                                         gpointer user_data)
{
    EShellSettings *shell_settings;
    gint bitset, bit;

    shell_settings = E_SHELL_SETTINGS (user_data);

    bitset = e_shell_settings_get_int (
        shell_settings, "cal-working-days-bitset");

    bit = g_value_get_boolean (src_value) ? WORKING_DAY_FRIDAY : 0;
    g_value_set_int (dst_value, (bitset & ~WORKING_DAY_FRIDAY) | bit);

    return TRUE;
}

static gboolean
transform_working_days_bitset_to_saturday (const GValue *src_value,
                                           GValue *dst_value,
                                           gpointer user_data)
{
    gint bitset;
    gboolean working_day;

    bitset = g_value_get_int (src_value);
    working_day = ((bitset & WORKING_DAY_SATURDAY) != 0);
    g_value_set_boolean (dst_value, working_day);

    return TRUE;
}

static gboolean
transform_working_days_saturday_to_bitset (const GValue *src_value,
                                           GValue *dst_value,
                                           gpointer user_data)
{
    EShellSettings *shell_settings;
    gint bitset, bit;

    shell_settings = E_SHELL_SETTINGS (user_data);

    bitset = e_shell_settings_get_int (
        shell_settings, "cal-working-days-bitset");

    bit = g_value_get_boolean (src_value) ? WORKING_DAY_SATURDAY : 0;
    g_value_set_int (dst_value, (bitset & ~WORKING_DAY_SATURDAY) | bit);

    return TRUE;
}

void
e_cal_shell_backend_init_settings (EShell *shell)
{
    EShellSettings *shell_settings;

    shell_settings = e_shell_get_shell_settings (shell);

    e_shell_settings_install_property_for_key (
        "cal-compress-weekend",
        "/apps/evolution/calendar/display/compress_weekend");

    e_shell_settings_install_property_for_key (
        "cal-confirm-delete",
        "/apps/evolution/calendar/prompts/confirm_delete");

    e_shell_settings_install_property_for_key (
        "cal-confirm-purge",
        "/apps/evolution/calendar/prompts/confirm_purge");

    e_shell_settings_install_property_for_key (
        "cal-day-view-show-week-numbers",
        "/apps/evolution/calendar/display/day_view_show_week_number");

    e_shell_settings_install_property_for_key (
        "cal-free-busy-template",
        "/apps/evolution/calendar/publish/template");

    e_shell_settings_install_property_for_key (
        "cal-hide-completed-tasks",
        "/apps/evolution/calendar/tasks/hide_completed");

    e_shell_settings_install_property_for_key (
        "cal-hide-completed-tasks-units",
        "/apps/evolution/calendar/tasks/hide_completed_units");

    e_shell_settings_install_property_for_key (
        "cal-hide-completed-tasks-value",
        "/apps/evolution/calendar/tasks/hide_completed_value");

    e_shell_settings_install_property_for_key (
        "cal-marcus-bains-day-view-color",
        "/apps/evolution/calendar/display/marcus_bains_color_dayview");

    e_shell_settings_install_property_for_key (
        "cal-marcus-bains-time-bar-color",
        "/apps/evolution/calendar/display/marcus_bains_color_timebar");

    e_shell_settings_install_property_for_key (
        "cal-marcus-bains-show-line",
        "/apps/evolution/calendar/display/marcus_bains_line");

    e_shell_settings_install_property_for_key (
        "cal-primary-calendar",
        "/apps/evolution/calendar/display/primary_calendar");

    e_shell_settings_install_property_for_key (
        "cal-primary-memo-list",
        "/apps/evolution/calendar/memos/primary_memos");

    e_shell_settings_install_property_for_key (
        "cal-primary-task-list",
        "/apps/evolution/calendar/tasks/primary_tasks");

    e_shell_settings_install_property_for_key (
        "cal-show-event-end-times",
        "/apps/evolution/calendar/display/show_event_end");

    e_shell_settings_install_property_for_key (
        "cal-show-week-numbers",
        "/apps/evolution/calendar/date_navigator/show_week_numbers");

    e_shell_settings_install_property_for_key (
        "cal-tasks-color-due-today",
        "/apps/evolution/calendar/tasks/colors/due_today");

    e_shell_settings_install_property_for_key (
        "cal-tasks-color-overdue",
        "/apps/evolution/calendar/tasks/colors/overdue");

    e_shell_settings_install_property_for_key (
        "cal-time-divisions",
        "/apps/evolution/calendar/display/time_divisions");

    /* Do not bind to this.  Use "cal-timezone" instead. */
    e_shell_settings_install_property_for_key (
        "cal-timezone-string",
        "/apps/evolution/calendar/display/timezone");

    e_shell_settings_install_property_for_key (
        "cal-use-24-hour-format",
        "/apps/evolution/calendar/display/use_24hour_format");

    e_shell_settings_install_property_for_key (
        "cal-use-system-timezone",
        "/apps/evolution/calendar/display/use_system_timezone");

    /* Do not bind to this.  Use "cal-week-start-day" instead. */
    e_shell_settings_install_property_for_key (
        "cal-week-start-day-gconf",
        "/apps/evolution/calendar/display/week_start_day");

    e_shell_settings_install_property_for_key (
        "cal-work-day-end-hour",
        "/apps/evolution/calendar/display/day_end_hour");

    e_shell_settings_install_property_for_key (
        "cal-work-day-end-minute",
        "/apps/evolution/calendar/display/day_end_minute");

    e_shell_settings_install_property_for_key (
        "cal-work-day-start-hour",
        "/apps/evolution/calendar/display/day_start_hour");

    e_shell_settings_install_property_for_key (
        "cal-work-day-start-minute",
        "/apps/evolution/calendar/display/day_start_minute");

    e_shell_settings_install_property_for_key (
        "cal-working-days-bitset",
        "/apps/evolution/calendar/display/working_days");

    /* 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_pointer (
            "cal-timezone",
            NULL,
            NULL,
            G_PARAM_READWRITE));

    e_mutual_binding_new_full (
        shell_settings, "cal-timezone-string",
        shell_settings, "cal-timezone",
        transform_string_to_icaltimezone,
        transform_icaltimezone_to_string,
        (GDestroyNotify) g_object_unref,
        g_object_ref (shell_settings));

    e_shell_settings_install_property (
        g_param_spec_int (
            "cal-week-start-day",
            NULL,
            NULL,
            0,  /* Monday */
            6,  /* Sunday */
            0,
            G_PARAM_READWRITE));

    e_mutual_binding_new_full (
        shell_settings, "cal-week-start-day-gconf",
        shell_settings, "cal-week-start-day",
        transform_weekdays_gconf_to_evolution,
        transform_weekdays_evolution_to_gconf,
        (GDestroyNotify) NULL, NULL);

    /* XXX These are my favorite.  Storing a bit array in GConf
     *     instead of separate boolean keys.  Brilliant move. */

    e_shell_settings_install_property (
        g_param_spec_boolean (
            "cal-working-days-sunday",
            NULL,
            NULL,
            FALSE,
            G_PARAM_READWRITE));

    e_mutual_binding_new_full (
        shell_settings, "cal-working-days-bitset",
        shell_settings, "cal-working-days-sunday",
        transform_working_days_bitset_to_sunday,
        transform_working_days_sunday_to_bitset,
        (GDestroyNotify) NULL, shell_settings);

    e_shell_settings_install_property (
        g_param_spec_boolean (
            "cal-working-days-monday",
            NULL,
            NULL,
            TRUE,
            G_PARAM_READWRITE));

    e_mutual_binding_new_full (
        shell_settings, "cal-working-days-bitset",
        shell_settings, "cal-working-days-monday",
        transform_working_days_bitset_to_monday,
        transform_working_days_monday_to_bitset,
        (GDestroyNotify) NULL, shell_settings);

    e_shell_settings_install_property (
        g_param_spec_boolean (
            "cal-working-days-tuesday",
            NULL,
            NULL,
            TRUE,
            G_PARAM_READWRITE));

    e_mutual_binding_new_full (
        shell_settings, "cal-working-days-bitset",
        shell_settings, "cal-working-days-tuesday",
        transform_working_days_bitset_to_tuesday,
        transform_working_days_tuesday_to_bitset,
        (GDestroyNotify) NULL, shell_settings);

    e_shell_settings_install_property (
        g_param_spec_boolean (
            "cal-working-days-wednesday",
            NULL,
            NULL,
            TRUE,
            G_PARAM_READWRITE));

    e_mutual_binding_new_full (
        shell_settings, "cal-working-days-bitset",
        shell_settings, "cal-working-days-wednesday",
        transform_working_days_bitset_to_wednesday,
        transform_working_days_wednesday_to_bitset,
        (GDestroyNotify) NULL, shell_settings);

    e_shell_settings_install_property (
        g_param_spec_boolean (
            "cal-working-days-thursday",
            NULL,
            NULL,
            TRUE,
            G_PARAM_READWRITE));

    e_mutual_binding_new_full (
        shell_settings, "cal-working-days-bitset",
        shell_settings, "cal-working-days-thursday",
        transform_working_days_bitset_to_thursday,
        transform_working_days_thursday_to_bitset,
        (GDestroyNotify) NULL, shell_settings);

    e_shell_settings_install_property (
        g_param_spec_boolean (
            "cal-working-days-friday",
            NULL,
            NULL,
            TRUE,
            G_PARAM_READWRITE));

    e_mutual_binding_new_full (
        shell_settings, "cal-working-days-bitset",
        shell_settings, "cal-working-days-friday",
        transform_working_days_bitset_to_friday,
        transform_working_days_friday_to_bitset,
        (GDestroyNotify) NULL, shell_settings);

    e_shell_settings_install_property (
        g_param_spec_boolean (
            "cal-working-days-saturday",
            NULL,
            NULL,
            FALSE,
            G_PARAM_READWRITE));

    e_mutual_binding_new_full (
        shell_settings, "cal-working-days-bitset",
        shell_settings, "cal-working-days-saturday",
        transform_working_days_bitset_to_saturday,
        transform_working_days_saturday_to_bitset,
        (GDestroyNotify) g_object_unref,
        g_object_ref (shell_settings));
}