~ubuntu-branches/ubuntu/intrepid/osmo/intrepid-proposed

« back to all changes in this revision

Viewing changes to src/options_gui.c

  • Committer: Bazaar Package Importer
  • Author(s): Eike Nicklas
  • Date: 2008-02-09 12:49:42 UTC
  • Revision ID: james.westby@ubuntu.com-20080209124942-7f8x8oro11pzkiws
Tags: upstream-0.2.0
ImportĀ upstreamĀ versionĀ 0.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/*
 
3
 * Osmo - a handy personal organizer
 
4
 *
 
5
 * Copyright (C) 2007 Tomasz Maka <pasp@users.sourceforge.net>
 
6
 *
 
7
 * This program is free software; you can redistribute it and/or modify
 
8
 * it under the terms of the GNU General Public License as published by
 
9
 * the Free Software Foundation; either version 2 of the License, or
 
10
 * (at your option) any later version.
 
11
 *
 
12
 * This program is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 * GNU General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License
 
18
 * along with this program; if not, write to the Free Software
 
19
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
20
 */
 
21
 
 
22
#include <stdio.h>
 
23
#include <string.h>
 
24
#include <ctype.h>
 
25
#include <time.h>
 
26
#include <glib/gprintf.h>
 
27
#include <stdlib.h>
 
28
#include <unistd.h>
 
29
#include <sys/stat.h>
 
30
#include <glib.h>
 
31
#include <limits.h>
 
32
#include <libxml/xmlmemory.h>
 
33
#include <libxml/parser.h>
 
34
 
 
35
#include "gui.h"
 
36
#include "gui_utils.h"
 
37
#include "calendar.h"
 
38
#include "calendar_notes.h"
 
39
#include "calendar_widget.h"
 
40
#include "i18n.h"
 
41
#include "tasks.h"
 
42
#include "options_gui.h"
 
43
#include "options_gui_calendar.h"
 
44
#include "options_gui_tasks.h"
 
45
#include "options_gui_contacts.h"
 
46
#include "options_gui_notes.h"
 
47
#include "options_gui_general.h"
 
48
#include "options_prefs.h"
 
49
#include "contacts.h"
 
50
#include "stock_icons.h"
 
51
 
 
52
 
 
53
struct  osmo_prefs              config;
 
54
 
 
55
/*------------------------------------------------------------------------------*/
 
56
 
 
57
gint
 
58
options_get_first_active_page (GUI *appGUI) {
 
59
 
 
60
    if (!config.hide_calendar) 
 
61
        return OPT_PAGE_CALENDAR;
 
62
    if (!config.hide_tasks) 
 
63
        return OPT_PAGE_TASKS;
 
64
    if (!config.hide_contacts) 
 
65
        return OPT_PAGE_CONTACTS;
 
66
#ifdef HAVE_LIBGRINGOTTS
 
67
    if (!config.hide_notes) 
 
68
        return OPT_PAGE_NOTES;
 
69
#endif  /* HAVE_LIBGRINGOTTS */
 
70
 
 
71
    return OPT_PAGE_GENERAL;
 
72
}
 
73
 
 
74
/*------------------------------------------------------------------------------*/
 
75
 
 
76
void
 
