969
974
gpointer user_data)
971
976
xml_set_value("Xiphos", "misc", "imageresize",
972
(togglebutton->active ? "1" : "0"));
973
settings.imageresize = togglebutton->active;
977
(gtk_toggle_button_get_active (togglebutton) ? "1" : "0"));
978
settings.imageresize = gtk_toggle_button_get_active (togglebutton);
981
/******************************************************************************
983
* on_checkbutton_verse_num_bold_toggled
986
* #include "preferences_dialog.h"
988
* void on_checkbutton_verse_num_bold_toggled(GtkToggleButton * togglebutton, gpointer user_data)
999
on_checkbutton_verse_num_bold_toggled(GtkToggleButton * togglebutton,
1002
xml_set_value("Xiphos", "misc", "verse_num_bold",
1003
(gtk_toggle_button_get_active (togglebutton) ? "1" : "0"));
1004
settings.verse_num_bold = atoi(xml_get_value("misc", "verse_num_bold"));
1005
char *url = g_strdup_printf("sword:///%s", settings.currentverse);
1006
main_url_handler(url, TRUE);
1011
/******************************************************************************
1013
* on_checkbutton_verse_num_bracket_toggled
1016
* #include "preferences_dialog.h"
1018
* void on_checkbutton_verse_num_bracket_toggled(GtkToggleButton * togglebutton, gpointer user_data)
1029
on_checkbutton_verse_num_bracket_toggled(GtkToggleButton * togglebutton,
1032
xml_set_value("Xiphos", "misc", "verse_num_bracket",
1033
(gtk_toggle_button_get_active (togglebutton) ? "1" : "0"));
1034
settings.verse_num_bracket = atoi(xml_get_value("misc", "verse_num_bracket"));
1035
char *url = g_strdup_printf("sword:///%s", settings.currentverse);
1036
main_url_handler(url, TRUE);
1041
/******************************************************************************
1043
* on_checkbutton_verse_num_superscript_toggled
1046
* #include "preferences_dialog.h"
1048
* void on_checkbutton_verse_num_superscript_toggled(GtkToggleButton * togglebutton, gpointer user_data)
1059
on_checkbutton_verse_num_superscript_toggled(GtkToggleButton * togglebutton,
1062
xml_set_value("Xiphos", "misc", "verse_num_superscript",
1063
(gtk_toggle_button_get_active (togglebutton) ? "1" : "0"));
1064
settings.verse_num_superscript = atoi(xml_get_value("misc", "verse_num_superscript"));
1065
char *url = g_strdup_printf("sword:///%s", settings.currentverse);
1066
main_url_handler(url, TRUE);
976
1071
/******************************************************************************
2426
2538
void ps_button_add(GtkButton * button, gpointer user_data)
2540
#ifdef USE_GTKBUILDER
2429
2543
GladeXML *gxml;
2431
glade_file = gui_general_user_file("prefs.glade", FALSE);
2545
gchar *glade_file = gui_general_user_file("prefs" UI_SUFFIX, FALSE);
2432
2546
g_return_if_fail(glade_file != NULL);
2548
#ifdef USE_GTKBUILDER
2549
gxml = gtk_builder_new ();
2550
gtk_builder_add_from_file (gxml, glade_file, NULL);
2434
2552
gxml = glade_xml_new(glade_file, "mod_sel_dialog", NULL);
2435
parallel_select.mod_sel_dialog = glade_xml_get_widget(gxml, "mod_sel_dialog");
2436
parallel_select.mod_sel_close = glade_xml_get_widget(gxml, "mod_sel_button_close");
2437
parallel_select.mod_sel_add = glade_xml_get_widget(gxml, "mod_sel_button_add");
2554
parallel_select.mod_sel_dialog = UI_GET_ITEM(gxml, "mod_sel_dialog");
2555
parallel_select.mod_sel_close = UI_GET_ITEM(gxml, "mod_sel_button_close");
2556
parallel_select.mod_sel_add = UI_GET_ITEM(gxml, "mod_sel_button_add");
2439
2558
g_signal_connect((gpointer)parallel_select.mod_sel_close, "clicked",
2440
2559
G_CALLBACK(on_mod_sel_close_clicked), NULL);
2441
2560
g_signal_connect((gpointer)parallel_select.mod_sel_add, "clicked",
2442
2561
G_CALLBACK(on_mod_sel_add_clicked), NULL);
2444
parallel_select.mod_sel_treeview = glade_xml_get_widget(gxml, "mod_sel_treeview");
2563
parallel_select.mod_sel_treeview = UI_GET_ITEM(gxml, "mod_sel_treeview");
2445
2564
ps_setup_treeview(parallel_select.mod_sel_treeview);
2447
2566
gtk_widget_show(parallel_select.mod_sel_dialog);
2473
2592
create_preferences_dialog(void)
2594
#ifdef USE_GTKBUILDER
2475
2597
GladeXML *gxml;
2477
2599
GtkWidget *dialog_prefs;
2478
2600
GtkWidget *treeview;
2479
2601
GtkTreeModel *model;
2480
2602
GObject *selection;
2481
2603
GtkWidget *chooser;
2482
2604
gint index = 0;
2605
gchar *glade_file = gui_general_user_file ("prefs" UI_SUFFIX, TRUE);
2484
glade_file = gui_general_user_file ("prefs.glade", TRUE);
2485
2607
g_return_if_fail(glade_file != NULL);
2487
2609
/* build the widget */
2610
#ifdef USE_GTKBUILDER
2611
gxml = gtk_builder_new ();
2612
gtk_builder_add_from_file (gxml, glade_file, NULL);
2488
2614
gxml = glade_xml_new (glade_file, NULL, NULL);
2489
2616
g_free (glade_file);
2490
2617
g_return_if_fail (gxml != NULL);
2492
2619
/* lookup the root widget */
2493
dialog_prefs = glade_xml_get_widget (gxml, "dialog_prefs");
2620
dialog_prefs = UI_GET_ITEM(gxml, "dialog_prefs");
2494
2621
g_signal_connect(dialog_prefs, "response",
2495
2622
G_CALLBACK(on_dialog_prefs_response), NULL);
2496
/* g_signal_connect(, "",
2497
G_CALLBACK(), NULL);
2499
2624
/* color pickers */
2500
color_picker.text_background = glade_xml_get_widget (gxml, "colorbutton1");
2625
color_picker.text_background = UI_GET_ITEM(gxml, "colorbutton1");
2626
color_picker.text = UI_GET_ITEM(gxml, "colorbutton2");
2627
color_picker.text_current_verse = UI_GET_ITEM(gxml, "colorbutton3");
2628
color_picker.verse_numbers = UI_GET_ITEM(gxml, "colorbutton4");
2629
color_picker.href_links = UI_GET_ITEM(gxml, "colorbutton5");
2630
color_picker.highlight_fg = UI_GET_ITEM(gxml, "colorbutton6");
2631
color_picker.highlight_bg = UI_GET_ITEM(gxml, "colorbutton7");
2633
color_picker.invert_normal = UI_GET_ITEM(gxml, "invert_normal");
2634
color_picker.invert_highlight = UI_GET_ITEM(gxml, "invert_highlight");
2636
check_button.enable_tabbed_browsing = UI_GET_ITEM(gxml, "checkbutton1");
2637
check_button.show_bible_pane = UI_GET_ITEM(gxml,"checkbutton2");
2638
check_button.show_preview_pane = UI_GET_ITEM(gxml, "checkbutton9");
2639
check_button.show_commentary_pane = UI_GET_ITEM(gxml, "checkbutton3");
2640
check_button.show_dictionary_pane = UI_GET_ITEM(gxml, "checkbutton4");
2641
check_button.use_linked_tabs = UI_GET_ITEM(gxml, "checkbutton10");
2642
check_button.readaloud = UI_GET_ITEM(gxml, "checkbutton11");
2643
check_button.show_verse_num = UI_GET_ITEM(gxml, "checkbutton12");
2644
check_button.use_default_dictionary = UI_GET_ITEM(gxml, "checkbutton6");
2645
check_button.show_devotion = UI_GET_ITEM(gxml, "checkbutton7");
2646
check_button.show_splash_screen = UI_GET_ITEM(gxml, "checkbutton8");
2647
check_button.use_chapter_scroll = UI_GET_ITEM(gxml, "checkbutton_scroll");
2649
check_button.use_imageresize = UI_GET_ITEM(gxml, "checkbutton_imageresize");
2651
/* webkit image hackery requires resize always be enabled. */
2652
gtk_widget_hide(check_button.use_imageresize);
2654
check_button.use_verse_num_bold = UI_GET_ITEM(gxml, "checkbutton_verse_num_bold");
2655
check_button.use_verse_num_bracket = UI_GET_ITEM(gxml, "checkbutton_verse_num_bracket");
2656
check_button.use_verse_num_superscript = UI_GET_ITEM(gxml, "checkbutton_verse_num_superscript");
2657
check_button.versehighlight = UI_GET_ITEM(gxml, "checkbutton_versehighlight");
2658
check_button.annotate_highlight = UI_GET_ITEM(gxml, "checkbutton_annotate_highlight");
2659
check_button.xrefs_in_verse_list = UI_GET_ITEM(gxml, "checkbutton_xrefs_in_verse_list");
2660
check_button.prayerlist = UI_GET_ITEM(gxml, "checkbutton_prayerlist");
2662
check_button.show_paratab = UI_GET_ITEM(gxml, "checkbutton_paratab");
2501
2664
g_signal_connect(color_picker.text_background, "color_set",
2502
2665
G_CALLBACK(on_colorbutton1_color_set), NULL);
2503
color_picker.text = glade_xml_get_widget (gxml, "colorbutton2");
2504
2666
g_signal_connect(color_picker.text, "color_set",
2505
2667
G_CALLBACK(on_colorbutton2_color_set), NULL);
2506
color_picker.text_current_verse = glade_xml_get_widget (gxml, "colorbutton3");
2507
2668
g_signal_connect(color_picker.text_current_verse, "color_set",
2508
2669
G_CALLBACK(on_colorbutton3_color_set), NULL);
2509
color_picker.verse_numbers = glade_xml_get_widget (gxml, "colorbutton4");
2510
2670
g_signal_connect(color_picker.verse_numbers, "color_set",
2511
2671
G_CALLBACK(on_colorbutton4_color_set), NULL);
2512
color_picker.href_links = glade_xml_get_widget (gxml, "colorbutton5");
2513
2672
g_signal_connect(color_picker.href_links, "color_set",
2514
2673
G_CALLBACK(on_colorbutton5_color_set), NULL);
2515
color_picker.highlight_fg = glade_xml_get_widget (gxml, "colorbutton6");
2516
2674
g_signal_connect(color_picker.highlight_fg, "color_set",
2517
2675
G_CALLBACK(on_colorbutton6_color_set), NULL);
2518
color_picker.highlight_bg = glade_xml_get_widget (gxml, "colorbutton7");
2519
2676
g_signal_connect(color_picker.highlight_bg, "color_set",
2520
2677
G_CALLBACK(on_colorbutton7_color_set), NULL);
2521
2678
setup_color_pickers();
2523
2680
/* color inverters */
2524
color_picker.invert_normal = glade_xml_get_widget (gxml, "invert_normal");
2525
2681
g_signal_connect((gpointer)color_picker.invert_normal, "clicked",
2526
2682
G_CALLBACK(on_invert), (void*)1);
2527
color_picker.invert_highlight = glade_xml_get_widget (gxml, "invert_highlight");
2528
2683
g_signal_connect((gpointer)color_picker.invert_highlight, "clicked",
2529
2684
G_CALLBACK(on_invert), (void*)0);
2531
2686
/* check buttons */
2532
check_button.enable_tabbed_browsing = glade_xml_get_widget(gxml, "checkbutton1");
2533
check_button.show_bible_pane = glade_xml_get_widget(gxml,"checkbutton2");
2534
check_button.show_preview_pane = glade_xml_get_widget(gxml, "checkbutton9");
2535
check_button.show_commentary_pane = glade_xml_get_widget(gxml, "checkbutton3");
2536
check_button.show_dictionary_pane = glade_xml_get_widget(gxml, "checkbutton4");
2537
check_button.use_linked_tabs = glade_xml_get_widget(gxml, "checkbutton10");
2538
check_button.readaloud = glade_xml_get_widget(gxml, "checkbutton11");
2539
check_button.show_verse_num = glade_xml_get_widget(gxml, "checkbutton12");
2540
check_button.use_default_dictionary = glade_xml_get_widget(gxml, "checkbutton6");
2541
check_button.show_devotion = glade_xml_get_widget(gxml, "checkbutton7");
2542
check_button.show_splash_screen = glade_xml_get_widget(gxml, "checkbutton8");
2543
check_button.use_chapter_scroll = glade_xml_get_widget(gxml, "checkbutton_scroll");
2544
#ifdef USE_GTKMOZEMBED
2545
2688
gtk_widget_hide(check_button.use_chapter_scroll);
2547
check_button.use_imageresize = glade_xml_get_widget(gxml, "checkbutton_imageresize");
2548
check_button.versehighlight = glade_xml_get_widget(gxml, "checkbutton_versehighlight");
2549
check_button.annotate_highlight = glade_xml_get_widget(gxml, "checkbutton_annotate_highlight");
2550
check_button.xrefs_in_verse_list = glade_xml_get_widget(gxml, "checkbutton_xrefs_in_verse_list");
2551
check_button.prayerlist = glade_xml_get_widget(gxml, "checkbutton_prayerlist");
2553
check_button.show_paratab = glade_xml_get_widget(gxml, "checkbutton_paratab");
2555
2691
gtk_widget_hide(check_button.show_paratab);
2559
2695
/* verse number size */
2560
2696
index = get_font_size_index(settings.verse_num_font_size_str);
2561
combo.verse_number_size = glade_xml_get_widget(gxml, "combobox1");
2697
combo.verse_number_size = UI_GET_ITEM(gxml, "combobox1");
2562
2698
gtk_combo_box_set_active(GTK_COMBO_BOX(combo.verse_number_size), index);
2563
2699
g_signal_connect(combo.verse_number_size, "changed",
2564
2700
G_CALLBACK(on_combobox1_changed), NULL);
2566
2702
/* base font size */
2567
2703
index = get_font_size_index(settings.base_font_size_str);
2568
combo.base_font_size = glade_xml_get_widget(gxml, "basecombobox1");
2704
combo.base_font_size = UI_GET_ITEM(gxml, "basecombobox1");
2569
2705
gtk_combo_box_set_active(GTK_COMBO_BOX(combo.base_font_size), index);
2570
2706
g_signal_connect(combo.base_font_size, "changed",
2571
2707
G_CALLBACK(on_basecombobox1_changed), NULL);
2573
2709
/* module combos */
2574
combo.default_dictionary_module = glade_xml_get_widget (gxml, "combobox5");
2575
combo.percomm_module = glade_xml_get_widget (gxml, "combobox6");
2576
combo.devotion_module = glade_xml_get_widget (gxml, "combobox12");
2577
combo.hebrew_lex__module = glade_xml_get_widget (gxml, "combobox13");
2578
combo.greek_lex__module = glade_xml_get_widget (gxml, "combobox14");
2710
combo.default_dictionary_module = UI_GET_ITEM(gxml, "combobox5");
2711
combo.percomm_module = UI_GET_ITEM(gxml, "combobox6");
2712
combo.devotion_module = UI_GET_ITEM(gxml, "combobox12");
2713
combo.hebrew_lex__module = UI_GET_ITEM(gxml, "combobox13");
2714
combo.greek_lex__module = UI_GET_ITEM(gxml, "combobox14");
2579
2715
setup_module_comboboxes();
2581
combo.special_locale = glade_xml_get_widget (gxml, "combobox16");
2717
combo.special_locale = UI_GET_ITEM(gxml, "combobox16");
2582
2718
setup_locale_combobox();
2583
combo.font_prefs = glade_xml_get_widget (gxml, "combobox17");
2720
combo.font_prefs = UI_GET_ITEM(gxml, "combobox17");
2584
2721
setup_font_prefs_combobox();
2586
2723
/* studypad directory chooserbutton */
2587
chooser = glade_xml_get_widget (gxml, "filechooserbutton1");
2724
chooser = UI_GET_ITEM(gxml, "filechooserbutton1");
2588
2725
gtk_file_chooser_set_current_folder((GtkFileChooser *)chooser,
2589
2726
settings.studypaddir);
2590
2727
g_signal_connect(chooser, "current_folder_changed",