about summary refs log tree commit diff stats
path: root/src/LYOptions.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>1999-10-21 15:30:04 -0400
committerThomas E. Dickey <dickey@invisible-island.net>1999-10-21 15:30:04 -0400
commit2d161b7d97cebd6f38885cf69933291fec6b4381 (patch)
tree47b7f706656bad14ad80a021a27332ca96d4684e /src/LYOptions.c
parentfaba82cd3507fcd4172d94209cd1b700689d5d35 (diff)
downloadlynx-snapshots-2d161b7d97cebd6f38885cf69933291fec6b4381.tar.gz
snapshot of project "lynx", label v2-8-3dev_13
Diffstat (limited to 'src/LYOptions.c')
-rw-r--r--src/LYOptions.c87
1 files changed, 58 insertions, 29 deletions
diff --git a/src/LYOptions.c b/src/LYOptions.c
index 60fe6e4c..ba1e2973 100644
--- a/src/LYOptions.c
+++ b/src/LYOptions.c
@@ -1615,13 +1615,15 @@ draw_options:
 			HTInfoMsg("");
 		    } else if (LYUserAgent && *LYUserAgent &&
 			!strstr(LYUserAgent, "Lynx") &&
-			!strstr(LYUserAgent, "lynx")) {
-			_statusline(UA_COPYRIGHT_WARNING);
+			!strstr(LYUserAgent, "lynx") &&
+			!strstr(LYUserAgent, "L_y_n_x") &&
+			!strstr(LYUserAgent, "l_y_n_x")) {
+			_statusline(UA_PLEASE_USE_LYNX);
 		    } else {
 			_statusline(VALUE_ACCEPTED);
 		    }
 		} else { /* disallowed */
-		    _statusline(UA_COPYRIGHT_WARNING);
+		    _statusline(UA_CHANGE_DISABLED);
 		}
 		response = ' ';
 		break;
@@ -2425,7 +2427,7 @@ PUBLIC int popup_choice ARGS7(
 #ifdef NCURSES
     LYsubwindow(form_window);
 #endif
-#if defined(HAVE_GETBKGD) && !defined(PDCURSES)/* not defined in ncurses 1.8.7 */
+#if defined(HAVE_GETBKGD)/* not defined in ncurses 1.8.7 */
     wbkgd(form_window, getbkgd(stdscr));
     wbkgdset(form_window, getbkgd(stdscr));
 #endif
@@ -3405,19 +3407,26 @@ static char * user_agent_string		= "user_agent";
 #define PutLabel(fp, text) \
 	fprintf(fp,"  %-33s: ", text)
 
+#define PutLabelNotSaved(fp, text) \
+    if (!no_option_save) { \
+	int l=strlen(text); \
+	fprintf(fp,"  %s", text); \
+	fprintf(fp,"%s%-*s: ", (l<30)?" ":"", (l<30)?32-l:3, "(!)"); \
+    } else PutLabel(fp, text)
+
 #define PutTextInput(fp, Name, Value, Size, disable) \
 	fprintf(fp,\
 	"<input size=%d type=\"text\" name=\"%s\" value=\"%s\" %s>\n",\
-		(int) Size, Name, Value, disable)
+		(int) Size, Name, Value, disable_all?disabled_string:disable)
 
 #define PutOption(fp, flag, html, name) \
 	fprintf(fp,"<option value=\"%s\" %s>%s\n", html, SELECTED(flag), name)
 
 #define BeginSelect(fp, text) \
-	fprintf(fp,"<select name=\"%s\">\n", text)
+	fprintf(fp,"<select name=\"%s\" %s>\n", text, disable_all?disabled_string:"")
 
 #define MaybeSelect(fp, flag, text) \
-	fprintf(fp,"<select name=\"%s\" %s>\n", text, DISABLED(flag))
+	fprintf(fp,"<select name=\"%s\" %s>\n", text, disable_all?disabled_string:DISABLED(flag))
 
 #define EndSelect(fp)\
 	fprintf(fp,"</select>\n")