77
options_switch_buttons(gboolean left, GUI *appGUI) {
 
78
 
 
79
gboolean flag;
 
80
gint n = 1;
 
81
 
 
82
    if (left == TRUE) n = -1;
 
83
 
 
84
    appGUI->opt->options_counter += n;
 
85
 
 
86
    flag = TRUE;
 
87
 
 
88
    while (flag) {
 
89
 
 
90
        flag = FALSE;
 
91
 
 
92
        switch (appGUI->opt->options_counter) {
 
93
            case OPT_PAGE_CALENDAR:
 
94
                if (config.hide_calendar) {
 
95
                    appGUI->opt->options_counter += n;
 
96
                    flag = TRUE;
 
97
                }
 
98
                break;
 
99
            case OPT_PAGE_TASKS:
 
100
                if (config.hide_tasks) {
 
101
                    appGUI->opt->options_counter += n;
 
102
                    flag = TRUE;
 
103
                }
 
104
                break;
 
105
            case OPT_PAGE_CONTACTS:
 
106
                if (config.hide_contacts) {
 
107
                    appGUI->opt->options_counter += n;
 
108
                    flag = TRUE;
 
109
                }
 
110
                break;
 
111
#ifdef HAVE_LIBGRINGOTTS
 
112
            case OPT_PAGE_NOTES:
 
113
                if (config.hide_notes) {
 
114
                    appGUI->opt->options_counter += n;
 
115
                    flag = TRUE;
 
116
                }
 
117
                break;
 
118
#endif  /* HAVE_LIBGRINGOTTS */
 
119
        }
 
120
    }
 
121
 
 
122
    if (left == TRUE) {
 
123
        appGUI->opt->options_counter = (appGUI->opt->options_counter < OPT_PAGE_CALENDAR) ? options_get_first_active_page(appGUI):appGUI->opt->options_counter;
 
124
    } else {
 
125
        appGUI->opt->options_counter = (appGUI->opt->options_counter > OPT_PAGE_GENERAL) ? OPT_PAGE_GENERAL:appGUI->opt->options_counter;
 
126
    }
 
127
 
 
128
    if (appGUI->opt->options_counter == OPT_PAGE_CALENDAR){
 
129
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->calendar_options_radiobutton), TRUE);
 
130
        g_signal_emit_by_name(G_OBJECT(appGUI->opt->calendar_options_radiobutton), "released");
 
131
    } else if (appGUI->opt->options_counter == OPT_PAGE_TASKS) {
 
132
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->tasks_options_radiobutton), TRUE);
 
133
        g_signal_emit_by_name(G_OBJECT(appGUI->opt->tasks_options_radiobutton), "released");
 
134
    } else if (appGUI->opt->options_counter == OPT_PAGE_CONTACTS) {
 
135
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->contacts_options_radiobutton), TRUE);
 
136
        g_signal_emit_by_name(G_OBJECT(appGUI->opt->contacts_options_radiobutton), "released");
 
137
#ifdef HAVE_LIBGRINGOTTS
 
138
    } else if (appGUI->opt->options_counter == OPT_PAGE_NOTES) {
 
139
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->notes_options_radiobutton), TRUE);
 
140
        g_signal_emit_by_name(G_OBJECT(appGUI->opt->notes_options_radiobutton), "released");
 
141
#endif  /* HAVE_LIBGRINGOTTS */
 
142
    } else {
 
143
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->general_options_radiobutton), TRUE);
 
144
        g_signal_emit_by_name(G_OBJECT(appGUI->opt->general_options_radiobutton), "released");
 
145
    }
 
146
}
 
147
 
 
148
/*------------------------------------------------------------------------------*/
 
149
 
 
150
void
 
