~ubuntu-branches/ubuntu/raring/xiphos/raring

« back to all changes in this revision

Viewing changes to src/main/settings.c

  • Committer: Bazaar Package Importer
  • Author(s): Dmitrijs Ledkovs, Jonathan Marsden, Dmitrijs Ledkovs
  • Date: 2010-11-25 21:26:48 UTC
  • mfrom: (2.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20101125212648-mc64wvs0nw3xp7bx
Tags: 3.1.4-1
[ Jonathan Marsden ]
* New upstream release 3.1.4
* Removed debian/patch/* since the one patch was included upstream.
* Bumped Standards-Version to 3.9.1 (no changes required).
* debian/README.Debian: Corrected spelling and reworded for clarity.
* debian/control: Add Jonathan Marsden back into Uploaders.

[ Dmitrijs Ledkovs ]
* Added local options dpkg-source to unapply patches and fail on
  upstream source changes (ignoring false positives).
* Added bzr-builddeb hook to generate source-format before build. If you
  are not using bzr-builddeb, you must run "./debian/rules clean" before
  building.
* patches/xul-2.0.patch: bump UPPER_RANGE to allow running against xul20.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * Xiphos Bible Study Tool
3
3
 * settings.c - Guess what?
4
4
 *
5
 
 * Copyright (C) 2000-2009 Xiphos Developer Team
 
5
 * Copyright (C) 2000-2010 Xiphos Developer Team
6
6
 *
7
7
 * This program is free software; you can redistribute it and/or modify
8
8
 * it under the terms of the GNU General Public License as published by
37
37
 
38
38
#include "gui/bookmarks.h"
39
39
#include "gui/dialog.h"
 
40
#include "gui/gui.h"
40
41
#include "gui/mod_mgr.h"
41
42
#include "gui/utilities.h"
42
43
#include "gui/preferences_dialog.h"
55
56
/******************************************************************************
56
57
 * defines
57
58
 */
58
 
#define GS_DIR ".xiphos"
59
 
 
60
 
#define GS_NET_PERMISSION       _("Welcome to Xiphos.\n\nThere are no Bible modules installed. In order to initialize, Xiphos needs you to install at least one Bible.\n\nWith your permission, Xiphos will invoke the Module Manager so that you may install from Crosswire:\n1. Configure remote install.\n2. Connect.\n3. Select a Bible text of your language preference.\n4. Click `install'.\nClose the Module Manager when you are done.\n\nWarning: If you live in a persecuted country, use with care.\n\nMay Xiphos invoke the Module Manager so that you may install a Bible?")
 
59
#define XI_DIR ".xiphos"
61
60
 
62
61
/******************************************************************************
63
62
 * globals
110
109
        }
111
110
 
112
111
        /* set gSwordDir to $home + .xiphos */
113
 
        settings.gSwordDir = g_new(char, strlen(settings.homedir) +
114
 
                                   strlen(GS_DIR) + 2);
115
 
        sprintf(settings.gSwordDir, "%s/%s", settings.homedir, GS_DIR);
 
112
        settings.gSwordDir = g_strdup_printf("%s/%s", settings.homedir, XI_DIR);
116
113
 
117
114
        /* if gSwordDir does not exist, create it. */
118
 
        if (access(settings.gSwordDir, F_OK) == -1) {
 
115
        if (g_access(settings.gSwordDir, F_OK) == -1) {
119
116
                if ((Mkdir(settings.gSwordDir, S_IRWXU)) != 0) {
120
117
                        char msg[300];
121
118
                        gui_init(argc, argv);
129
126
 
130
127
        /* if .sword does not exist create it */
131
128
        sword_dir = g_strdup_printf("%s/%s", settings.homedir, DOTSWORD);
132
 
        if (access(sword_dir, F_OK) == -1) {
 
129
        if (g_access(sword_dir, F_OK) == -1) {
133
130
                if ((Mkdir(sword_dir, S_IRWXU)) != 0) {
134
131
                        gui_init(argc, argv);
135
132
                        gui_generic_warning(_("can not create " DOTSWORD));
138
135
        g_free(sword_dir);
139
136
        /* if .sword/mods.d does not exist create it */
140
137
        sword_dir = g_strdup_printf("%s/%s", settings.homedir, DOTSWORD "/mods.d");
141
 
        if (access(sword_dir, F_OK) == -1) {
 
138
        if (g_access(sword_dir, F_OK) == -1) {
142
139
                if ((Mkdir(sword_dir, S_IRWXU)) != 0) {
143
140
                        gui_init(argc, argv);
144
141
                        gui_generic_warning(_("can not create " DOTSWORD "/mods.d"));
147
144
        g_free(sword_dir);
148
145
        /* if .sword/modules does not exist create it */
149
146
        sword_dir = g_strdup_printf("%s/%s", settings.homedir, DOTSWORD "/modules");
150
 
        if (access(sword_dir, F_OK) == -1) {
 
147
        if (g_access(sword_dir, F_OK) == -1) {
151
148
                if ((Mkdir(sword_dir, S_IRWXU)) != 0) {
152
149
                        gui_init(argc, argv);
153
150
                        gui_generic_warning(_("can not create " DOTSWORD "/modules"));
188
185
 
189
186
        /* if settings.xml does not exist create it */
190
187
        if (buf_says_empty ||
191
 
            (access(settings.fnconfigure, F_OK) == -1) ||
 
188
            (g_access(settings.fnconfigure, F_OK) == -1) ||
192
189
            new_configs) {
193
190
                /* must be first run */
194
191
                GS_print((buf_says_empty
205
202
        /* ensure that the user has a bible with which to work */
206
203
        if (settings.havebible == 0) {
207
204
                gui_init(argc, argv);
208
 
                if (gui_yes_no_dialog(GS_NET_PERMISSION, NULL)) {
209
 
                        main_shutdown_list();
210
 
                        gui_open_mod_mgr_initial_run();
211
 
                        main_init_lists();
212
 
                        if (settings.havebible == 0) {
213
 
                                gui_generic_warning
214
 
                                    (_("There are still no Bibles installed.\nEvidently, you declined to install any.\n\nWithout any Bible modules to display,\nXiphos cannot proceed,\nand will now exit."));
215
 
                                exit(1);
216
 
                        } else
217
 
                                gui_generic_warning
218
 
                                    (_("Bible module installation complete."));
219
 
                } else {
 
205
                main_shutdown_list();
 
206
                gui_open_mod_mgr_initial_run();
 
207
                main_init_lists();
 
208
                if (settings.havebible == 0) {
220
209
                        gui_generic_warning
221
 
                            (_("Without any Bible modules to display,\nXiphos cannot proceed,\nand will now exit."));
 
210
                            (_("There are no Bibles installed.\nEvidently, you declined to install any.\n\nWithout any Bible modules to display,\nXiphos cannot proceed,\nand will now exit."));
222
211
                        exit(1);
223
212
                }
224
 
        }
225
 
 
226
 
        /* check for template.pad file for studypad */
227
 
        tmp = g_new(char, strlen(settings.gSwordDir) +
228
 
                                     strlen("template.pad") + 2);
229
 
        sprintf(tmp, "%s/%s", settings.gSwordDir,
230
 
                "template.pad");
231
 
 
232
 
        /* if template.pad does not exist create it */
233
 
        if ((access(tmp, F_OK) == -1)) {
234
 
                g_file_set_contents(tmp, " ", strlen(" "), NULL);
235
 
        }
236
 
 
237
 
        /* check for template.pad file for studypad */
238
 
        /* set fnconfigure to gSwordDir and settings.xml */
239
 
        tmp = g_new(char, strlen(settings.gSwordDir) +
240
 
                                     strlen("template.pad") + 2);
241
 
        sprintf(tmp, "%s/%s", settings.gSwordDir,
242
 
                "template.pad");
243
 
 
244
 
        /* if template.pad does not exist create it */
245
 
        if ((access(tmp, F_OK) == -1)) {
246
 
                g_file_set_contents(tmp, " ", strlen(" "), NULL);
247
 
        }
 
213
                gui_generic_warning(_("Bible module installation complete."));
 
214
        }
 
215
 
 
216
        /* check for template.pad file for studypad */
 
217
        tmp = g_strdup_printf("%s/%s", settings.gSwordDir, "template.pad");
 
218
        if ((g_access(tmp, F_OK) == -1)) {
 
219
                g_file_set_contents(tmp, " ", 1, NULL);
 
220
        }
 
221
        g_free(tmp);
248
222
 
249
223
        load_settings_structure();
250
224
 
251
 
        /*
252
 
         * if the user had forced a locale, we must set it now.
253
 
         */
 
225
        /* if the user had forced a locale, we must set it now. */
254
226
        if (settings.special_locale && strcmp(settings.special_locale, NONE)) {
255
227
                g_setenv("LANG", settings.special_locale, TRUE);
256
228
                gchar *test = setlocale(LC_ALL, settings.special_locale);
303
275
        settings.load_xml_bookmarks = FALSE;
304
276
 
305
277
        /* set bookmarks dir to settings.gSwordDir + /bookmarks */
306
 
        settings.swbmDir = g_new(char, strlen(settings.gSwordDir) +
307
 
                                 strlen("/bookmarks") + 2);
308
 
        sprintf(settings.swbmDir, "%s/%s", settings.gSwordDir, "bookmarks");
 
278
        settings.swbmDir = g_strdup_printf("%s/%s", settings.gSwordDir, "bookmarks");
309
279
 
310
280
        /* if .xiphos-2.0/bookmarks does not exist create it */
311
 
        if (access(settings.swbmDir, F_OK) == -1) {
 
281
        if (g_access(settings.swbmDir, F_OK) == -1) {
312
282
                if ((Mkdir(settings.swbmDir, S_IRWXU)) == -1) {
313
283
                        g_warning("can't create bookmarks dir");
314
284
                        return 0;
316
286
        }
317
287
 
318
288
        /* set removed dir to settings.swbmDir + /removed */
319
 
        removed = g_new(char, strlen(settings.swbmDir) +
320
 
                                 strlen("/removed") + 2);
321
 
        sprintf(removed, "%s/%s", settings.swbmDir, "removed");
322
 
        if (access(removed, F_OK) == -1) {
 
289
        removed = g_strdup_printf("%s/%s", settings.swbmDir, "removed");
 
290
        if (g_access(removed, F_OK) == -1) {
323
291
                if ((Mkdir(removed, S_IRWXU)) == -1) {
324
292
                        g_warning("can't create removed dir");
325
293
                        //return 0;
330
298
                xml_new_bookmark_file();
331
299
 
332
300
        /* check for xml bookmarks */
333
 
        file_buf = g_new(char, strlen(settings.swbmDir) +
334
 
                         strlen("/bookmarks.xml") + 2);
335
 
        sprintf(file_buf, "%s/bookmarks.xml", settings.swbmDir);
 
301
        file_buf = g_strdup_printf("%s/bookmarks.xml", settings.swbmDir);
336
302
 
337
 
        if (access(file_buf, F_OK) == 0) {
 
303
        if (g_access(file_buf, F_OK) == 0) {
338
304
                settings.load_xml_bookmarks = TRUE;
339
305
        }
340
306
        g_free(file_buf);
346
312
 
347
313
        /* check for Bibletime bookmarks */
348
314
        settings.have_bibletime = FALSE;
349
 
        file_buf = g_new(char, strlen(settings.homedir) +
350
 
                         strlen
351
 
                         ("/.kde/share/apps/bibletime/bookmarks.xml") +
352
 
                         2);
353
 
        sprintf(file_buf, "%s/.kde/share/apps/bibletime/bookmarks.xml",
354
 
                settings.homedir);
355
 
        if (access(file_buf, F_OK) == 0) {
 
315
        file_buf = g_strdup_printf("%s/%s", settings.homedir,
 
316
                                   ".bibletime/bookmarks.xml");
 
317
        if (g_access(file_buf, F_OK) == 0) {
356
318
                settings.have_bibletime = TRUE;
357
319
        }
358
320
 
384
346
 
385
347
void load_settings_structure(void)
386
348
{
387
 
        char *buf = NULL;
 
349
        char *buf = NULL, *parallels;
388
350
 
389
351
        settings.gs_version = VERSION;
390
352
        if ((settings.MainWindowModule = xml_get_value("modules", "bible")) == NULL) {
393
355
        }
394
356
        settings.CommWindowModule = xml_get_value("modules", "comm");
395
357
        settings.DictWindowModule = xml_get_value("modules", "dict");
396
 
        settings.parallel1Module = xml_get_value("modules", "int1");
397
 
        settings.parallel2Module = xml_get_value("modules", "int2");
398
 
        settings.parallel3Module = xml_get_value("modules", "int3");
399
 
        settings.parallel4Module = xml_get_value("modules", "int4");
400
 
        settings.parallel5Module = xml_get_value("modules", "int5");
 
358
 
 
359
        parallels = xml_get_value("modules", "parallels");
 
360
        /* if no parallels are known, convert old fixed parallel set */
 
361
        if (!parallels || (*parallels == '\0')) {
 
362
                char intN[] = "intN", *oldparallel, i, *newhold;
 
363
 
 
364
                g_free(parallels);      /* in case it was real but empty */
 
365
                parallels = g_strdup("");
 
366
                for (i = '1'; i <= '5'; ++i) {  /* the old set */
 
367
                        intN[3] = i;
 
368
                        oldparallel = xml_get_value("modules", intN);
 
369
                        if (oldparallel && *oldparallel) {
 
370
                                newhold = g_strconcat(parallels, oldparallel,
 
371
                                                      ",", NULL);
 
372
                                g_free(parallels);
 
373
                                parallels = newhold;
 
374
                                g_free(oldparallel);
 
375
                                xml_remove_node("modules", intN, NULL); /* ? */
 
376
                        }
 
377
                }
 
378
 
 
379
                /* trim off the last comma */
 
380
                if (*parallels) {
 
381
                        *(parallels + strlen(parallels) - 1) = '\0';
 
382
                        xml_set_new_element("modules", "parallels", parallels);
 
383
                }
 
384
        }
 
385
        if (parallels && *parallels)
 
386
                settings.parallel_list = g_strsplit(parallels, ",", -1);
 
387
        else
 
388
                settings.parallel_list = NULL;
 
389
        g_free(parallels);
 
390
 
401
391
        settings.personalcommentsmod = xml_get_value("modules", "percomm");
402
392
        settings.devotionalmod = xml_get_value("modules", "devotional");
403
393
        settings.book_mod = xml_get_value("modules", "book");
460
450
                xml_add_new_item_to_section("modmgr", "mod_mgr_remote_source_index", "0");
461
451
                settings.mod_mgr_remote_source_index = 0;
462
452
        }
463
 
        if ((buf = xml_get_value("modmgr", "mod_mgr_intro")))
464
 
                settings.mod_mgr_intro = atoi(buf);
465
 
        else {
466
 
                xml_add_new_item_to_section("modmgr", "mod_mgr_intro", "0");
467
 
                settings.mod_mgr_intro = 0;
468
 
        }
469
 
 
470
 
        /* end mod mgr stuff */
471
 
 
472
 
 
 
453
 
 
454
        /* current verse & keys */
473
455
        settings.currentverse = xml_get_value("keys", "verse");
474
456
        settings.dictkey = xml_get_value("keys", "dictionary");
475
457
 
493
475
                settings.tab_page = 0;
494
476
        }
495
477
 
 
478
        /* layout */
496
479
        settings.sidebar_width = atoi((buf = xml_get_value("layout", "shortcutbar"))
497
480
                                      ? buf : "100");
498
481
        if ((buf = xml_get_value("layout", "vltoppaneheight")))
501
484
                xml_add_new_item_to_section("layout", "vltoppaneheight", "210");
502
485
                settings.verselist_toppane_height = 210;
503
486
        }
504
 
        if ((buf = xml_get_value("layout", "sidebar_notebook_hight")))
505
 
                settings.sidebar_notebook_hight = atoi(buf);
506
 
        else {
507
 
                xml_add_new_item_to_section("layout", "sidebar_notebook_hight", "300");
508
 
                settings.sidebar_notebook_hight = 250;
509
 
        }
510
 
        settings.gs_hight = atoi((buf = xml_get_value("layout", "hight")) ? buf : "500");
511
 
        settings.gs_width = atoi((buf = xml_get_value("layout", "width")) ? buf : "500");
512
 
 
 
487
        if ((buf = xml_get_value("layout", "sidebar_notebook_height")))
 
488
                settings.sidebar_notebook_height = atoi(buf);
 
489
        else {
 
490
                if ((buf = xml_get_value("layout", "sidebar_notebook_hight"))) { /* backward compatible */
 
491
                        settings.sidebar_notebook_height = atoi(buf);
 
492
                        xml_remove_node("layout", "sidebar_notebook_hight", 0);
 
493
                } else
 
494
                        settings.sidebar_notebook_height = 250;
 
495
                buf = g_strdup_printf("%d", settings.sidebar_notebook_height);
 
496
                xml_add_new_item_to_section("layout", "sidebar_notebook_height", buf);
 
497
                g_free(buf);
 
498
        }
 
499
 
 
500
        /* whether to open the parallel page at startup */
 
501
        if ((buf = xml_get_value("layout", "parallelopen")))
 
502
                settings.parallelpage = atoi(buf);
 
503
        else {
 
504
                xml_add_new_item_to_section("layout", "parallelopen", "0");
 
505
                settings.parallelpage = 0;
 
506
        }
 
507
 
 
508
        /* main and parallel window geometry */
 
509
        if ((buf = xml_get_value("layout", "height")))
 
510
                settings.gs_height = atoi(buf);
 
511
        else {
 
512
                if ((buf = xml_get_value("layout", "hight"))) { /* backward compatible */
 
513
                        settings.gs_height = atoi(buf);
 
514
                        xml_remove_node("layout", "hight", 0);
 
515
                } else
 
516
                        settings.gs_height = 500;
 
517
                buf = g_strdup_printf("%d", settings.gs_height);
 
518
                xml_add_new_item_to_section("layout", "height", buf);
 
519
                g_free(buf);
 
520
        }
 
521
        if ((buf = xml_get_value("layout", "width")))
 
522
                settings.gs_width = atoi(buf);
 
523
        else{
 
524
                xml_add_new_item_to_section("layout", "width", "500");
 
525
                settings.gs_width = 500;
 
526
        }
 
527
        if ((buf = xml_get_value("layout", "parallel_height")))
 
528
                settings.parallel_height = atoi(buf);
 
529
        else {
 
530
                xml_add_new_item_to_section("layout", "parallel_height", "361");
 
531
                settings.parallel_height = 361;
 
532
        }
 
533
        if ((buf = xml_get_value("layout", "parallel_width")))
 
534
                settings.parallel_width = atoi(buf);
 
535
        else{
 
536
                xml_add_new_item_to_section("layout", "parallel_width", "500");
 
537
                settings.parallel_width = 657;
 
538
        }
 
539
 
 
540
        /* main window placement */
513
541
        if ((buf = xml_get_value("layout", "app_x")))
514
542
                settings.app_x = atoi(buf);
515
543
        else {
523
551
                settings.app_y = 40;
524
552
        }
525
553
 
 
554
        /* parallel window placement */
 
555
        if ((buf = xml_get_value("layout", "parallel_x")))
 
556
                settings.parallel_x = atoi(buf);
 
557
        else {
 
558
                xml_add_new_item_to_section("layout", "parallel_x", "200");
 
559
                settings.parallel_x = 40;
 
560
        }
 
561
        if ((buf = xml_get_value("layout", "parallel_y")))
 
562
                settings.parallel_y = atoi(buf);
 
563
        else{
 
564
                xml_add_new_item_to_section("layout", "parallel_y", "200");
 
565
                settings.parallel_y = 40;
 
566
        }
 
567
 
526
568
        settings.biblepane_width = atoi((buf = xml_get_value("layout", "textpane"))
527
569
                                        ? buf : "0");
528
 
        settings.upperpane_hight = atoi((buf = xml_get_value("layout", "uperpane"))
529
 
                                        ? buf : "0");
530
 
 
531
 
        if ((buf = xml_get_value("layout", "biblehight")))
532
 
                settings.biblepane_hight = atoi(buf);
533
 
        else {
534
 
                xml_add_new_item_to_section("layout", "biblehight", "340");
535
 
                settings.biblepane_hight = 250;
536
 
        }
537
 
 
538
 
        if ((buf = xml_get_value("layout", "commentaryhight")))
539
 
                settings.commpane_hight = atoi(buf);
540
 
        else {
541
 
                xml_add_new_item_to_section("layout", "commentaryhight", "240");
542
 
                settings.commpane_hight = 240;
543
 
        }
544
 
 
 
570
 
 
571
        if ((buf = xml_get_value("layout", "bibleheight")))
 
572
                settings.biblepane_height = atoi(buf);
 
573
        else {
 
574
                if ((buf = xml_get_value("layout", "biblehight"))) {    /* backward compatible */
 
575
                        settings.biblepane_height = atoi(buf);
 
576
                        xml_remove_node("layout", "biblehight", 0);
 
577
                } else
 
578
                        settings.biblepane_height = 250;
 
579
                buf = g_strdup_printf("%d", settings.biblepane_height);
 
580
                xml_add_new_item_to_section("layout", "bibleheight", buf);
 
581
                g_free(buf);
 
582
        }
 
583
 
 
584
        if ((buf = xml_get_value("layout", "commentaryheight")))
 
585
                settings.commpane_height = atoi(buf);
 
586
        else {
 
587
                if ((buf = xml_get_value("layout", "commentaryhight"))) { /* backward compatible */
 
588
                        settings.commpane_height = atoi(buf);
 
589
                        xml_remove_node("layout", "commentaryhight", 0);
 
590
                } else
 
591
                        settings.commpane_height = 240;
 
592
                buf = g_strdup_printf("%d", settings.commpane_height);
 
593
                xml_add_new_item_to_section("layout", "commentaryheight", buf);
 
594
                g_free(buf);
 
595
        }
 
596
 
 
597
        /* font sizes */
545
598
        if ((buf = xml_get_value("fontsize", "versenum"))) {
546
599
                settings.verse_num_font_size_str = buf;
547
600
                settings.verse_num_font_size = atoi(buf);
565
618
#endif /* WIN32 */
566
619
        }
567
620
 
 
621
        /* colors */
568
622
        settings.bible_text_color = xml_get_value("HTMLcolors", "text_fg");
569
623
        settings.bible_bg_color =
570
624
            xml_get_value("HTMLcolors", "background");
589
643
        }
590
644
 
591
645
        /*  parallel ops  */
592
 
 
593
646
        if ((buf = xml_get_value("parallel", "Strong_s_Numbers")))
594
647
                settings.parallel_strongs = atoi(buf);
595
648
        else {
621
674
        if ((buf = xml_get_value("parallel", "Footnotes")))
622
675
                settings.parallel_footnotes = atoi(buf);
623
676
        else {
624
 
                xml_add_new_item_to_section("parallel", "Footnotes", "0");
625
 
                settings.parallel_footnotes = 0;
 
677
                xml_add_new_item_to_section("parallel", "Footnotes", "1");
 
678
                settings.parallel_footnotes = 1;
626
679
        }
627
680
 
628
681
        if ((buf = xml_get_value("parallel", "Cross-references")))
642
695
        if ((buf = xml_get_value("parallel", "Words_of_Christ_in_Red")))
643
696
                settings.parallel_red_words = atoi(buf);
644
697
        else {
645
 
                xml_add_new_item_to_section("parallel", "Words_of_Christ_in_Red", "0");
646
 
                settings.parallel_red_words = 0;
 
698
                xml_add_new_item_to_section("parallel", "Words_of_Christ_in_Red", "1");
 
699
                settings.parallel_red_words = 1;
647
700
        }
648
701
 
649
702
        if ((buf = xml_get_value("parallel", "Morpheme_Segmentation")))
656
709
        if ((buf = xml_get_value("parallel", "Headings")))
657
710
                settings.parallel_headings = atoi(buf);
658
711
        else {
659
 
                xml_add_new_item_to_section("parallel", "Headings", "0");
660
 
                settings.parallel_headings = 0;
 
712
                xml_add_new_item_to_section("parallel", "Headings", "1");
 
713
                settings.parallel_headings = 1;
661
714
        }
662
715
 
663
716
        if ((buf = xml_get_value("parallel", "Lemmas")))
695
748
                settings.parallel_greekaccents = 1;
696
749
        }
697
750
 
698
 
        if ((buf = xml_get_value("parallel", "parallel")))
699
 
                settings.parallelpage = atoi(buf);
700
 
 
701
 
 
702
751
        /*  Misc stuff  */
703
752
 
704
753
        settings.showtexts = atoi((buf = xml_get_value("misc", "showtexts")) ? buf : "1");
714
763
        if (xml_get_value("misc", "show_side_preview"))
715
764
                settings.show_previewer_in_sidebar = atol(xml_get_value("misc", "show_side_preview"));
716
765
        else {
717
 
                xml_add_new_item_to_section("misc", "show_side_preview", "0");
718
 
                settings.show_previewer_in_sidebar = 0;
 
766
                xml_add_new_item_to_section("misc", "show_side_preview", "1");
 
767
                settings.show_previewer_in_sidebar = 1;
719
768
        }
720
769
 
721
770
        if (xml_get_value("misc", "showparatab"))
760
809
                settings.versehighlight = 0;
761
810
        }
762
811
 
763
 
        if ((buf = xml_get_value("misc", "doublespace")))
764
 
                settings.doublespace = atoi(buf);
765
 
        else {
766
 
                xml_add_new_item_to_section("misc", "doublespace", "0");
767
 
                settings.doublespace = 0;
 
812
        if ((buf = xml_get_value("misc", "annotatehighlight")))
 
813
                settings.annotate_highlight = atoi(buf);
 
814
        else {
 
815
                xml_add_new_item_to_section("misc", "annotatehighlight", "1");
 
816
                settings.annotate_highlight = 1;
 
817
        }
 
818
 
 
819
        if ((buf = xml_get_value("misc", "xrefsinverselist")))
 
820
                settings.xrefs_in_verse_list = atoi(buf);
 
821
        else {
 
822
                xml_add_new_item_to_section("misc", "xrefsinverselist", "1");
 
823
                settings.xrefs_in_verse_list = 1;
768
824
        }
769
825
 
770
826
        if ((buf = xml_get_value("misc", "chapter-scroll"))) {
812
868
                settings.prayerlist = 1;
813
869
        }
814
870
 
815
 
 
 
871
#if 1
 
872
        settings.browsing = 1;  /* unconditional - no longer toggle-able. */
 
873
#else
816
874
        if ((buf = xml_get_value("tabs", "browsing"))) {
817
875
                settings.browsing =  atoi(buf);
818
876
        } else {
819
877
                xml_add_new_item_to_section("tabs","browsing","1");
820
878
                settings.browsing = 1;
821
879
        }
 
880
#endif
822
881
}