@@ -3928,8 +3937,10 @@ PUBLIC int postoptions ARGS1(
 		   : LYUserAgentDefault);
 		if (LYUserAgent && *LYUserAgent &&
 		   !strstr(LYUserAgent, "Lynx") &&
-		   !strstr(LYUserAgent, "lynx")) {
-		    HTAlert(UA_COPYRIGHT_WARNING);
+		   !strstr(LYUserAgent, "lynx") &&
+		   !strstr(LYUserAgent, "L_y_n_x") &&
+		   !strstr(LYUserAgent, "l_y_n_x")) {
+		    HTAlert(UA_PLEASE_USE_LYNX);
 		}
 	    }
 	}
@@ -4137,6 +4148,7 @@ PRIVATE int gen_options ARGS1(
     BOOLEAN can_do_colors;
 #endif
     static char tempfile[LY_MAXPATH] = "\0";
+    BOOLEAN disable_all = FALSE;
     FILE *fp0;
     size_t cset_len = 0;
     size_t text_len = COLS - 38;	/* cf: PutLabel */
@@ -4163,6 +4175,13 @@ PRIVATE int gen_options ARGS1(
        the flag. - kw 1999-05-24 */
     LYforce_no_cache = TRUE;
 
+    /*
+     * Without LYUseFormsOptions set we should maybe not even get here.
+     * However, it's possible we do; disable the form in that case. - kw
+     */
+    if (!LYUseFormsOptions)
+	disable_all = TRUE;
+
     BeginInternalPage(fp0, OPTIONS_TITLE, NULL); /* help link below */
 
     /*
@@ -4183,17 +4202,22 @@ PRIVATE int gen_options ARGS1(
 
     /* Submit/Reset/Help */
     fprintf(fp0,"<p align=center>\n");
-    fprintf(fp0,"<input type=\"submit\" value=\"%s\"> - \n", ACCEPT_CHANGES);
-    fprintf(fp0,"<input type=\"reset\" value=\"%s\">\n", RESET_CHANGES);
-    fprintf(fp0,"%s\n", CANCEL_CHANGES);
+    if (!disable_all) {
+	fprintf(fp0,"<input type=\"submit\" value=\"%s\"> - \n", ACCEPT_CHANGES);
+	fprintf(fp0,"<input type=\"reset\" value=\"%s\">\n", RESET_CHANGES);
+	fprintf(fp0,"%s\n", CANCEL_CHANGES);
+    }
     fprintf(fp0, "<a href=\"%s%s\">%s</a>\n",
 		 helpfilepath, OPTIONS_HELP, TO_HELP);
 
     /* Save options */
     if (!no_option_save) {
-	fprintf(fp0, "<p align=center>%s: ", SAVE_OPTIONS);
-	fprintf(fp0, "<input type=\"checkbox\" name=\"%s\">\n",
-		save_options_string);
+	if (!disable_all) {
+	    fprintf(fp0, "<p align=center>%s: ", SAVE_OPTIONS);
+	    fprintf(fp0, "<input type=\"checkbox\" name=\"%s\">\n",
+		    save_options_string);
+	}
+	fprintf(fp0, "<br>(options marked with (!) will not be saved)\n");
     }
 
     /*
@@ -4203,7 +4227,9 @@ PRIVATE int gen_options ARGS1(
     fprintf(fp0,"\n  <em>%s</em>\n", gettext("Personal Preferences"));
 
     /* Cookies: SELECT */
-    PutLabel(fp0, gettext("Cookies"));
+    /* @@@ This is inconsistent - LYAcceptAllCookies gets saved to RC file
+       but LYSetCookies doesn't! */
+    PutLabelNotSaved(fp0, gettext("Cookies"));
     BeginSelect(fp0, cookies_string);
     PutOption(fp0, !LYSetCookies,
 	      cookies_ignore_all_string,
@@ -4348,7 +4374,7 @@ PRIVATE int gen_options ARGS1(
     EndSelect(fp0);
 
     /* X Display: INPUT */
-    PutLabel(fp0, gettext("X Display"));
+    PutLabelNotSaved(fp0, gettext("X Display"));
     PutTextInput(fp0, x_display_string, NOTEMPTY(x_display), text_len, "");
 
     /*
@@ -4371,7 +4397,7 @@ PRIVATE int gen_options ARGS1(
 	    /* ok, LYRawMode, so use UCAssume_MIMEcharset */
 	    curval = safeUCGetLYhndl_byMIME(UCAssume_MIMEcharset);
 	}
-	PutLabel(fp0, gettext("Assumed document character set"));
+	PutLabelNotSaved(fp0, gettext("Assumed document character set"));
 	BeginSelect(fp0, assume_char_set_string);
 	for (i = 0; i < LYNumCharsets; i++) {
 #ifdef EXP_CHARSET_CHOICE
@@ -4385,15 +4411,16 @@ PRIVATE int gen_options ARGS1(
     }
 
     /* Raw Mode: ON/OFF */
-    if (LYHaveCJKCharacterSet)
+    if (LYHaveCJKCharacterSet) {
 	/*
 	 * Since CJK people hardly mixed with other world
 	 * we split the header to make it more readable:
 	 * "CJK mode" for CJK display charsets, and "Raw 8-bit" for others.
 	 */
-	PutLabel(fp0, gettext("CJK mode"));
-    else
-	PutLabel(fp0, gettext("Raw 8-bit"));
+	PutLabelNotSaved(fp0, gettext("CJK mode"));
+    } else {
+	PutLabelNotSaved(fp0, gettext("Raw 8-bit"));
+    }
 
     BeginSelect(fp0, raw_mode_string);
     PutOptValues(fp0, LYRawMode, bool_values);
@@ -4401,7 +4428,7 @@ PRIVATE int gen_options ARGS1(
 
 #ifndef SH_EX	/* 1999/01/19 (Tue) */
     /* HTML error recovery: SELECT */
-    PutLabel(fp0, gettext("HTML error recovery"));
+    PutLabelNotSaved(fp0, gettext("HTML error recovery"));
     BeginSelect(fp0, DTD_recovery_string);
     PutOptValues(fp0, Old_DTD, DTD_type_values);
     EndSelect(fp0);
@@ -4414,7 +4441,7 @@ PRIVATE int gen_options ARGS1(
     EndSelect(fp0);
 
     /* Show Images: SELECT */
-    PutLabel(fp0, gettext("Show images"));
+    PutLabelNotSaved(fp0, gettext("Show images"));
     BeginSelect(fp0, images_string);
     PutOption(fp0, !pseudo_inline_alts && !clickable_images,
        images_ignore_all_string,
@@ -4531,7 +4558,7 @@ PRIVATE int gen_options ARGS1(
 
     /* User Agent: INPUT */
     if (!no_useragent) {
-	PutLabel(fp0, gettext("User-Agent header"));
+	PutLabelNotSaved(fp0, gettext("User-Agent header"));
 	PutTextInput(fp0, user_agent_string,
 		     NOTEMPTY(LYUserAgent), text_len, "");
     }
@@ -4544,10 +4571,12 @@ PRIVATE int gen_options ARGS1(
     fprintf(fp0,"\n</pre>\n");
 
     /* Submit/Reset */
-    fprintf(fp0,"<p align=center>\n");
-    fprintf(fp0,"<input type=\"submit\" value=\"%s\">\n - ", ACCEPT_CHANGES);
-    fprintf(fp0,"<input type=\"reset\" value=\"%s\">\n", RESET_CHANGES);
-    fprintf(fp0,"%s\n", CANCEL_CHANGES);
+    if (!disable_all) {
+	fprintf(fp0,"<p align=center>\n");
+	fprintf(fp0,"<input type=\"submit\" value=\"%s\">\n - ", ACCEPT_CHANGES);
+	fprintf(fp0,"<input type=\"reset\" value=\"%s\">\n", RESET_CHANGES);
+	fprintf(fp0,"%s\n", CANCEL_CHANGES);
+    }
 
     /*
      * close HTML
d functions to parser.c, moved parser to tools' href='/danisanti/profani-tty/commit/Makefile.am?id=36265dde2fd70f994bc8ee2b2cdff9a398ceff1d'>36265dde ^
1b0ce852 ^

c1ee75da ^
c1ee75da ^
900a0451 ^
ef942bd2 ^
97d1b964 ^
c1ee75da ^
d96e68ea ^
21ab1821 ^
c1ee75da ^
904a5a81 ^
269afa53 ^
41fe8c22 ^



ac91e7ef ^
a4e6d50a ^
697db019 ^
623fbe9e ^
8f213f22 ^
d782b007 ^
6d6bb645 ^
c23506f4 ^
107fdd35 ^
25a6252a ^
2af0d38e ^
cc32bb77 ^
310abd40 ^
90b9b48a ^
d1f8c6cd ^
b9119b43 ^
7638f379 ^
2490c3ed ^
4a5b672f ^
bfbc8edc ^
f9216fdd ^
fb347855 ^


4c6cfcdc ^
107fdd35 ^

107fdd35 ^
900a0451 ^
447d2358 ^
21ab1821 ^
ef942bd2 ^
d96e68ea ^
107fdd35 ^

bad244fc ^
904a5a81 ^
97d1b964 ^
41fe8c22 ^



ac91e7ef ^
a4e6d50a ^
623fbe9e ^
5bc38b6b ^
883dbe19 ^
424f52c3 ^
32da6548 ^
8f213f22 ^
9ac72980 ^
68ed20f1 ^
44d16e91 ^
01e89f41 ^
68ed20f1 ^

1b0ce852 ^
68ed20f1 ^
81190251 ^










383e601f ^
68ed20f1 ^
68ed20f1 ^
81190251 ^



68ed20f1 ^
85cc5ab5 ^
81190251 ^
68ed20f1 ^
68ed20f1 ^
71879a3f ^
9945246a ^
68ed20f1 ^
d782b007 ^
e9194452 ^
68ed20f1 ^






5e324e40 ^
d54cbf12 ^
f9a7e350 ^
de747e3d ^
87b4d7cb ^
e1e0fda8 ^
68ed20f1 ^
d782b007 ^


0fc0b3ee ^



41fe8c22 ^



0fbaa6f5 ^
d782b007 ^
2490c3ed ^


1cd23e0e ^
c2c2cee6 ^
acd2d230 ^
fa89e2aa ^
0d15c710 ^
fa89e2aa ^

0d15c710 ^
264fc55a ^
4a5b672f ^
bce19811 ^
f9216fdd ^
4a5b672f ^
daf84ced ^


0fc0b3ee ^




41fe8c22 ^




6d6bb645 ^
68ed20f1 ^
7638f379 ^
9588fd7c ^
0c1092fd ^
9588fd7c ^
718a708b ^
0f0659aa ^
1809064d ^
0c1092fd ^
3ceb9b0d ^
2490c3ed ^

1cd23e0e ^
2490c3ed ^

fa89e2aa ^
6d6bb645 ^
7e4b1b1d ^
0fbaa6f5 ^
fa89e2aa ^

0fbaa6f5 ^
fa89e2aa ^
264fc55a ^

4a5b672f ^

daf84ced ^
4a5b672f ^

9588fd7c ^

d782b007 ^
0fbaa6f5 ^
3ceb9b0d ^



0fbaa6f5 ^


718a708b ^

d782b007 ^
41fe8c22 ^

f601e875 ^
41fe8c22 ^





252c7c2e ^

68ed20f1 ^

252c7c2e ^
171b6e73 ^
d4892b29 ^
171b6e73 ^
d4892b29 ^
171b6e73 ^






9588fd7c ^
171b6e73 ^


2655d9e8 ^
0c1092fd ^

0f0659aa ^













0fbaa6f5 ^

0c1092fd ^

13ee16de ^
0fbaa6f5 ^


















fb0e0659 ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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