151
options_button_released_cb (GtkButton *button, gpointer user_data) {
 
152
 
 
153
    GUI *appGUI = (GUI *)user_data;
 
154
 
 
155
    gtk_widget_hide (appGUI->opt->calendar_vbox);
 
156
    gtk_widget_hide (appGUI->opt->tasks_vbox);
 
157
    gtk_widget_hide (appGUI->opt->contacts_vbox);
 
158
#ifdef HAVE_LIBGRINGOTTS
 
159
    gtk_widget_hide (appGUI->opt->notes_vbox);
 
160
#endif  /* HAVE_LIBGRINGOTTS */
 
161
    gtk_widget_hide (appGUI->opt->general_vbox);
 
162
 
 
163
    if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(appGUI->opt->calendar_options_radiobutton)) == TRUE) {
 
164
 
 
165
        gtk_widget_show (appGUI->opt->calendar_vbox);
 
166
        appGUI->opt->options_counter = OPT_PAGE_CALENDAR;
 
167
 
 
168
    } else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(appGUI->opt->tasks_options_radiobutton)) == TRUE) {
 
169
 
 
170
        gtk_widget_show (appGUI->opt->tasks_vbox);
 
171
        appGUI->opt->options_counter = OPT_PAGE_TASKS;
 
172
 
 
173
    } else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(appGUI->opt->contacts_options_radiobutton)) == TRUE) {
 
174
 
 
175
        gtk_widget_show (appGUI->opt->contacts_vbox);
 
176
        appGUI->opt->options_counter = OPT_PAGE_CONTACTS;
 
177
 
 
178
#ifdef HAVE_LIBGRINGOTTS
 
179
    } else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(appGUI->opt->notes_options_radiobutton)) == TRUE) {
 
180
 
 
181
        gtk_widget_show (appGUI->opt->notes_vbox);
 
182
        appGUI->opt->options_counter = OPT_PAGE_NOTES;
 
183
#endif  /* HAVE_LIBGRINGOTTS */
 
184
 
 
185
    } else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(appGUI->opt->general_options_radiobutton)) == TRUE) {
 
186
 
 
187
        gtk_widget_show (appGUI->opt->general_vbox);
 
188
        appGUI->opt->options_counter = OPT_PAGE_GENERAL;
 
189
    }
 
190
}
 
191
 
 
192
/*------------------------------------------------------------------------------*/
 
193
 
 
194
void
 
195
gui_create_options(GUI *appGUI) {
 
196
 
 
197
GtkWidget           *vbox1, *vbox2;
 
198
GtkWidget           *hseparator;
 
199
GtkWidget           *hbuttonbox;
 
200
GtkWidget           *scrolledwindow;
 
201
GtkWidget           *viewport;
 
202
GSList              *radiobutton_group = NULL;
 
203
 
 
204
    vbox1 = gtk_vbox_new (FALSE, 0);
 
205
    gtk_widget_show (vbox1);
 
206
    gtk_container_set_border_width (GTK_CONTAINER (vbox1), 8);
 
207
    gui_add_to_notebook (vbox1, _("Options"), appGUI);
 
208
 
 
209
    appGUI->opt->vbox = GTK_BOX(vbox1);
 
210
 
 
211
    hseparator = gtk_hseparator_new ();
 
212
    gtk_widget_show (hseparator);
 
213
    gtk_box_pack_start (GTK_BOX (vbox1), hseparator, FALSE, TRUE, 4);
 
214
 
 
215
    /*--------------------------------------------------------------------------*/
 
216
 
 
217
    hbuttonbox = gtk_hbutton_box_new ();
 
218
    gtk_widget_show (hbuttonbox);
 
219
    gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox, FALSE, TRUE, 0);
 
220
    gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox), GTK_BUTTONBOX_END);
 
221
 
 
222
    appGUI->opt->calendar_options_radiobutton = gui_stock_label_radio_button(_("Calendar"), 
 
223
                                                             OSMO_STOCK_CALENDAR, GTK_ICON_SIZE_LARGE_TOOLBAR);
 
224
    gtk_widget_show (appGUI->opt->calendar_options_radiobutton);
 
225
    gtk_button_set_relief (GTK_BUTTON (appGUI->opt->calendar_options_radiobutton), GTK_RELIEF_NONE);  
 
226
    GTK_WIDGET_UNSET_FLAGS(appGUI->opt->calendar_options_radiobutton, GTK_CAN_FOCUS);
 
227
    gtk_radio_button_set_group (GTK_RADIO_BUTTON (appGUI->opt->calendar_options_radiobutton), radiobutton_group);
 
228
    radiobutton_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (appGUI->opt->calendar_options_radiobutton));
 
229
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (appGUI->opt->calendar_options_radiobutton), TRUE);
 
230
    gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (appGUI->opt->calendar_options_radiobutton), FALSE);
 
231
    gtk_container_add (GTK_CONTAINER (hbuttonbox), appGUI->opt->calendar_options_radiobutton);
 
