3
#include "../preferences.h"
4
#include "../gtk_easy.h"
5
#include "../dialog_utils.h"
8
GtkWidget *in_sidepanel;
9
GtkWidget *transient_htdialogs;
10
GtkWidget *lowercase_tags;
12
GtkWidget *format_by_context;
14
GtkWidget *auto_update_meta_author;
15
GtkWidget *auto_update_meta_date;
16
GtkWidget *auto_update_meta_generator;
19
Thtmlbarprefs *hbp = NULL;
21
void htmlbar_pref_apply()
23
/*g_print("htmlbar_pref_apply\n");*/
24
integer_apply(&htmlbar_v.in_sidepanel, hbp->in_sidepanel, TRUE);
25
integer_apply(&htmlbar_v.transient_htdialogs, hbp->transient_htdialogs, TRUE);
26
integer_apply(&main_v->props.xhtml, hbp->xhtml, TRUE);
27
if (main_v->props.xhtml) {
28
htmlbar_v.lowercase_tags = 1;
29
main_v->props.allow_dep = 0;
31
integer_apply(&htmlbar_v.lowercase_tags, hbp->lowercase_tags, TRUE);
32
integer_apply(&main_v->props.allow_dep, hbp->allow_dep, TRUE);
34
integer_apply(&main_v->props.format_by_context, hbp->format_by_context, TRUE);
36
integer_apply(&main_v->props.auto_update_meta_author, hbp->auto_update_meta_author, TRUE);
37
integer_apply(&main_v->props.auto_update_meta_date, hbp->auto_update_meta_date, TRUE);
38
integer_apply(&main_v->props.auto_update_meta_generator, hbp->auto_update_meta_generator, TRUE);
42
xhtml_toggled_lcb(GtkWidget * widget, Thtmlbarprefs* hbp)
44
gboolean active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
45
gtk_widget_set_sensitive(hbp->lowercase_tags, !active);
46
gtk_widget_set_sensitive(hbp->allow_dep, !active);
49
void htmlbar_pref_initgui(GtkTreeStore *nstore, GtkTreeIter *pit, GSList **widgetfreelist)
51
GtkWidget *frame, *vbox, *table, *vbox2;
54
hbp = g_new0(Thtmlbarprefs, 1);
56
frame = gtk_frame_new(NULL);
57
gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
58
vbox = gtk_vbox_new(FALSE, 12);
59
gtk_container_set_border_width(GTK_CONTAINER(vbox), 6);
60
gtk_container_add(GTK_CONTAINER(frame), vbox);
62
gtk_tree_store_append(nstore, &it, pit);
63
gtk_tree_store_set(nstore, &it, NAMECOL, _("HTML Features"), WIDGETCOL, frame, -1);
64
*widgetfreelist = g_slist_prepend(*widgetfreelist, frame);
66
vbox2 = dialog_vbox_labeled(_("<b>HTML Toolbar</b>"), vbox);
67
table = dialog_table_in_vbox_defaults(2, 1, 0, vbox2);
69
dialog_check_button_in_table(_("Show toolbar in sidepanel"), htmlbar_v.in_sidepanel, table, 0, 1, 0,1);
70
hbp->transient_htdialogs = dialog_check_button_in_table(_("Keep HTML dialogs always on top"),
71
htmlbar_v.transient_htdialogs, table, 0, 1, 1, 2);
75
vbox2 = dialog_vbox_labeled(_("<b>HTML options</b>"), vbox);
76
table = dialog_table_in_vbox_defaults(4, 1, 0, vbox2);
79
dialog_check_button_in_table(_("Use _XHTML style tags (<br />)"), main_v->props.xhtml, table, 0, 1, 0,1);
80
g_signal_connect(G_OBJECT(hbp->xhtml), "toggled", G_CALLBACK(xhtml_toggled_lcb), hbp);
81
hbp->lowercase_tags = dialog_check_button_in_table(_("Use lo_wercase HTML tags"),
82
htmlbar_v.lowercase_tags, table, 0, 1, 1, 2);
83
hbp->allow_dep = dialog_check_button_in_table(_("Use de_precated tags (e.g. <font> and <nobr>)"),
84
main_v->props.allow_dep, table, 0, 1, 2, 3);
85
hbp->format_by_context =
86
dialog_check_button_in_table(_
87
("_Format according to accessibility guidelines (e.g. <strong> for <b>)"),
88
main_v->props.format_by_context, table, 0, 1, 3, 4);
90
xhtml_toggled_lcb(hbp->xhtml, hbp);
92
vbox2 = dialog_vbox_labeled(_("<b>Auto Update Tag Options</b>"), vbox);
93
table = dialog_table_in_vbox_defaults(3, 1, 0, vbox2);
95
hbp->auto_update_meta_author =
96
dialog_check_button_in_table(_("Automatically update a_uthor meta tag"),
97
main_v->props.auto_update_meta_author, table, 0, 1, 0, 1);
98
hbp->auto_update_meta_date =
99
dialog_check_button_in_table(_("Automatically update _date meta tag"),
100
main_v->props.auto_update_meta_date, table, 0, 1, 1, 2);
101
hbp->auto_update_meta_generator =
102
dialog_check_button_in_table(_("Automatically update _generator meta tag"),
103
main_v->props.auto_update_meta_generator, table, 0, 1, 2, 3);