232
 
 
233
    g_signal_connect (G_OBJECT (appGUI->opt->calendar_options_radiobutton), "released",
 
234
                      G_CALLBACK(options_button_released_cb), appGUI);
 
235
 
 
236
    appGUI->opt->tasks_options_radiobutton = gui_stock_label_radio_button(_("Tasks"), 
 
237
                                                             OSMO_STOCK_TASKS, GTK_ICON_SIZE_LARGE_TOOLBAR);
 
238
    gtk_widget_show (appGUI->opt->tasks_options_radiobutton);
 
239
    gtk_button_set_relief (GTK_BUTTON (appGUI->opt->tasks_options_radiobutton), GTK_RELIEF_NONE);  
 
240
    GTK_WIDGET_UNSET_FLAGS(appGUI->opt->tasks_options_radiobutton, GTK_CAN_FOCUS);
 
241
    gtk_radio_button_set_group (GTK_RADIO_BUTTON (appGUI->opt->tasks_options_radiobutton), radiobutton_group);
 
242
    radiobutton_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (appGUI->opt->tasks_options_radiobutton));
 
243
    gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (appGUI->opt->tasks_options_radiobutton), FALSE);
 
244
    gtk_container_add (GTK_CONTAINER (hbuttonbox), appGUI->opt->tasks_options_radiobutton);
 
245
 
 
246
    g_signal_connect (G_OBJECT (appGUI->opt->tasks_options_radiobutton), "released",
 
247
                      G_CALLBACK(options_button_released_cb), appGUI);
 
248
 
 
249
    appGUI->opt->contacts_options_radiobutton = gui_stock_label_radio_button(_("Contacts"), 
 
250
                                                             OSMO_STOCK_CONTACTS, GTK_ICON_SIZE_LARGE_TOOLBAR);
 
251
    gtk_widget_show (appGUI->opt->contacts_options_radiobutton);
 
252
    gtk_button_set_relief (GTK_BUTTON (appGUI->opt->contacts_options_radiobutton), GTK_RELIEF_NONE);  
 
253
    GTK_WIDGET_UNSET_FLAGS(appGUI->opt->contacts_options_radiobutton, GTK_CAN_FOCUS);
 
254
    gtk_radio_button_set_group (GTK_RADIO_BUTTON (appGUI->opt->contacts_options_radiobutton), radiobutton_group);
 
255
    radiobutton_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (appGUI->opt->contacts_options_radiobutton));
 
256
    gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (appGUI->opt->contacts_options_radiobutton), FALSE);
 
257
    gtk_container_add (GTK_CONTAINER (hbuttonbox), appGUI->opt->contacts_options_radiobutton);
 
258
 
 
259
    g_signal_connect (G_OBJECT (appGUI->opt->contacts_options_radiobutton), "released",
 
260
                      G_CALLBACK(options_button_released_cb), appGUI);
 
261
 
 
262
#ifdef HAVE_LIBGRINGOTTS
 
263
 
 
264
    appGUI->opt->notes_options_radiobutton = gui_stock_label_radio_button(_("Notes"), 
 
265
                                                             OSMO_STOCK_NOTES, GTK_ICON_SIZE_LARGE_TOOLBAR);
 
266
    gtk_widget_show (appGUI->opt->notes_options_radiobutton);
 
267
    gtk_button_set_relief (GTK_BUTTON (appGUI->opt->notes_options_radiobutton), GTK_RELIEF_NONE);  
 
268
    GTK_WIDGET_UNSET_FLAGS(appGUI->opt->notes_options_radiobutton, GTK_CAN_FOCUS);
 
269
    gtk_radio_button_set_group (GTK_RADIO_BUTTON (appGUI->opt->notes_options_radiobutton), radiobutton_group);
 
270
    radiobutton_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (appGUI->opt->notes_options_radiobutton));
 
271
    gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (appGUI->opt->notes_options_radiobutton), FALSE);
 
272
    gtk_container_add (GTK_CONTAINER (hbuttonbox), appGUI->opt->notes_options_radiobutton);
 
273
 
 
274
    g_signal_connect (G_OBJECT (appGUI->opt->notes_options_radiobutton), "released",
 
275
                      G_CALLBACK(options_button_released_cb), appGUI);
 
276
 
 
277
#endif  /* HAVE_LIBGRINGOTTS */
 
278
 
 
279
    appGUI->opt->general_options_radiobutton = gui_stock_label_radio_button(_("General"), 
 
280
                                                             OSMO_STOCK_PREFERENCES, GTK_ICON_SIZE_LARGE_TOOLBAR);
 
281
    gtk_widget_show (appGUI->opt->general_options_radiobutton);
 
282
    gtk_button_set_relief (GTK_BUTTON (appGUI->opt->general_options_radiobutton), GTK_RELIEF_NONE);  
 
283
    GTK_WIDGET_UNSET_FLAGS(appGUI->opt->general_options_radiobutton, GTK_CAN_FOCUS);
 
284
    gtk_radio_button_set_group (GTK_RADIO_BUTTON (appGUI->opt->general_options_radiobutton), radiobutton_group);
 
285
    radiobutton_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (appGUI->opt->general_options_radiobutton));
 
286
    gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (appGUI->opt->general_options_radiobutton), FALSE);
 
287
    gtk_container_add (GTK_CONTAINER (hbuttonbox), appGUI->opt->general_options_radiobutton);
 
288
 
 
289
    g_signal_connect (G_OBJECT (appGUI->opt->general_options_radiobutton), "released",
 
290
                      G_CALLBACK(options_button_released_cb), appGUI);
 
291
 
 
292
    /*--------------------------------------------------------------------------*/
 
293
 
 
294
    hseparator = gtk_hseparator_new ();
 
295
    gtk_widget_show (hseparator);
 
296
    gtk_box_pack_start (GTK_BOX (vbox1), hseparator, FALSE, TRUE, 4);
 
297
 
 
298
    scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
 
299
    gtk_widget_show (scrolledwindow);
 
300
    gtk_box_pack_start (GTK_BOX (vbox1), scrolledwindow, TRUE, TRUE, 0);
 
301
    gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow), GTK_SHADOW_NONE);
 
302
    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
 
303
 
 
304
    viewport = gtk_viewport_new (NULL, NULL);
 
305
    gtk_widget_show (viewport);
 
306
    gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport), GTK_SHADOW_IN);
 
307
    gtk_container_add (GTK_CONTAINER (scrolledwindow), viewport);
 
308
 
 
309
    vbox2 = gtk_vbox_new (FALSE, 0);
 
310
    gtk_widget_show (vbox2);
 
311
    gtk_container_add (GTK_CONTAINER (viewport), vbox2);
 
312
 
 
313
    gui_create_calendar_options_page (vbox2, appGUI);
 
314
    gui_create_tasks_options_page (vbox2, appGUI);
 
315
    gui_create_contacts_options_page (vbox2, appGUI);
 
316
#ifdef HAVE_LIBGRINGOTTS
 
317
    gui_create_notes_options_page (vbox2, appGUI);
 
318
#endif  /* HAVE_LIBGRINGOTTS */
 
319
    gui_create_general_options_page (vbox2, appGUI);
 
320
 
 
321
    appGUI->opt->callback_active = FALSE;
 
322
 
 
323
    if(config.display_options & GUI_CALENDAR_SHOW_DAY_NAMES)
 
324
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->show_day_names_checkbutton), TRUE);
 
325
    if(config.display_options & GUI_CALENDAR_NO_MONTH_CHANGE)
 
326
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->no_month_change_checkbutton), TRUE);
 
327
    if(config.display_options & GUI_CALENDAR_SHOW_WEEK_NUMBERS)
 
328
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->show_week_numbers_checkbutton), TRUE);
 
329
    if(config.display_options & GUI_CALENDAR_WEEK_START_MONDAY)
 
330
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->week_start_monday_checkbutton), TRUE);
 
331
 
 
332
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->simple_view_in_fy_calendar_checkbutton), config.fy_simple_view);
 
333
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->enable_block_cursor_checkbutton), !config.cursor_type);
 
334
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->enable_auxilary_calendars_checkbutton), config.enable_auxilary_calendars);
 
335
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->strikethrough_past_notes_checkbutton), config.strikethrough_past_notes);
 
336
 
 
337
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->di_show_current_time_checkbutton), 
 
338
                                  config.di_show_current_time);
 
339
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->di_show_day_number_checkbutton), 
 
340
                                  config.di_show_day_number);
 
341
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->di_show_marked_days_checkbutton), 
 
342
                                  config.di_show_marked_days);
 
343
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->di_show_week_number_checkbutton), 
 
344
                                  config.di_show_week_number);
 
345
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->di_show_weekend_days_checkbutton), 
 
346
                                  config.di_show_weekend_days);
 
347
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->di_show_moon_phase_checkbutton), 
 
348
                                  config.di_show_moon_phase);
 
349
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->di_show_notes_checkbutton), 
 
350
                                  config.di_show_notes);
 
351
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->di_show_zodiac_sign_checkbutton), 
 
352
                                  config.di_show_zodiac_sign);
 
353
 
 
354
    if (config.enable_auxilary_calendars == TRUE) {
 
355
        gtk_widget_show (appGUI->cal->aux_cal_expander);
 
356
    } else {
 
357
        gtk_widget_hide (appGUI->cal->aux_cal_expander);
 
358
    }
 
359
 
 
360
    calendar_cursor_settings_enable_disable(appGUI);
 
361
 
 
362
    gtk_range_set_value (GTK_RANGE (appGUI->opt->cft_hscale), config.frame_cursor_thickness);
 
363
 
 
364
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->default_stock_icons_checkbutton), 
 
365
                                  config.default_stock_icons);
 
366
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->disable_underline_in_links_checkbutton), 
 
367
                                  config.disable_underline_links);
 
368
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->enable_tooltips_checkbutton), 
 
369
                                  config.enable_tooltips);
 
370
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->enable_systray_checkbutton), 
 
371
                                  config.enable_systray);
 
372
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->start_minimised_checkbutton), 
 
373
                                  config.start_minimised_in_systray);
 
374
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->remember_latest_tab_checkbutton), 
 
375
                                  config.remember_latest_tab);
 
376
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->tasks_enable_rules_hint_checkbutton), 
 
377
                                  config.tasks_rules_hint);
 
378
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->ct_bold_items_checkbutton), 
 
379
                                  config.tasks_high_in_bold);
 
380
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->ct_hide_items_checkbutton), 
 
381
                                  config.hide_completed);
 
382
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->ct_delete_items_checkbutton), 
 
383
                                  config.delete_completed);
 
384
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->vc_due_date_checkbutton), 
 
385
                                  config.visible_due_date_column);
 
386
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->vc_priority_checkbutton), 
 
387
                                  config.visible_priority_column);
 
388
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->vc_category_checkbutton), 
 
389
                                  config.visible_category_column);
 
390
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->contacts_enable_rules_hint_checkbutton), 
 
391
                                  config.contacts_rules_hint);
 
392
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->contacts_select_first_entry_checkbutton), 
 
393
                                  config.show_after_search);
 
394
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->contacts_hide_group_column_checkbutton), 
 
395
                                  config.hide_group_column);
 
396
 
 
397
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->hide_calendar_checkbutton), 
 
398
                                  config.hide_calendar);
 
399
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->hide_tasks_checkbutton), 
 
400
                                  config.hide_tasks);
 
401
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->hide_contacts_checkbutton), 
 
402
                                  config.hide_contacts);
 
403
 
 
404
#ifdef HAVE_LIBGRINGOTTS
 
405
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->hide_notes_checkbutton), 
 
406
                                  config.hide_notes);
 
407
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->notes_enable_rules_hint_checkbutton), 
 
408
                                  config.notes_rules_hint);
 
409
#endif  /* HAVE_LIBGRINGOTTS */
 
410
 
 
411
    gtk_tree_view_column_set_visible (appGUI->cnt->contacts_columns[COLUMN_GROUP], !config.hide_group_column);
 
412
 
 
413
    gtk_entry_set_text (GTK_ENTRY(appGUI->opt->day_name_font_entry), config.day_name_font);
 
414
    gtk_entry_set_text (GTK_ENTRY(appGUI->opt->calendar_font_entry), config.calendar_font);
 
415
    gtk_entry_set_text (GTK_ENTRY(appGUI->opt->notes_font_entry), config.notes_font);
 
416
 
 
417
    gtk_entry_set_text (GTK_ENTRY(appGUI->opt->ti_font_entry), config.task_info_font);
 
418
 
 
419
#ifdef HAVE_LIBGRINGOTTS
 
420
    gtk_entry_set_text (GTK_ENTRY(appGUI->opt->editor_font_entry), config.notes_editor_font);
 
421
#endif  /* HAVE_LIBGRINGOTTS */
 
422
 
 
423
    gtk_entry_set_text (GTK_ENTRY(appGUI->opt->entry_web_browser), config.web_browser);
 
424
    gtk_entry_set_text (GTK_ENTRY(appGUI->opt->entry_email_client), config.email_client);
 
425
 
 
426
    gtk_spin_button_set_value (GTK_SPIN_BUTTON(appGUI->opt->name_font_size_spinbutton), config.name_font_size);
 
427
    gtk_spin_button_set_value (GTK_SPIN_BUTTON(appGUI->opt->tags_font_size_spinbutton), config.tags_font_size);
 
428
 
 
429
    appGUI->opt->callback_active = TRUE;
 
430
 
 
431
    if (config.hide_calendar) {
 
432
        gtk_widget_hide (appGUI->opt->calendar_vbox);
 
433
        gtk_widget_hide (appGUI->opt->calendar_options_radiobutton);
 
434
    }
 
435
    if (config.hide_tasks) {
 
436
        gtk_widget_hide (appGUI->opt->tasks_vbox);
 
437
        gtk_widget_hide (appGUI->opt->tasks_options_radiobutton);
 
438
    }
 
439
    if (config.hide_contacts) {
 
440
        gtk_widget_hide (appGUI->opt->contacts_vbox);
 
441
        gtk_widget_hide (appGUI->opt->contacts_options_radiobutton);
 
442
    }
 
443
#ifdef HAVE_LIBGRINGOTTS
 
444
    if (config.hide_notes) {
 
445
        gtk_widget_hide (appGUI->opt->notes_vbox);
 
446
        gtk_widget_hide (appGUI->opt->notes_options_radiobutton);
 
447
    }
 
448
#endif  /* HAVE_LIBGRINGOTTS */
 
449
 
 
450
    switch(options_get_first_active_page (appGUI)) {
 
451
        case OPT_PAGE_CALENDAR:
 
452
            gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->calendar_options_radiobutton), TRUE);
 
453
            break;
 
454
        case OPT_PAGE_TASKS:
 
455
            gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->tasks_options_radiobutton), TRUE);
 
456
            break;
 
457
        case OPT_PAGE_CONTACTS:
 
458
            gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->contacts_options_radiobutton), TRUE);
 
459
            break;
 
460
#ifdef HAVE_LIBGRINGOTTS
 
461
        case OPT_PAGE_NOTES:
 
462
            gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(appGUI->opt->notes_options_radiobutton), TRUE);
 
463
            break;
 
464
#endif  /* HAVE_LIBGRINGOTTS */
 
465
    }
 
466
 
 
467
    gtk_widget_show (appGUI->opt->calendar_vbox);
 
468
 
 
469
    options_button_released_cb (NULL, appGUI);
 
470
}
 
471
 
 
472
/*------------------------------------------------------------------------------*/
 
473