* NTLM authentication support with the ntlm library, in Unix systems.
[alpine.git] / alpine / keymenu.c
blob326bc239ad9c436e8aae535d370535b9b51f89c3
1 #if !defined(lint) && !defined(DOS)
2 static char rcsid[] = "$Id: keymenu.c 1074 2008-06-04 00:08:43Z hubert@u.washington.edu $";
3 #endif
5 /*
6 * ========================================================================
7 * Copyright 2013-2017 Eduardo Chappa
8 * Copyright 2006-2008 University of Washington
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * ========================================================================
19 #include "headers.h"
20 #include "keymenu.h"
21 #include "mailcmd.h"
22 #include "signal.h"
23 #include "status.h"
24 #include "../pith/bitmap.h"
25 #include "../pith/conf.h"
26 #include "../pith/state.h"
30 * We put all of the keymenu definitions here so that it is easy to
31 * share them. The names are in keymenu.h, as well. Some of these
32 * aren't easily shareable because we modify them dynamically but
33 * here they are anyway. It's not altogether clear that this is a good idea.
34 * Perhaps it would be better to just define the keymenus multiple times
35 * in different source files even though they are the same, with static
36 * declarations.
38 * The key numbers are sometimes used symbolically, like OTHER_KEY. Those
39 * are in keymenu.h, too, and are hard to use. If you change a menu here
40 * be sure to check those key numbers that go with it in keymenu.h.
43 #ifdef _WINDOWS
44 void configure_menu_items (struct key_menu *, bitmap_t);
45 #endif
49 * Macro to simplify instantiation of key_menu structs from key structs
51 #define INST_KEY_MENU(X, Y) struct key_menu X = \
52 {sizeof(Y)/(sizeof(Y[0])*12), 0, 0, Y}
54 struct key cancel_keys[] =
55 {HELP_MENU,
56 {"^C",N_("Cancel"),{MC_NONE},KS_NONE},
57 NULL_MENU,
58 NULL_MENU,
59 NULL_MENU,
60 NULL_MENU,
61 NULL_MENU,
62 NULL_MENU,
63 NULL_MENU,
64 NULL_MENU,
65 NULL_MENU,
66 NULL_MENU};
67 INST_KEY_MENU(cancel_keymenu, cancel_keys);
71 * A bunch of these are NULL_MENU because we want to change them dynamically.
73 struct key ab_keys[] =
74 {HELP_MENU,
75 NULL_MENU,
76 NULL_MENU,
77 NULL_MENU,
78 /* TRANSLATORS: go to Previous Entry */
79 {"P", N_("PrevEntry"), {MC_PREVITEM,1,{'p'}}, KS_NONE},
80 /* TRANSLATORS: go to Next Entry */
81 {"N", N_("NextEntry"), {MC_NEXTITEM,1,{'n'}}, KS_NONE},
82 PREVPAGE_MENU,
83 NEXTPAGE_MENU,
84 NULL_MENU,
85 NULL_MENU,
86 NULL_MENU,
87 WHEREIS_MENU,
89 HELP_MENU,
90 OTHER_MENU,
91 QUIT_MENU,
92 NULL_MENU,
93 LISTFLD_MENU,
94 GOTO_MENU,
95 INDEX_MENU,
96 RCOMPOSE_MENU,
97 PRYNTTXT_MENU,
98 NULL_MENU,
99 SAVE_MENU,
100 FORWARD_MENU,
102 HELP_MENU,
103 OTHER_MENU,
104 /* TRANSLATORS: Select this Entry */
105 {";",N_("Select"),{MC_SELECT,1,{';'}},KS_NONE},
106 /* TRANSLATORS: Apply a command to several objects at once */
107 {"A",N_("Apply"),{MC_APPLY,1,{'a'}},KS_APPLY},
108 /* TRANSLATORS: Select Current entry */
109 {":",N_("SelectCur"),{MC_SELCUR,1,{':'}},KS_SELECTCUR},
110 /* TRANSLATORS: Zoom refers to zooming in on a smaller set of
111 items, like with a camera zoom lense */
112 {"Z",N_("ZoomMode"),{MC_ZOOM,1,{'z'}},KS_NONE},
113 NULL_MENU,
114 NULL_MENU,
115 NULL_MENU,
116 NULL_MENU,
117 NULL_MENU,
118 NULL_MENU,
119 NULL_MENU};
120 INST_KEY_MENU(ab_keymenu, ab_keys);
123 struct key abook_select_keys[] =
124 {HELP_MENU,
125 NULL_MENU,
126 {"E", N_("Exit"), {MC_EXIT,1,{'e'}}, KS_EXITMODE},
127 {"S", "[" N_("Select") "]", {MC_CHOICE,3,{'s',ctrl('M'),ctrl('J')}}, KS_NONE},
128 /* TRANSLATORS: go to Previous entry */
129 {"P", N_("Prev"), {MC_PREVITEM, 1, {'p'}}, KS_NONE},
130 {"N", N_("Next"), {MC_NEXTITEM, 2, {'n', TAB}}, KS_NONE},
131 PREVPAGE_MENU,
132 NEXTPAGE_MENU,
133 HOMEKEY_MENU,
134 ENDKEY_MENU,
135 NULL_MENU,
136 WHEREIS_MENU};
137 INST_KEY_MENU(abook_select_km, abook_select_keys);
140 struct key abook_view_keys[] =
141 {HELP_MENU,
142 OTHER_MENU,
143 /* TRANSLATORS: Abook is an abbreviation for Address Book */
144 {"<",N_("Abook"),{MC_EXIT,2,{'<',','}},KS_NONE},
145 {"U",N_("Update"),{MC_EDIT,1,{'u'}},KS_NONE},
146 /* TRANSLATORS: ComposeTo means to start editing a new message to
147 this address book entry */
148 {"C",N_("ComposeTo"),{MC_COMPOSE,1,{'c'}},KS_COMPOSER},
149 RCOMPOSE_MENU,
150 PREVPAGE_MENU,
151 NEXTPAGE_MENU,
152 PRYNTTXT_MENU,
153 WHEREIS_MENU,
154 /* TRANSLATORS: abbreviation for Forward as Email */
155 {"F", N_("Fwd Email"), {MC_FORWARD, 1, {'f'}}, KS_FORWARD},
156 SAVE_MENU,
158 HELP_MENU,
159 OTHER_MENU,
160 /* TRANSLATORS: View the highlighted link, for example, a URL */
161 {"V",N_("ViewLink"),{MC_VIEW_HANDLE,3,{'v',ctrl('m'),ctrl('j')}},KS_NONE},
162 NULL_MENU,
163 /* TRANSLATORS: go to the previous link, for example, the previous URL */
164 {"^B",N_("PrevLink"),{MC_PREV_HANDLE,1,{ctrl('B')}},KS_NONE},
165 {"^F",N_("NextLink"),{MC_NEXT_HANDLE,1,{ctrl('F')}},KS_NONE},
166 NULL_MENU,
167 NULL_MENU,
168 NULL_MENU,
169 NULL_MENU,
170 NULL_MENU,
171 NULL_MENU};
172 INST_KEY_MENU(abook_view_keymenu, abook_view_keys);
175 struct key abook_text_keys[] =
176 {HELP_MENU,
177 NULL_MENU,
178 {"E",N_("Exit Viewer"),{MC_EXIT,1,{'e'}},KS_NONE},
179 NULL_MENU,
180 NULL_MENU,
181 NULL_MENU,
182 PREVPAGE_MENU,
183 NEXTPAGE_MENU,
184 PRYNTTXT_MENU,
185 WHEREIS_MENU,
186 FWDEMAIL_MENU,
187 {"S", N_("Save"), {MC_SAVETEXT,1,{'s'}}, KS_SAVE}};
188 INST_KEY_MENU(abook_text_km, abook_text_keys);
191 struct key ldap_view_keys[] =
192 {HELP_MENU,
193 OTHER_MENU,
194 /* TRANSLATORS: go back to the index of results instead of
195 viewing this particular entry */
196 {"<",N_("Results Index"),{MC_EXIT,2,{'<',','}},KS_NONE},
197 NULL_MENU,
198 {"C", N_("ComposeTo"), {MC_COMPOSE,1,{'c'}}, KS_COMPOSER},
199 RCOMPOSE_MENU,
200 PREVPAGE_MENU,
201 NEXTPAGE_MENU,
202 PRYNTTXT_MENU,
203 WHEREIS_MENU,
204 FWDEMAIL_MENU,
205 SAVE_MENU,
207 HELP_MENU,
208 OTHER_MENU,
209 {"V",N_("ViewLink"),{MC_VIEW_HANDLE,3,{'v',ctrl('m'),ctrl('j')}},KS_NONE},
210 NULL_MENU,
211 {"^B",N_("PrevLink"),{MC_PREV_HANDLE,1,{ctrl('B')}},KS_NONE},
212 {"^F",N_("NextLink"),{MC_NEXT_HANDLE,1,{ctrl('F')}},KS_NONE},
213 NULL_MENU,
214 NULL_MENU,
215 NULL_MENU,
216 NULL_MENU,
217 HOMEKEY_MENU,
218 ENDKEY_MENU};
219 INST_KEY_MENU(ldap_view_keymenu, ldap_view_keys);
222 struct key context_mgr_keys[] =
223 {HELP_MENU,
224 OTHER_MENU,
225 {"<", N_("Main Menu"), {MC_MAIN,3,{'m','<',','}}, KS_EXITMODE},
226 /* TRANSLATORS: View this Collection of folders */
227 {">", "[" N_("View Cltn") "]",
228 {MC_CHOICE,5,{'v','>','.',ctrl('M'),ctrl('J')}}, KS_NONE},
229 PREVC_MENU,
230 NEXTC_MENU,
231 PREVPAGE_MENU,
232 NEXTPAGE_MENU,
233 NULL_MENU,
234 NULL_MENU,
235 NULL_MENU,
236 WHEREIS_MENU,
238 HELP_MENU,
239 OTHER_MENU,
240 QUIT_MENU,
241 NULL_MENU,
242 NULL_MENU,
243 GOTO_MENU,
244 CIND_MENU,
245 COMPOSE_MENU,
246 PRYNTTXT_MENU,
247 RCOMPOSE_MENU,
248 HOMEKEY_MENU,
249 ENDKEY_MENU};
250 INST_KEY_MENU(c_mgr_km, context_mgr_keys);
253 struct key context_cfg_keys[] =
254 {HELP_MENU,
255 OTHER_MENU,
256 {"E", N_("Exit Setup"), {MC_EXIT,1,{'e'}}, KS_EXITMODE},
257 {"C", "[" N_("Change") "]", {MC_EDIT,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE},
258 PREVC_MENU,
259 NEXTC_MENU,
260 PREVPAGE_MENU,
261 NEXTPAGE_MENU,
262 /* TRANSLATORS; Add a Collection of folders */
263 {"A", N_("Add Cltn"), {MC_ADD,1,{'a'}}, KS_NONE},
264 DELC_MENU,
265 /* TRANSLATORS; Change the order of items in a list */
266 {"$", N_("Shuffle"), {MC_SHUFFLE,1,{'$'}},KS_NONE},
267 WHEREIS_MENU,
269 HELP_MENU,
270 OTHER_MENU,
271 NULL_MENU,
272 NULL_MENU,
273 NULL_MENU,
274 NULL_MENU,
275 NULL_MENU,
276 NULL_MENU,
277 PRYNTTXT_MENU,
278 NULL_MENU,
279 HOMEKEY_MENU,
280 ENDKEY_MENU};
281 INST_KEY_MENU(c_cfg_km, context_cfg_keys);
284 struct key context_select_keys[] =
285 {HELP_MENU,
286 {"E", N_("ExitSelect"), {MC_EXIT,1,{'e'}}, KS_EXITMODE},
287 NULL_MENU,
288 /* TRANSLATORS: View this collection */
289 {">", "[" N_("View Cltn") "]",
290 {MC_CHOICE, 5, {'v','>','.',ctrl('M'),ctrl('J')}}, KS_NONE},
291 PREVC_MENU,
292 NEXTC_MENU,
293 PREVPAGE_MENU,
294 NEXTPAGE_MENU,
295 HOMEKEY_MENU,
296 ENDKEY_MENU,
297 NULL_MENU,
298 WHEREIS_MENU};
299 INST_KEY_MENU(c_sel_km, context_select_keys);
302 struct key context_fcc_keys[] =
303 {HELP_MENU,
304 {"E", N_("ExitSelect"), {MC_EXIT,1,{'e'}}, KS_EXITMODE},
305 NULL_MENU,
306 {">", "[" N_("View Cltn") "]",
307 {MC_CHOICE, 5, {'v','>','.',ctrl('M'),ctrl('J')}}, KS_NONE},
308 PREVC_MENU,
309 NEXTC_MENU,
310 PREVPAGE_MENU,
311 NEXTPAGE_MENU,
312 HOMEKEY_MENU,
313 ENDKEY_MENU,
314 NULL_MENU,
315 WHEREIS_MENU};
316 INST_KEY_MENU(c_fcc_km, context_fcc_keys);
318 struct key folder_keys[] =
319 {HELP_MENU,
320 OTHER_MENU,
321 {"<", NULL, {MC_EXIT,2,{'<',','}}, KS_NONE},
322 {">", NULL, {MC_CHOICE,2,{'>','.'}}, KS_NONE},
323 PREVF_MENU,
324 NEXTF_MENU,
325 PREVPAGE_MENU,
326 NEXTPAGE_MENU,
327 /* TRANSLATORS: make an addition, for example add a new folder
328 or a new entry in an address book */
329 {"A",N_("Add"),{MC_ADDFLDR,1,{'a'}},KS_NONE},
330 DELETE_MENU,
331 /* TRANSLATORS: change the name of something */
332 {"R",N_("Rename"),{MC_RENAMEFLDR,1,{'r'}}, KS_NONE},
333 WHEREIS_MENU,
335 HELP_MENU,
336 OTHER_MENU,
337 QUIT_MENU,
338 MAIN_MENU,
339 {"V", "[" N_("View Fldr") "]", {MC_OPENFLDR}, KS_NONE},
340 GOTO_MENU,
341 CIND_MENU,
342 COMPOSE_MENU,
343 {"%", N_("Print"), {MC_PRINTFLDR,1,{'%'}}, KS_PRINT},
344 {"Z", N_("ZoomMode"), {MC_ZOOM,1,{'z'}}, KS_NONE},
345 {";",N_("Select"),{MC_SELECT,1,{';'}},KS_SELECT},
346 /* TRANSLATORS: Select current item */
347 {":",N_("SelectCur"),{MC_SELCUR,1,{':'}},KS_SELECT},
349 HELP_MENU,
350 OTHER_MENU,
351 NULL_MENU,
352 NULL_MENU,
353 NULL_MENU,
354 NULL_MENU,
355 {"$", N_("Shuffle"), {MC_SHUFFLE,1,{'$'}},KS_NONE},
356 RCOMPOSE_MENU,
357 EXPORT_MENU,
358 /* TRANSLATORS: Import refers to bringing something in from
359 outside of alpine's normal world */
360 {"U", N_("Import"), {MC_IMPORT,1,{'u'}},KS_NONE},
361 HOMEKEY_MENU,
362 ENDKEY_MENU};
363 INST_KEY_MENU(folder_km, folder_keys);
366 struct key folder_sel_keys[] =
367 {HELP_MENU,
368 {"E", N_("ExitSelect"), {MC_EXIT,1,{'e'}}, KS_EXITMODE},
369 NULL_MENU,
370 {NULL, NULL, {MC_CHOICE,0}, KS_NONE},
371 PREVF_MENU,
372 NEXTF_MENU,
373 PREVPAGE_MENU,
374 NEXTPAGE_MENU,
375 {"S", N_("Select"), {MC_OPENFLDR,1,{'s'}}, KS_NONE},
376 NULL_MENU,
377 NULL_MENU,
378 WHEREIS_MENU,
380 HELP_MENU,
381 OTHER_MENU,
382 NULL_MENU,
383 NULL_MENU,
384 NULL_MENU,
385 NULL_MENU,
386 NULL_MENU,
387 NULL_MENU,
388 NULL_MENU,
389 NULL_MENU,
390 HOMEKEY_MENU,
391 ENDKEY_MENU};
392 INST_KEY_MENU(folder_sel_km, folder_sel_keys);
395 struct key folder_sela_keys[] =
396 {HELP_MENU,
397 {"E", N_("ExitSelect"), {MC_EXIT,1,{'e'}}, KS_EXITMODE},
398 NULL_MENU,
399 {NULL, NULL, {MC_CHOICE,0}, KS_NONE},
400 PREVF_MENU,
401 NEXTF_MENU,
402 PREVPAGE_MENU,
403 NEXTPAGE_MENU,
404 {"S", N_("Select"), {MC_OPENFLDR,1,{'s'}}, KS_NONE},
405 NULL_MENU,
406 {"A", N_("AddNew"), {MC_ADD,1,{'a'}}, KS_NONE},
407 WHEREIS_MENU,
409 HELP_MENU,
410 OTHER_MENU,
411 NULL_MENU,
412 NULL_MENU,
413 NULL_MENU,
414 NULL_MENU,
415 NULL_MENU,
416 NULL_MENU,
417 NULL_MENU,
418 NULL_MENU,
419 HOMEKEY_MENU,
420 ENDKEY_MENU};
421 INST_KEY_MENU(folder_sela_km, folder_sela_keys);
424 struct key folder_sub_keys[] =
425 {HELP_MENU,
426 /* TRANSLATORS: Subscribe to a news group */
427 {"S", N_("Subscribe"), {MC_CHOICE,1,{'s'}}, KS_NONE},
428 /* TRANSLATORS: Exit Subscribe screen */
429 {"E", N_("ExitSubscb"), {MC_EXIT,1,{'e'}}, KS_EXITMODE},
430 {NULL, "[" N_("Select") "]", {MC_CHOICE,3,{'s',ctrl('M'),ctrl('J')}}, KS_NONE},
431 PREVF_MENU,
432 NEXTF_MENU,
433 PREVPAGE_MENU,
434 NEXTPAGE_MENU,
435 /* TRANSLATORS: List Mode in alpine is where you can select not just
436 one of something but you can select a whole list of something, for
437 example a whole list of addresses to send to. */
438 {"L", N_("List Mode"), {MC_LISTMODE, 1, {'l'}}, KS_NONE},
439 NULL_MENU,
440 NULL_MENU,
441 WHEREIS_MENU,
443 HELP_MENU,
444 OTHER_MENU,
445 NULL_MENU,
446 NULL_MENU,
447 NULL_MENU,
448 NULL_MENU,
449 NULL_MENU,
450 NULL_MENU,
451 NULL_MENU,
452 NULL_MENU,
453 HOMEKEY_MENU,
454 ENDKEY_MENU};
455 INST_KEY_MENU(folder_sub_km, folder_sub_keys);
458 struct key folder_post_keys[] =
459 {HELP_MENU,
460 NULL_MENU,
461 {"E", N_("ExitSelect"), {MC_EXIT,1,{'e'}}, KS_EXITMODE},
462 {"S", "[" N_("Select") "]", {MC_CHOICE, 3, {'s',ctrl('M'),ctrl('J')}}, KS_NONE},
463 PREVF_MENU,
464 NEXTF_MENU,
465 PREVPAGE_MENU,
466 NEXTPAGE_MENU,
467 HOMEKEY_MENU,
468 ENDKEY_MENU,
469 NULL_MENU,
470 WHEREIS_MENU};
471 INST_KEY_MENU(folder_post_km, folder_post_keys);
474 struct key help_keys[] =
475 {MAIN_MENU,
476 {NULL,NULL,{MC_EXIT,1,{'e'}}, KS_EXITMODE},
477 {NULL,NULL,{MC_EXIT,1,{'e'}}, KS_EXITMODE},
478 {NULL,NULL,{MC_VIEW_HANDLE,3,{'v',ctrl('m'),ctrl('j')}},KS_NONE},
479 {"^B",N_("PrevLink"),{MC_PREV_HANDLE,1,{ctrl('B')}},KS_NONE},
480 {"^F",N_("NextLink"),{MC_NEXT_HANDLE,1,{ctrl('F')}},KS_NONE},
481 PREVPAGE_MENU,
482 NEXTPAGE_MENU,
483 PRYNTMSG_MENU,
484 {"Z",N_("Print All"),{MC_PRINTALL,1,{'z'}},KS_NONE},
485 {"N",N_("Name"),{MC_EXPORT,1,{'n'}},KS_NONE},
486 WHEREIS_MENU,
488 HELP_MENU,
489 OTHER_MENU,
490 NULL_MENU,
491 NULL_MENU,
492 NULL_MENU,
493 NULL_MENU,
494 NULL_MENU,
495 NULL_MENU,
496 NULL_MENU,
497 NULL_MENU,
498 HOMEKEY_MENU,
499 ENDKEY_MENU};
500 INST_KEY_MENU(help_keymenu, help_keys);
503 struct key rev_msg_keys[] =
504 {HELP_MENU,
505 OTHER_MENU,
506 {"E",N_("Exit Viewer"),{MC_EXIT,1,{'e'}},KS_EXITMODE},
507 NULL_MENU,
508 {"T",NULL,{MC_TOGGLE,1,{'t'}},KS_NONE},
509 {"D",NULL,{MC_JUMP,1,{'d'}},KS_NONE},
510 PREVPAGE_MENU,
511 NEXTPAGE_MENU,
512 PRYNTTXT_MENU,
513 WHEREIS_MENU,
514 FWDEMAIL_MENU,
515 {"S", N_("Save"), {MC_SAVETEXT,1,{'s'}}, KS_SAVE},
517 HELP_MENU,
518 OTHER_MENU,
519 NULL_MENU,
520 NULL_MENU,
521 NULL_MENU,
522 NULL_MENU,
523 NULL_MENU,
524 NULL_MENU,
525 NULL_MENU,
526 NULL_MENU,
527 HOMEKEY_MENU,
528 ENDKEY_MENU};
529 INST_KEY_MENU(rev_msg_keymenu, rev_msg_keys);
532 struct key ans_certfail_keys[] =
533 {NULL_MENU,
534 NULL_MENU,
535 NULL_MENU,
536 /* TRANSLATORS: Continue means to keep going. The user is paused to read
537 something and has to tell us to continue when they are finished. */
538 {"C","[" N_("Continue") "]",{MC_YES,3,{'c',ctrl('J'),ctrl('M')}},KS_NONE},
539 NULL_MENU,
540 NULL_MENU,
541 PREVPAGE_MENU,
542 NEXTPAGE_MENU,
543 NULL_MENU,
544 NULL_MENU,
545 NULL_MENU,
546 NULL_MENU};
547 INST_KEY_MENU(ans_certfail_keymenu, ans_certfail_keys);
550 struct key ans_certquery_keys[] =
551 {HELP_MENU,
552 NULL_MENU,
553 {"Y",N_("Yes, continue"),{MC_YES,1,{'y'}},KS_NONE},
554 {"D","[" N_("Details") "]",{MC_VIEW_HANDLE,3,{'d',ctrl('M'),ctrl('J')}},KS_NONE},
555 {"N",N_("No"),{MC_NO,1,{'n'}},KS_NONE},
556 NULL_MENU,
557 PREVPAGE_MENU,
558 NEXTPAGE_MENU,
559 PRYNTTXT_MENU,
560 WHEREIS_MENU,
561 FWDEMAIL_MENU,
562 {"S", N_("Save"), {MC_SAVETEXT,1,{'s'}}, KS_SAVE}};
563 INST_KEY_MENU(ans_certquery_keymenu, ans_certquery_keys);
566 struct key forge_keys[] =
567 {HELP_MENU,
568 NULL_MENU,
569 {"Y",N_("Yes, continue"),{MC_YES,1,{'y'}},KS_NONE},
570 {"N",N_("No"),{MC_NO,1,{'n'}},KS_NONE},
571 NULL_MENU,
572 NULL_MENU,
573 PREVPAGE_MENU,
574 NEXTPAGE_MENU,
575 PRYNTTXT_MENU,
576 WHEREIS_MENU,
577 FWDEMAIL_MENU,
578 {"S", N_("Save"), {MC_SAVETEXT,1,{'s'}}, KS_SAVE}};
579 INST_KEY_MENU(forge_keymenu, forge_keys);
582 struct key listmgr_keys[] =
583 {HELP_MENU,
584 NULL_MENU,
585 /* TRANSLATORS: Exit Command List */
586 {"E",N_("Exit CmdList"),{MC_EXIT,1,{'e'}},KS_EXITMODE},
587 {"Ret","[" N_("Try Command") "]",{MC_VIEW_HANDLE,3,
588 {ctrl('m'),ctrl('j'),KEY_RIGHT}},KS_NONE},
589 /* TRANSLATORS: go to Previous Command in list */
590 {"^B",N_("Prev Cmd"),{MC_PREV_HANDLE,1,{ctrl('B')}},KS_NONE},
591 /* TRANSLATORS: go to Next Command in list */
592 {"^F",N_("Next Cmd"),{MC_NEXT_HANDLE,1,{ctrl('F')}},KS_NONE},
593 PREVPAGE_MENU,
594 NEXTPAGE_MENU,
595 PRYNTTXT_MENU,
596 WHEREIS_MENU,
597 HOMEKEY_MENU,
598 ENDKEY_MENU};
599 INST_KEY_MENU(listmgr_keymenu, listmgr_keys);
602 struct key index_keys[] =
603 {HELP_MENU,
604 OTHER_MENU,
605 {"<", NULL, {MC_FOLDERS,2,{'<',','}}, KS_NONE},
606 VIEWMSG_MENU,
607 PREVMSG_MENU,
608 NEXTMSG_MENU,
609 PREVPAGE_MENU,
610 NEXTPAGE_MENU,
611 DELETE_MENU,
612 UNDELETE_MENU,
613 REPLY_MENU,
614 FORWARD_MENU,
616 HELP_MENU,
617 OTHER_MENU,
618 MAIN_MENU,
619 QUIT_MENU,
620 COMPOSE_MENU,
621 GOTO_MENU,
622 TAB_MENU,
623 WHEREIS_MENU,
624 PRYNTMSG_MENU,
625 TAKE_MENU,
626 SAVE_MENU,
627 EXPORT_MENU,
629 HELP_MENU,
630 OTHER_MENU,
631 {"X",NULL,{MC_EXPUNGE,1,{'x'}},KS_NONE},
632 /* TRANSLATORS: this stands for unexclude which is the opposite
633 of the exclude command. Exclude eliminates some messages from
634 the view and unexclude gets them back. */
635 {"&",N_("unXclude"),{MC_UNEXCLUDE,1,{'&'}},KS_NONE},
636 {";",N_("Select"),{MC_SELECT,1,{';'}},KS_SELECT},
637 {"A",N_("Apply"),{MC_APPLY,1,{'a'}},KS_APPLY},
638 FLDRSORT_MENU,
639 JUMP_MENU,
640 HDRMODE_MENU,
641 BOUNCE_MENU,
642 FLAG_MENU,
643 PIPE_MENU,
645 HELP_MENU,
646 OTHER_MENU,
647 {":",N_("SelectCur"),{MC_SELCUR,1,{':'}},KS_SELECTCUR},
648 {"Z",N_("ZoomMode"),{MC_ZOOM,1,{'z'}},KS_ZOOM},
649 LISTFLD_MENU,
650 RCOMPOSE_MENU,
651 HOMEKEY_MENU,
652 ENDKEY_MENU,
653 NULL_MENU,
654 /* TRANSLATORS: toggles a collapsed view or an expanded view
655 of a message thread on and off */
656 {"/",N_("Collapse/Expand"),{MC_COLLAPSE,1,{'/'}},KS_NONE},
657 {"@", N_("Quota"), {MC_QUOTA,1,{'@'}}, KS_NONE},
658 NULL_MENU};
659 INST_KEY_MENU(index_keymenu, index_keys);
662 struct key simple_index_keys[] =
663 {HELP_MENU,
664 {"E",N_("ExitSelect"),{MC_EXIT,1,{'e'}},KS_EXITMODE},
665 NULL_MENU,
666 {"S","[" N_("Select") "]",{MC_SELECT,3,{'s',ctrl('M'),ctrl('J')}},KS_SELECT},
667 PREVMSG_MENU,
668 NEXTMSG_MENU,
669 PREVPAGE_MENU,
670 NEXTPAGE_MENU,
671 DELETE_MENU,
672 UNDELETE_MENU,
673 WHEREIS_MENU,
674 NULL_MENU};
675 INST_KEY_MENU(simple_index_keymenu, simple_index_keys);
678 struct key thread_keys[] =
679 {HELP_MENU,
680 OTHER_MENU,
681 /* TRANSLATORS: go to the Folder List */
682 {"<", N_("FldrList"), {MC_FOLDERS,2,{'<',','}}, KS_NONE},
683 /* TRANSLATORS: View a Thread of messages */
684 {">", "[" N_("ViewThd") "]", {MC_VIEW_ENTRY,5,{'v','.','>',ctrl('M'),ctrl('J')}},
685 KS_VIEW},
686 /* TRANSLATORS: go to the Previous Thread */
687 {"P", N_("PrevThd"), {MC_PREVITEM, 1, {'p'}}, KS_PREVMSG},
688 /* TRANSLATORS: go to the Next Thread */
689 {"N", N_("NextThd"), {MC_NEXTITEM, 1, {'n'}}, KS_NEXTMSG},
690 PREVPAGE_MENU,
691 NEXTPAGE_MENU,
692 DELETE_MENU,
693 UNDELETE_MENU,
694 REPLY_MENU,
695 FORWARD_MENU,
697 HELP_MENU,
698 OTHER_MENU,
699 MAIN_MENU,
700 QUIT_MENU,
701 COMPOSE_MENU,
702 GOTO_MENU,
703 TAB_MENU,
704 WHEREIS_MENU,
705 PRYNTMSG_MENU,
706 TAKE_MENU,
707 SAVE_MENU,
708 EXPORT_MENU,
710 HELP_MENU,
711 OTHER_MENU,
712 {"X",NULL,{MC_EXPUNGE,1,{'x'}},KS_NONE},
713 {"&",N_("unXclude"),{MC_UNEXCLUDE,1,{'&'}},KS_NONE},
714 {";",N_("Select"),{MC_SELECT,1,{';'}},KS_SELECT},
715 {"A",N_("Apply"),{MC_APPLY,1,{'a'}},KS_APPLY},
716 FLDRSORT_MENU,
717 JUMP_MENU,
718 HDRMODE_MENU,
719 BOUNCE_MENU,
720 FLAG_MENU,
721 PIPE_MENU,
723 HELP_MENU,
724 OTHER_MENU,
725 {":",N_("SelectCur"),{MC_SELCUR,1,{':'}},KS_SELECTCUR},
726 {"Z",N_("ZoomMode"),{MC_ZOOM,1,{'z'}},KS_ZOOM},
727 LISTFLD_MENU,
728 RCOMPOSE_MENU,
729 HOMEKEY_MENU,
730 ENDKEY_MENU,
731 NULL_MENU,
732 {"/",N_("Collapse/Expand"),{MC_COLLAPSE,1,{'/'}},KS_NONE},
733 {"@", N_("Quota"), {MC_QUOTA,1,{'@'}}, KS_NONE},
734 NULL_MENU};
735 INST_KEY_MENU(thread_keymenu, thread_keys);
738 struct key att_index_keys[] =
739 {HELP_MENU,
740 OTHER_MENU,
741 {"<",NULL,{MC_EXIT,2,{'<',','}},KS_EXITMODE},
742 {">","[" N_("View") "]",{MC_VIEW_ATCH,5,{'v','>','.',ctrl('M'),ctrl('J')}},
743 KS_VIEW},
744 /* TRANSLATORS: go to Previous Attachment */
745 {"P", N_("PrevAttch"),{MC_PREVITEM,4,{'p',ctrl('B'),ctrl('P'),KEY_UP}},
746 KS_PREVMSG},
747 /* TRANSLATORS: go to Next Attachment */
748 {"N", N_("NextAtch"),
749 {MC_NEXTITEM, 5, {'n','\t',ctrl('F'),ctrl('N'), KEY_DOWN}},
750 KS_NEXTMSG},
751 PREVPAGE_MENU,
752 NEXTPAGE_MENU,
753 DELETE_MENU,
754 UNDELETE_MENU,
755 {"S", N_("Save"), {MC_SAVETEXT,1,{'s'}}, KS_SAVE},
756 {NULL, NULL, {MC_EXPORT, 1, {'e'}}, KS_EXPORT},
758 HELP_MENU,
759 OTHER_MENU,
760 MAIN_MENU,
761 QUIT_MENU,
762 PIPE_MENU,
763 BOUNCE_MENU,
764 /* TRANSLATORS: About Attachment, a short description of the attachment */
765 {"A",N_("AboutAttch"),{MC_ABOUTATCH,1,{'a'}},KS_NONE},
766 WHEREIS_MENU,
767 {"%", N_("Print"), {MC_PRINTMSG,1,{'%'}}, KS_PRINT},
768 INDEX_MENU,
769 REPLY_MENU,
770 FORWARD_MENU,
772 HELP_MENU,
773 OTHER_MENU,
774 HDRMODE_MENU,
775 NULL_MENU,
776 NULL_MENU,
777 NULL_MENU,
778 NULL_MENU,
779 NULL_MENU,
780 NULL_MENU,
781 NULL_MENU,
782 NULL_MENU,
783 NULL_MENU};
784 INST_KEY_MENU(att_index_keymenu, att_index_keys);
787 struct key att_view_keys[] =
788 {HELP_MENU,
789 OTHER_MENU,
790 {"<",NULL,{MC_EXIT,2,{'<',','}},KS_EXITMODE},
791 /* TRANSLATORS: View highlighted URL */
792 {"Ret","[" N_("View Hilite") "]",{MC_VIEW_HANDLE,3,
793 {ctrl('m'),ctrl('j'),KEY_RIGHT}},KS_NONE},
794 /* TRANSLATORS: go to Previous URL */
795 {"^B",N_("Prev URL"),{MC_PREV_HANDLE,1,{ctrl('B')}},KS_NONE},
796 /* TRANSLATORS: go to Next URL */
797 {"^F",N_("Next URL"),{MC_NEXT_HANDLE,1,{ctrl('F')}},KS_NONE},
798 PREVPAGE_MENU,
799 NEXTPAGE_MENU,
800 DELETE_MENU,
801 UNDELETE_MENU,
802 SAVE_MENU,
803 EXPORT_MENU,
805 HELP_MENU,
806 OTHER_MENU,
807 MAIN_MENU,
808 QUIT_MENU,
809 PIPE_MENU,
810 BOUNCE_MENU,
811 HDRMODE_MENU,
812 WHEREIS_MENU,
813 {"%", N_("Print"), {MC_PRINTMSG,1,{'%'}}, KS_PRINT},
814 NULL_MENU,
815 REPLY_MENU,
816 FORWARD_MENU,
818 HELP_MENU,
819 OTHER_MENU,
820 HOMEKEY_MENU,
821 ENDKEY_MENU,
822 NULL_MENU,
823 NULL_MENU,
824 #ifdef SMIME
825 {"^D","Decrypt", {MC_DECRYPT,1,{ctrl('d')}},KS_NONE},
826 {"^E","Security", {MC_SECURITY,1,{ctrl('e')}},KS_NONE},
827 #else
828 NULL_MENU,
829 NULL_MENU,
830 #endif
831 NULL_MENU,
832 NULL_MENU,
833 NULL_MENU,
834 NULL_MENU};
835 INST_KEY_MENU(att_view_keymenu, att_view_keys);
838 struct key view_keys[] =
839 {HELP_MENU,
840 OTHER_MENU,
841 /* TRANSLATORS: go to Message Index */
842 {"<",N_("MsgIndex"),{MC_INDEX,3,{'i','<',','}},KS_FLDRINDEX},
843 /* TRANSLATORS: View the Attachment */
844 {">",N_("ViewAttch"),{MC_VIEW_ATCH,3,{'v','>','.'}},KS_NONE},
845 PREVMSG_MENU,
846 NEXTMSG_MENU,
847 PREVPAGE_MENU,
848 NEXTPAGE_MENU,
849 DELETE_MENU,
850 UNDELETE_MENU,
851 REPLY_MENU,
852 FORWARD_MENU,
854 HELP_MENU,
855 OTHER_MENU,
856 MAIN_MENU,
857 QUIT_MENU,
858 LISTFLD_MENU,
859 GOTO_MENU,
860 COMPOSE_MENU,
861 WHEREIS_MENU,
862 PRYNTMSG_MENU,
863 TAKE_MENU,
864 SAVE_MENU,
865 EXPORT_MENU,
867 HELP_MENU,
868 OTHER_MENU,
869 /* TRANSLATORS: View the highlighted URL */
870 {"Ret","[" N_("View Hilite") "]",{MC_VIEW_HANDLE,3,
871 {ctrl('m'),ctrl('j'),KEY_RIGHT}},KS_NONE},
872 /* TRANSLATORS: Select the current item */
873 {":",N_("SelectCur"),{MC_SELCUR,1,{':'}},KS_SELECTCUR},
874 /* TRANSLATORS: go to previous URL */
875 {"^B",N_("Prev URL"),{MC_PREV_HANDLE,1,{ctrl('B')}},KS_NONE},
876 /* TRANSLATORS: go to next URL */
877 {"^F",N_("Next URL"),{MC_NEXT_HANDLE,1,{ctrl('F')}},KS_NONE},
878 JUMP_MENU,
879 TAB_MENU,
880 HDRMODE_MENU,
881 BOUNCE_MENU,
882 FLAG_MENU,
883 PIPE_MENU,
885 HELP_MENU,
886 OTHER_MENU,
887 HOMEKEY_MENU,
888 ENDKEY_MENU,
889 RCOMPOSE_MENU,
890 {"A",N_("TogglePreferPlain"),{MC_TOGGLE,1,{'a'}},KS_NONE},
891 #ifdef SMIME
892 {"^D","Decrypt", {MC_DECRYPT,1,{ctrl('d')}},KS_NONE},
893 {"^E","Security", {MC_SECURITY,1,{ctrl('e')}},KS_NONE},
894 #else
895 NULL_MENU,
896 NULL_MENU,
897 #endif
898 NULL_MENU,
899 NULL_MENU,
900 NULL_MENU,
901 NULL_MENU};
902 INST_KEY_MENU(view_keymenu, view_keys);
905 struct key simple_text_keys[] =
906 {HELP_MENU,
907 OTHER_MENU,
908 {"E",N_("Exit Viewer"),{MC_EXIT,1,{'e'}},KS_EXITMODE},
909 NULL_MENU,
910 NULL_MENU,
911 NULL_MENU,
912 PREVPAGE_MENU,
913 NEXTPAGE_MENU,
914 PRYNTTXT_MENU,
915 WHEREIS_MENU,
916 FWDEMAIL_MENU,
917 {"S", N_("Save"), {MC_SAVETEXT,1,{'s'}}, KS_SAVE},
919 HELP_MENU,
920 OTHER_MENU,
921 NULL_MENU,
922 NULL_MENU,
923 NULL_MENU,
924 NULL_MENU,
925 NULL_MENU,
926 NULL_MENU,
927 NULL_MENU,
928 NULL_MENU,
929 HOMEKEY_MENU,
930 ENDKEY_MENU};
931 INST_KEY_MENU(simple_text_keymenu, simple_text_keys);
934 struct key oe_keys[] =
935 {{"^G",N_("Help"),{MC_NONE},KS_SCREENHELP},
936 {"^C",N_("Cancel"),{MC_NONE},KS_NONE},
937 {"^T","xxx",{MC_NONE},KS_NONE},
938 /* TRANSLATORS: The user is entering characters, for example, the
939 name of a folder. Accept means the user is done and wants to
940 accept what is currently displayed. */
941 {"Ret",N_("Accept"),{MC_NONE},KS_NONE},
942 NULL_MENU,
943 NULL_MENU,
944 NULL_MENU,
945 NULL_MENU,
946 NULL_MENU,
947 NULL_MENU,
948 NULL_MENU,
949 NULL_MENU};
950 INST_KEY_MENU(oe_keymenu, oe_keys);
953 struct key choose_setup_keys[] =
954 {HELP_MENU,
955 OTHER_MENU,
956 {"E",N_("Exit Setup"),{MC_EXIT,2,{'e',ctrl('C')}},KS_EXITMODE},
957 {"P",N_("Printer"),{MC_PRINTER,1,{'p'}},KS_NONE},
958 /* TRANSLATORS: Change password */
959 {"N",N_("Newpassword"),{MC_PASSWD,1,{'n'}},KS_NONE},
960 /* TRANSLATORS: Configure Alpine */
961 {"C",N_("Config"),{MC_CONFIG,1,{'c'}},KS_NONE},
962 /* TRANSLATORS: Edit signature block */
963 {"S",N_("Signature"),{MC_SIG,1,{'s'}},KS_NONE},
964 /* TRANSLATORS: configure address books */
965 {"A",N_("AddressBooks"),{MC_ABOOKS,1,{'a'}},KS_NONE},
966 /* TRANSLATORS: configure collection lists */
967 {"L",N_("collectionList"),{MC_CLISTS,1,{'l'}},KS_NONE},
968 /* TRANSLATORS: configure rules, an alpine concept */
969 {"R",N_("Rules"),{MC_RULES,1,{'r'}},KS_NONE},
970 /* TRANSLATORS: configure directory servers */
971 {"D",N_("Directory"),{MC_DIRECTORY,1,{'d'}},KS_NONE},
972 /* TRANSLATORS: configure color */
973 {"K",N_("Kolor"),{MC_KOLOR,1,{'k'}},KS_NONE},
975 HELP_MENU,
976 OTHER_MENU,
977 NULL_MENU,
978 /* TRANSLATORS: remote configuration setup */
979 {"Z",N_("RemoteConfigSetup"),{MC_REMOTE,1,{'z'}},KS_NONE},
980 /* TRANSLATORS: configure S/MIME */
981 {"M",N_("S/Mime"),{MC_SECURITY,1,{'m'}},KS_NONE},
982 NULL_MENU,
983 PREVPAGE_MENU,
984 NEXTPAGE_MENU,
985 NULL_MENU,
986 NULL_MENU,
987 HOMEKEY_MENU,
988 ENDKEY_MENU};
989 INST_KEY_MENU(choose_setup_keymenu, choose_setup_keys);
992 struct key main_keys[] =
993 {HELP_MENU,
994 OTHER_MENU,
995 NULL_MENU,
996 NULL_MENU,
997 /* TRANSLATORS: go to Previous Command in list */
998 {"P",N_("PrevCmd"),{MC_PREVITEM,3,{'p',ctrl('P'),KEY_UP}},KS_NONE},
999 {"N",N_("NextCmd"),{MC_NEXTITEM,3,{'n',ctrl('N'),KEY_DOWN}},KS_NONE},
1000 NULL_MENU,
1001 NULL_MENU,
1002 /* TRANSLATORS: show release notes */
1003 {"R",N_("RelNotes"),{MC_RELNOTES,1,{'r'}},KS_NONE},
1004 /* TRANSLATORS: lock keyboard */
1005 {"K",N_("KBLock"),{MC_KBLOCK,1,{'k'}},KS_NONE},
1006 NULL_MENU,
1007 NULL_MENU,
1009 HELP_MENU,
1010 OTHER_MENU,
1011 QUIT_MENU,
1012 COMPOSE_MENU,
1013 LISTFLD_MENU,
1014 GOTO_MENU,
1015 {"I",N_("Index"),{MC_INDEX,1,{'i'}},KS_FLDRINDEX},
1016 /* TRANSLATORS: go to the Journal. The Journal shows past
1017 messages that alpine has shown the user. */
1018 {"J",N_("Journal"),{MC_JOURNAL,1,{'j'}},KS_REVIEW},
1019 /* TRANSLATORS: go to the Setup screen */
1020 {"S",N_("Setup"),{MC_SETUP,1,{'s'}},KS_NONE},
1021 /* TRANSLATORS: go to the address book screen */
1022 {"A",N_("AddrBook"),{MC_ADDRBOOK,1,{'a'}},KS_ADDRBOOK},
1023 RCOMPOSE_MENU,
1024 NULL_MENU};
1025 INST_KEY_MENU(main_keymenu, main_keys);
1028 struct key simple_file_keys[] =
1029 {HELP_MENU,
1030 OTHER_MENU,
1031 {"Q",N_("Quit Viewer"),{MC_EXIT,1,{'q'}},KS_NONE},
1032 NULL_MENU,
1033 NULL_MENU,
1034 NULL_MENU,
1035 PREVPAGE_MENU,
1036 NEXTPAGE_MENU,
1037 PRYNTTXT_MENU,
1038 WHEREIS_MENU,
1039 FWDEMAIL_MENU,
1040 {"S", N_("Save"), {MC_SAVETEXT,1,{'s'}}, KS_SAVE},
1042 HELP_MENU,
1043 OTHER_MENU,
1044 NULL_MENU,
1045 NULL_MENU,
1046 NULL_MENU,
1047 NULL_MENU,
1048 NULL_MENU,
1049 NULL_MENU,
1050 NULL_MENU,
1051 NULL_MENU,
1052 HOMEKEY_MENU,
1053 ENDKEY_MENU};
1054 INST_KEY_MENU(simple_file_keymenu, simple_file_keys);
1057 struct key nuov_keys[] =
1058 {HELP_MENU,
1059 OTHER_MENU,
1060 {"E",NULL,{MC_EXIT,1,{'e',ctrl('M'),ctrl('J')}},KS_NONE},
1061 /* TRANSLATORS: Alpine asks the user to be counted when they
1062 first start using alpine. */
1063 {"Ret","[" N_("Be Counted!") "]",{MC_VIEW_HANDLE,2,{ctrl('M'),ctrl('J')}},KS_NONE},
1064 NULL_MENU,
1065 NULL_MENU,
1066 PREVPAGE_MENU,
1067 NEXTPAGE_MENU,
1068 PRYNTMSG_MENU,
1069 NULL_MENU,
1070 /* TRANSLATORS: show release notes */
1071 {"R",N_("RelNotes"),{MC_RELNOTES,1,{'r'}},KS_NONE},
1072 NULL_MENU,
1074 HELP_MENU,
1075 OTHER_MENU,
1076 NULL_MENU,
1077 NULL_MENU,
1078 NULL_MENU,
1079 NULL_MENU,
1080 NULL_MENU,
1081 NULL_MENU,
1082 NULL_MENU,
1083 NULL_MENU,
1084 HOMEKEY_MENU,
1085 ENDKEY_MENU};
1086 INST_KEY_MENU(nuov_keymenu, nuov_keys);
1089 struct key modal_message_keys[] =
1090 {NULL_MENU,
1091 NULL_MENU,
1092 {"Ret",N_("Finished"),{MC_EXIT,2,{ctrl('m'),ctrl('j')}},KS_NONE},
1093 NULL_MENU,
1094 NULL_MENU,
1095 NULL_MENU,
1096 PREVPAGE_MENU,
1097 NEXTPAGE_MENU,
1098 NULL_MENU,
1099 NULL_MENU,
1100 HOMEKEY_MENU,
1101 ENDKEY_MENU};
1102 INST_KEY_MENU(modal_message_keymenu, modal_message_keys);
1105 struct key ta_keys_lm[] =
1106 {HELP_MENU,
1107 WHEREIS_MENU,
1108 TA_EXIT_MENU,
1109 /* TRANSLATORS: Take this address into the address book */
1110 {"T", N_("Take"), {MC_TAKE,1,{'t'}}, KS_NONE},
1111 TA_PREV_MENU,
1112 TA_NEXT_MENU,
1113 PREVPAGE_MENU,
1114 NEXTPAGE_MENU,
1115 {"X","[" N_("Set/Unset") "]", {MC_CHOICE,3,{'x',ctrl('M'),ctrl('J')}}, KS_NONE},
1116 {"A", N_("SetAll"),{MC_SELALL,1,{'a'}},KS_NONE},
1117 {"U",N_("UnSetAll"),{MC_UNSELALL,1,{'u'}},KS_NONE},
1118 /* TRANSLATORS: The Take Address screen has a Single mode and a
1119 List mode. This command causes us to go into Single mode. */
1120 {"S",N_("SinglMode"),{MC_LISTMODE,1,{'s'}},KS_NONE}};
1121 INST_KEY_MENU(ta_keymenu_lm, ta_keys_lm);
1124 struct key ta_keys_sm[] =
1125 {HELP_MENU,
1126 WHEREIS_MENU,
1127 TA_EXIT_MENU,
1128 {"T","[" N_("Take") "]",{MC_TAKE,3,{'t',ctrl('M'),ctrl('J')}}, KS_NONE},
1129 TA_PREV_MENU,
1130 TA_NEXT_MENU,
1131 PREVPAGE_MENU,
1132 NEXTPAGE_MENU,
1133 NULL_MENU,
1134 NULL_MENU,
1135 NULL_MENU,
1136 /* TRANSLATORS: The Take Address screen has a Single mode and a
1137 List mode. This command causes us to go into List mode. */
1138 {"L",N_("ListMode"),{MC_LISTMODE,1,{'l'}},KS_NONE}};
1139 INST_KEY_MENU(ta_keymenu_sm, ta_keys_sm);
1142 struct key pipe_cancel_keys[] =
1143 {NULL_MENU,
1144 {"^C",N_("Stop Waiting"),{MC_NONE},KS_NONE},
1145 NULL_MENU,
1146 NULL_MENU,
1147 NULL_MENU,
1148 NULL_MENU,
1149 NULL_MENU,
1150 NULL_MENU,
1151 NULL_MENU,
1152 NULL_MENU,
1153 NULL_MENU,
1154 NULL_MENU};
1155 INST_KEY_MENU(pipe_cancel_keymenu, pipe_cancel_keys);
1158 struct key color_pattern_keys[] =
1159 {HELP_MENU,
1160 OTHER_MENU,
1161 EXIT_SETUP_MENU,
1162 /* TRANSLATORS: Change Value */
1163 {"C", "[" N_("Change Val") "]", {MC_EDIT,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE},
1164 PREV_MENU,
1165 NEXT_MENU,
1166 PREVPAGE_MENU,
1167 NEXTPAGE_MENU,
1168 NULL_MENU,
1169 /* TRANSLATORS: Delete Value */
1170 {"D", N_("Delete Val"), {MC_DELETE,1,{'d'}}, KS_NONE},
1171 PRYNTTXT_MENU,
1172 WHEREIS_MENU,
1174 HELP_MENU,
1175 OTHER_MENU,
1176 {"I", N_("IndxHdr"), {MC_ADDHEADER,1,{'i'}}, KS_NONE},
1177 NULL_MENU,
1178 NULL_MENU,
1179 NULL_MENU,
1180 NULL_MENU,
1181 NULL_MENU,
1182 NULL_MENU,
1183 NULL_MENU,
1184 HOMEKEY_MENU,
1185 ENDKEY_MENU};
1186 INST_KEY_MENU(color_pattern_keymenu, color_pattern_keys);
1189 struct key hdr_color_checkbox_keys[] =
1190 {HELP_MENU,
1191 NULL_MENU,
1192 EXIT_SETUP_MENU,
1193 TOGGLEB_MENU,
1194 PREV_MENU,
1195 NEXT_MENU,
1196 PREVPAGE_MENU,
1197 NEXTPAGE_MENU,
1198 HOMEKEY_MENU,
1199 ENDKEY_MENU,
1200 PRYNTTXT_MENU,
1201 WHEREIS_MENU};
1202 INST_KEY_MENU(hdr_color_checkbox_keymenu, hdr_color_checkbox_keys);
1205 struct key kw_color_checkbox_keys[] =
1206 {HELP_MENU,
1207 NULL_MENU,
1208 EXIT_SETUP_MENU,
1209 TOGGLEC_MENU,
1210 PREV_MENU,
1211 NEXT_MENU,
1212 PREVPAGE_MENU,
1213 NEXTPAGE_MENU,
1214 HOMEKEY_MENU,
1215 ENDKEY_MENU,
1216 PRYNTTXT_MENU,
1217 WHEREIS_MENU};
1218 INST_KEY_MENU(kw_color_checkbox_keymenu, kw_color_checkbox_keys);
1221 struct key selectable_bold_checkbox_keys[] =
1222 {HELP_MENU,
1223 NULL_MENU,
1224 EXIT_SETUP_MENU,
1225 TOGGLED_MENU,
1226 PREV_MENU,
1227 NEXT_MENU,
1228 PREVPAGE_MENU,
1229 NEXTPAGE_MENU,
1230 HOMEKEY_MENU,
1231 ENDKEY_MENU,
1232 PRYNTTXT_MENU,
1233 WHEREIS_MENU};
1234 INST_KEY_MENU(selectable_bold_checkbox_keymenu, selectable_bold_checkbox_keys);
1237 struct key flag_keys[] =
1238 {HELP_MENU,
1239 {"A", N_("Add KW"), {MC_ADD,1,{'a'}}, KS_NONE},
1240 /* TRANSLATORS: Exit from the Flags screen */
1241 {"E", N_("Exit Flags"), {MC_EXIT,1,{'e'}}, KS_EXITMODE},
1242 TOGGLE_MENU,
1243 PREV_MENU,
1244 NEXT_MENU,
1245 PREVPAGE_MENU,
1246 NEXTPAGE_MENU,
1247 HOMEKEY_MENU,
1248 ENDKEY_MENU,
1249 PRYNTTXT_MENU,
1250 WHEREIS_MENU};
1251 INST_KEY_MENU(flag_keymenu, flag_keys);
1254 struct key addr_select_keys[] =
1255 {HELP_MENU,
1256 {"E", N_("ExitSelect"), {MC_EXIT,1,{'e'}}, KS_EXITMODE},
1257 NULL_MENU,
1258 {"S", "[" N_("Select") "]", {MC_CHOICE,3,{'s',ctrl('M'),ctrl('J')}}, KS_NONE},
1259 PREV_MENU,
1260 NEXT_MENU,
1261 PREVPAGE_MENU,
1262 NEXTPAGE_MENU,
1263 HOMEKEY_MENU,
1264 ENDKEY_MENU,
1265 NULL_MENU,
1266 WHEREIS_MENU};
1267 INST_KEY_MENU(addr_s_km, addr_select_keys);
1270 struct key addr_select_with_goback_keys[] =
1271 {HELP_MENU,
1272 NULL_MENU,
1273 /* TRANSLATORS: go to address book list */
1274 {"<", N_("AddressBkList"), {MC_ADDRBOOK,2,{'<',','}}, KS_NONE},
1275 {"S", "[" N_("Select") "]", {MC_CHOICE,3,{'s',ctrl('M'),ctrl('J')}}, KS_NONE},
1276 PREV_MENU,
1277 NEXT_MENU,
1278 PREVPAGE_MENU,
1279 NEXTPAGE_MENU,
1280 HOMEKEY_MENU,
1281 ENDKEY_MENU,
1282 {"E", N_("ExitSelect"), {MC_EXIT,1,{'e'}}, KS_EXITMODE},
1283 WHEREIS_MENU};
1284 INST_KEY_MENU(addr_s_km_with_goback, addr_select_with_goback_keys);
1286 static struct key addr_select_with_view_keys[] =
1287 {HELP_MENU,
1288 RCOMPOSE_MENU,
1289 {"<", N_("AddressBkList"), {MC_ADDRBOOK,2,{'<',','}}, KS_NONE},
1290 {">", "[" N_("View") "]",
1291 {MC_VIEW_TEXT,5,{'v','>','.',ctrl('M'),ctrl('J')}}, KS_NONE},
1292 PREV_MENU,
1293 NEXT_MENU,
1294 PREVPAGE_MENU,
1295 NEXTPAGE_MENU,
1296 /* TRANSLATORS: compose a message to the current address */
1297 {"C", N_("ComposeTo"), {MC_COMPOSE,1,{'c'}}, KS_COMPOSER},
1298 FWDEMAIL_MENU,
1299 SAVE_MENU,
1300 WHEREIS_MENU,
1302 HELP_MENU,
1303 OTHER_MENU,
1304 NULL_MENU,
1305 NULL_MENU,
1306 NULL_MENU,
1307 NULL_MENU,
1308 NULL_MENU,
1309 NULL_MENU,
1310 NULL_MENU,
1311 NULL_MENU,
1312 HOMEKEY_MENU,
1313 ENDKEY_MENU};
1314 INST_KEY_MENU(addr_s_km_with_view, addr_select_with_view_keys);
1317 struct key addr_select_for_url_keys[] =
1318 {HELP_MENU,
1319 RCOMPOSE_MENU,
1320 {"<", N_("Exit Viewer"), {MC_ADDRBOOK,3,{'<',',','e'}}, KS_NONE},
1321 {">", "[" N_("View") "]",
1322 {MC_VIEW_TEXT,5,{'v','>','.',ctrl('M'),ctrl('J')}}, KS_NONE},
1323 PREV_MENU,
1324 NEXT_MENU,
1325 PREVPAGE_MENU,
1326 NEXTPAGE_MENU,
1327 {"C", N_("ComposeTo"), {MC_COMPOSE,1,{'c'}}, KS_COMPOSER},
1328 FWDEMAIL_MENU,
1329 SAVE_MENU,
1330 WHEREIS_MENU,
1332 HELP_MENU,
1333 OTHER_MENU,
1334 NULL_MENU,
1335 NULL_MENU,
1336 NULL_MENU,
1337 NULL_MENU,
1338 NULL_MENU,
1339 NULL_MENU,
1340 NULL_MENU,
1341 NULL_MENU,
1342 HOMEKEY_MENU,
1343 ENDKEY_MENU};
1344 INST_KEY_MENU(addr_s_km_for_url, addr_select_for_url_keys);
1347 struct key addr_select_exit_keys[] =
1348 {NULL_MENU,
1349 NULL_MENU,
1350 {"E", "[" N_("Exit") "]", {MC_EXIT,3,{'e',ctrl('M'),ctrl('J')}},
1351 KS_EXITMODE},
1352 NULL_MENU,
1353 NULL_MENU,
1354 NULL_MENU,
1355 NULL_MENU,
1356 NULL_MENU,
1357 NULL_MENU,
1358 NULL_MENU,
1359 NULL_MENU,
1360 NULL_MENU};
1361 INST_KEY_MENU(addr_s_km_exit, addr_select_exit_keys);
1364 struct key addr_select_goback_keys[] =
1365 {NULL_MENU,
1366 NULL_MENU,
1367 {"E", "[" N_("Exit") "]", {MC_ADDRBOOK,3,{'e',ctrl('M'),ctrl('J')}},
1368 KS_EXITMODE},
1369 NULL_MENU,
1370 NULL_MENU,
1371 NULL_MENU,
1372 NULL_MENU,
1373 NULL_MENU,
1374 NULL_MENU,
1375 NULL_MENU,
1376 NULL_MENU,
1377 NULL_MENU};
1378 INST_KEY_MENU(addr_s_km_goback, addr_select_goback_keys);
1381 struct key config_text_keys[] =
1382 {HELP_MENU,
1383 OTHER_MENU,
1384 EXIT_SETUP_MENU,
1385 {"C", "[" N_("Change Val") "]", {MC_EDIT,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE},
1386 PREV_MENU,
1387 NEXT_MENU,
1388 PREVPAGE_MENU,
1389 NEXTPAGE_MENU,
1390 {"A", N_("Add Value"), {MC_ADD,1,{'a'}}, KS_NONE},
1391 {"D", N_("Delete Val"), {MC_DELETE,1,{'d'}}, KS_NONE},
1392 PRYNTTXT_MENU,
1393 WHEREIS_MENU,
1395 HELP_MENU,
1396 OTHER_MENU,
1397 NULL_MENU,
1398 NULL_MENU,
1399 NULL_MENU,
1400 NULL_MENU,
1401 NULL_MENU,
1402 NULL_MENU,
1403 NULL_MENU,
1404 NULL_MENU,
1405 HOMEKEY_MENU,
1406 ENDKEY_MENU};
1407 INST_KEY_MENU(config_text_keymenu, config_text_keys);
1410 struct key config_text_to_charsets_keys[] =
1411 {HELP_MENU,
1412 OTHER_MENU,
1413 EXIT_SETUP_MENU,
1414 {"C", "[" N_("Change Val") "]", {MC_EDIT,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE},
1415 PREV_MENU,
1416 NEXT_MENU,
1417 PREVPAGE_MENU,
1418 NEXTPAGE_MENU,
1419 {"A", N_("Add Value"), {MC_ADD,1,{'a'}}, KS_NONE},
1420 {"D", N_("Delete Val"), {MC_DELETE,1,{'d'}}, KS_NONE},
1421 PRYNTTXT_MENU,
1422 WHEREIS_MENU,
1424 HELP_MENU,
1425 OTHER_MENU,
1426 NULL_MENU,
1427 NULL_MENU,
1428 /* TRANSLATORS: go to list of keywords */
1429 {"T", N_("ToCharsets"), {MC_CHOICE, 2, {'t', ctrl('T')}}, KS_NONE},
1430 NULL_MENU,
1431 NULL_MENU,
1432 NULL_MENU,
1433 NULL_MENU,
1434 NULL_MENU,
1435 HOMEKEY_MENU,
1436 ENDKEY_MENU};
1437 INST_KEY_MENU(config_text_to_charsets_keymenu, config_text_to_charsets_keys);
1440 struct key direct_config_keys[] =
1441 {HELP_MENU,
1442 NULL_MENU,
1443 {"E", N_("Exit Setup"), {MC_EXIT,1,{'e'}}, KS_EXITMODE},
1444 {"C", "[" N_("Change") "]", {MC_EDIT,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE},
1445 /* TRANSLATORS: go to previous LDAP directory server in the list */
1446 {"P", N_("PrevDir"), {MC_PREVITEM, 1, {'p'}}, KS_NONE},
1447 {"N", N_("NextDir"), {MC_NEXTITEM, 2, {'n', TAB}}, KS_NONE},
1448 PREVPAGE_MENU,
1449 NEXTPAGE_MENU,
1450 /* TRANSLATORS: add a directory server to configuration */
1451 {"A", N_("Add Dir"), {MC_ADD,1,{'a'}}, KS_NONE},
1452 /* TRANSLATORS: delete a directory */
1453 {"D", N_("Del Dir"), {MC_DELETE,1,{'d'}}, KS_NONE},
1454 {"$", N_("Shuffle"), {MC_SHUFFLE,1,{'$'}}, KS_NONE},
1455 WHEREIS_MENU,
1457 HELP_MENU,
1458 OTHER_MENU,
1459 NULL_MENU,
1460 NULL_MENU,
1461 NULL_MENU,
1462 NULL_MENU,
1463 NULL_MENU,
1464 NULL_MENU,
1465 NULL_MENU,
1466 NULL_MENU,
1467 HOMEKEY_MENU,
1468 ENDKEY_MENU};
1469 INST_KEY_MENU(dir_conf_km, direct_config_keys);
1472 struct key sel_from_list_keys[] =
1473 {HELP_MENU,
1474 NULL_MENU,
1475 {"E", N_("Exit"), {MC_EXIT,1,{'e'}}, KS_EXITMODE},
1476 {"S", "[" N_("Select") "]", {MC_SELECT,3,{'s',ctrl('J'),ctrl('M')}}, KS_NONE},
1477 {"P", N_("Prev"), {MC_PREVITEM, 1, {'p'}}, KS_NONE},
1478 {"N", N_("Next"), {MC_NEXTITEM, 2, {'n', TAB}}, KS_NONE},
1479 PREVPAGE_MENU,
1480 NEXTPAGE_MENU,
1481 HOMEKEY_MENU,
1482 ENDKEY_MENU,
1483 PRYNTTXT_MENU,
1484 WHEREIS_MENU};
1485 INST_KEY_MENU(sel_from_list, sel_from_list_keys);
1488 struct key sel_from_list_keys_ctrlc[] =
1489 {HELP_MENU,
1490 NULL_MENU,
1491 {"^C", N_("exit"), {MC_EXIT,1,{ctrl('C')}}, KS_EXITMODE},
1492 {"S", "[" N_("Select") "]", {MC_SELECT,3,{'s',ctrl('J'),ctrl('M')}}, KS_NONE},
1493 {"P", N_("Prev"), {MC_PREVITEM, 1, {'p'}}, KS_NONE},
1494 {"N", N_("Next"), {MC_NEXTITEM, 2, {'n', TAB}}, KS_NONE},
1495 PREVPAGE_MENU,
1496 NEXTPAGE_MENU,
1497 HOMEKEY_MENU,
1498 ENDKEY_MENU,
1499 PRYNTTXT_MENU,
1500 WHEREIS_MENU};
1501 INST_KEY_MENU(sel_from_list_ctrlc, sel_from_list_keys_ctrlc);
1504 struct key sel_from_list_keys_sm[] =
1505 {HELP_MENU,
1506 OTHER_MENU,
1507 {"E", N_("Exit"), {MC_EXIT,1,{'e'}}, KS_EXITMODE},
1508 {"S", "[" N_("Select") "]", {MC_SELECT,3,{'s',ctrl('J'),ctrl('M')}}, KS_NONE},
1509 {"P", N_("Prev"), {MC_PREVITEM, 1, {'p'}}, KS_NONE},
1510 {"N", N_("Next"), {MC_NEXTITEM, 2, {'n', TAB}}, KS_NONE},
1511 PREVPAGE_MENU,
1512 NEXTPAGE_MENU,
1513 NULL_MENU,
1514 {"L",N_("ListMode"),{MC_LISTMODE,1,{'l'}},KS_NONE},
1515 PRYNTTXT_MENU,
1516 WHEREIS_MENU,
1518 HELP_MENU,
1519 OTHER_MENU,
1520 NULL_MENU,
1521 NULL_MENU,
1522 NULL_MENU,
1523 NULL_MENU,
1524 NULL_MENU,
1525 NULL_MENU,
1526 NULL_MENU,
1527 NULL_MENU,
1528 HOMEKEY_MENU,
1529 ENDKEY_MENU};
1530 INST_KEY_MENU(sel_from_list_sm, sel_from_list_keys_sm);
1533 struct key sel_from_list_keys_sm_ctrlc[] =
1534 {HELP_MENU,
1535 OTHER_MENU,
1536 {"^C", N_("exit"), {MC_EXIT,1,{ctrl('C')}}, KS_EXITMODE},
1537 {"S", "[" N_("Select") "]", {MC_SELECT,3,{'s',ctrl('J'),ctrl('M')}}, KS_NONE},
1538 {"P", N_("Prev"), {MC_PREVITEM, 1, {'p'}}, KS_NONE},
1539 {"N", N_("Next"), {MC_NEXTITEM, 2, {'n', TAB}}, KS_NONE},
1540 PREVPAGE_MENU,
1541 NEXTPAGE_MENU,
1542 NULL_MENU,
1543 {"L",N_("ListMode"),{MC_LISTMODE,1,{'l'}},KS_NONE},
1544 PRYNTTXT_MENU,
1545 WHEREIS_MENU,
1547 HELP_MENU,
1548 OTHER_MENU,
1549 NULL_MENU,
1550 NULL_MENU,
1551 NULL_MENU,
1552 NULL_MENU,
1553 NULL_MENU,
1554 NULL_MENU,
1555 NULL_MENU,
1556 NULL_MENU,
1557 HOMEKEY_MENU,
1558 ENDKEY_MENU};
1559 INST_KEY_MENU(sel_from_list_sm_ctrlc, sel_from_list_keys_sm_ctrlc);
1562 struct key sel_from_list_keys_lm[] =
1563 {HELP_MENU,
1564 OTHER_MENU,
1565 {"E", N_("Exit"), {MC_EXIT,1,{'e'}}, KS_EXITMODE},
1566 {"S", "[" N_("Select") "]", {MC_SELECT,3,{'s',ctrl('J'),ctrl('M')}}, KS_NONE},
1567 {"P", N_("Prev"), {MC_PREVITEM, 1, {'p'}}, KS_NONE},
1568 {"N", N_("Next"), {MC_NEXTITEM, 2, {'n', TAB}}, KS_NONE},
1569 PREVPAGE_MENU,
1570 NEXTPAGE_MENU,
1571 {"X", N_("Set/Unset"), {MC_TOGGLE,1,{'x'}}, KS_NONE},
1572 {"1",N_("SinglMode"),{MC_LISTMODE,1,{'1'}},KS_NONE},
1573 PRYNTTXT_MENU,
1574 WHEREIS_MENU,
1576 HELP_MENU,
1577 OTHER_MENU,
1578 NULL_MENU,
1579 NULL_MENU,
1580 NULL_MENU,
1581 NULL_MENU,
1582 NULL_MENU,
1583 NULL_MENU,
1584 NULL_MENU,
1585 NULL_MENU,
1586 HOMEKEY_MENU,
1587 ENDKEY_MENU};
1588 INST_KEY_MENU(sel_from_list_lm, sel_from_list_keys_lm);
1591 struct key sel_from_list_keys_lm_ctrlc[] =
1592 {HELP_MENU,
1593 OTHER_MENU,
1594 {"^C", N_("exit"), {MC_EXIT,1,{ctrl('C')}}, KS_EXITMODE},
1595 {"S", "[" N_("Select") "]", {MC_SELECT,3,{'s',ctrl('J'),ctrl('M')}}, KS_NONE},
1596 {"P", N_("Prev"), {MC_PREVITEM, 1, {'p'}}, KS_NONE},
1597 {"N", N_("Next"), {MC_NEXTITEM, 2, {'n', TAB}}, KS_NONE},
1598 PREVPAGE_MENU,
1599 NEXTPAGE_MENU,
1600 {"X", N_("Set/Unset"), {MC_TOGGLE,1,{'x'}}, KS_NONE},
1601 {"1",N_("SinglMode"),{MC_LISTMODE,1,{'1'}},KS_NONE},
1602 PRYNTTXT_MENU,
1603 WHEREIS_MENU,
1605 HELP_MENU,
1606 OTHER_MENU,
1607 NULL_MENU,
1608 NULL_MENU,
1609 NULL_MENU,
1610 NULL_MENU,
1611 NULL_MENU,
1612 NULL_MENU,
1613 NULL_MENU,
1614 NULL_MENU,
1615 HOMEKEY_MENU,
1616 ENDKEY_MENU};
1617 INST_KEY_MENU(sel_from_list_lm_ctrlc, sel_from_list_keys_lm_ctrlc);
1620 struct key sel_from_list_keys_olm[] =
1621 {HELP_MENU,
1622 OTHER_MENU,
1623 {"E", N_("Exit"), {MC_EXIT,1,{'e'}}, KS_EXITMODE},
1624 {"S", "[" N_("Select") "]", {MC_SELECT,3,{'s',ctrl('J'),ctrl('M')}}, KS_NONE},
1625 {"P", N_("Prev"), {MC_PREVITEM, 1, {'p'}}, KS_NONE},
1626 {"N", N_("Next"), {MC_NEXTITEM, 2, {'n', TAB}}, KS_NONE},
1627 PREVPAGE_MENU,
1628 NEXTPAGE_MENU,
1629 {"X", N_("Set/Unset"), {MC_TOGGLE,1,{'x'}}, KS_NONE},
1630 NULL_MENU,
1631 PRYNTTXT_MENU,
1632 WHEREIS_MENU,
1634 HELP_MENU,
1635 OTHER_MENU,
1636 NULL_MENU,
1637 NULL_MENU,
1638 NULL_MENU,
1639 NULL_MENU,
1640 NULL_MENU,
1641 NULL_MENU,
1642 NULL_MENU,
1643 NULL_MENU,
1644 HOMEKEY_MENU,
1645 ENDKEY_MENU};
1646 INST_KEY_MENU(sel_from_list_olm, sel_from_list_keys_olm);
1649 struct key sel_from_list_keys_olm_ctrlc[] =
1650 {HELP_MENU,
1651 OTHER_MENU,
1652 {"^C", N_("exit"), {MC_EXIT,1,{ctrl('C')}}, KS_EXITMODE},
1653 {"S", "[" N_("Select") "]", {MC_SELECT,3,{'s',ctrl('J'),ctrl('M')}}, KS_NONE},
1654 {"P", N_("Prev"), {MC_PREVITEM, 1, {'p'}}, KS_NONE},
1655 {"N", N_("Next"), {MC_NEXTITEM, 2, {'n', TAB}}, KS_NONE},
1656 PREVPAGE_MENU,
1657 NEXTPAGE_MENU,
1658 {"X", N_("Set/Unset"), {MC_TOGGLE,1,{'x'}}, KS_NONE},
1659 NULL_MENU,
1660 PRYNTTXT_MENU,
1661 WHEREIS_MENU,
1663 HELP_MENU,
1664 OTHER_MENU,
1665 NULL_MENU,
1666 NULL_MENU,
1667 NULL_MENU,
1668 NULL_MENU,
1669 NULL_MENU,
1670 NULL_MENU,
1671 NULL_MENU,
1672 NULL_MENU,
1673 HOMEKEY_MENU,
1674 ENDKEY_MENU};
1675 INST_KEY_MENU(sel_from_list_olm_ctrlc, sel_from_list_keys_olm_ctrlc);
1678 #ifndef DOS
1680 struct key printer_edit_keys[] =
1681 {HELP_MENU,
1682 PRYNTTXT_MENU,
1683 EXIT_SETUP_MENU,
1684 {"S", "[" N_("Select") "]", {MC_CHOICE,3,{'s',ctrl('M'),ctrl('J')}}, KS_NONE},
1685 PREV_MENU,
1686 NEXT_MENU,
1687 PREVPAGE_MENU,
1688 NEXTPAGE_MENU,
1689 /* TRANSLATORS: add a printer to configuration */
1690 {"A", N_("Add Printer"), {MC_ADD,1,{'a'}}, KS_NONE},
1691 /* TRANSLATORS: delete a printer from configuration */
1692 {"D", N_("DeletePrint"), {MC_DELETE,1,{'d'}}, KS_NONE},
1693 {"C", N_("Change"), {MC_EDIT,1,{'c'}}, KS_NONE},
1694 WHEREIS_MENU,
1696 HELP_MENU,
1697 OTHER_MENU,
1698 NULL_MENU,
1699 NULL_MENU,
1700 NULL_MENU,
1701 NULL_MENU,
1702 NULL_MENU,
1703 NULL_MENU,
1704 NULL_MENU,
1705 NULL_MENU,
1706 HOMEKEY_MENU,
1707 ENDKEY_MENU};
1708 INST_KEY_MENU(printer_edit_keymenu, printer_edit_keys);
1711 struct key printer_select_keys[] =
1712 {HELP_MENU,
1713 PRYNTTXT_MENU,
1714 EXIT_SETUP_MENU,
1715 {"S", "[" N_("Select") "]", {MC_CHOICE,3,{'s',ctrl('M'),ctrl('J')}}, KS_NONE},
1716 PREV_MENU,
1717 NEXT_MENU,
1718 PREVPAGE_MENU,
1719 NEXTPAGE_MENU,
1720 HOMEKEY_MENU,
1721 ENDKEY_MENU,
1722 NULL_MENU,
1723 WHEREIS_MENU};
1724 INST_KEY_MENU(printer_select_keymenu, printer_select_keys);
1726 #endif /* !DOS */
1729 struct key role_select_keys[] =
1730 {HELP_MENU,
1731 NULL_MENU,
1732 {"E", N_("Exit"), {MC_EXIT,1,{'e'}}, KS_EXITMODE},
1733 NULL_MENU,
1734 /* TRANSLATORS: go to previous Role in list */
1735 {"P", N_("PrevRole"), {MC_PREVITEM, 1, {'p'}}, KS_NONE},
1736 {"N", N_("NextRole"), {MC_NEXTITEM, 2, {'n', TAB}}, KS_NONE},
1737 PREVPAGE_MENU,
1738 NEXTPAGE_MENU,
1739 HOMEKEY_MENU,
1740 ENDKEY_MENU,
1741 {"D", "", {MC_TOGGLE, 1, {'d'}}, KS_NONE},
1742 WHEREIS_MENU};
1743 INST_KEY_MENU(role_select_km, role_select_keys);
1746 struct key role_config_keys[] =
1747 {HELP_MENU,
1748 OTHER_MENU,
1749 {"E", N_("Exit Setup"), {MC_EXIT,1,{'e'}}, KS_EXITMODE},
1750 {"C", "[" N_("Change") "]", {MC_EDIT,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE},
1751 /* TRANSLATORS: go to previous Rule in list */
1752 {"P", N_("PrevRule"), {MC_PREVITEM, 1, {'p'}}, KS_NONE},
1753 {"N", N_("NextRule"), {MC_NEXTITEM, 2, {'n', TAB}}, KS_NONE},
1754 PREVPAGE_MENU,
1755 NEXTPAGE_MENU,
1756 {"A", N_("Add"), {MC_ADD,1,{'a'}}, KS_NONE},
1757 {"D", N_("Delete"), {MC_DELETE,1,{'d'}}, KS_NONE},
1758 {"$", N_("Shuffle"), {MC_SHUFFLE,1,{'$'}}, KS_NONE},
1759 WHEREIS_MENU,
1761 HELP_MENU,
1762 OTHER_MENU,
1763 NULL_MENU,
1764 NULL_MENU,
1765 /* TRANSLATORS: Include a File from filesystem */
1766 {"I", N_("IncludeFile"), {MC_ADDFILE,1,{'i'}}, KS_NONE},
1767 {"X", N_("eXcludeFile"), {MC_DELFILE,1,{'x'}}, KS_NONE},
1768 NULL_MENU,
1769 NULL_MENU,
1770 {"R", N_("Replicate"), {MC_COPY,1,{'r'}}, KS_NONE},
1771 NULL_MENU,
1772 HOMEKEY_MENU,
1773 ENDKEY_MENU};
1774 INST_KEY_MENU(role_conf_km, role_config_keys);
1777 struct key config_text_wshuf_keys[] =
1778 {HELP_MENU,
1779 OTHER_MENU,
1780 EXIT_SETUP_MENU,
1781 {"C", "[" N_("Change Val") "]", {MC_EDIT,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE},
1782 PREV_MENU,
1783 NEXT_MENU,
1784 PREVPAGE_MENU,
1785 NEXTPAGE_MENU,
1786 {"A", N_("Add Value"), {MC_ADD,1,{'a'}}, KS_NONE},
1787 {"D", N_("Delete Val"), {MC_DELETE,1,{'d'}}, KS_NONE},
1788 PRYNTTXT_MENU,
1789 WHEREIS_MENU,
1791 HELP_MENU,
1792 OTHER_MENU,
1793 NULL_MENU,
1794 NULL_MENU,
1795 {"$", N_("Shuffle"), {MC_SHUFFLE,1,{'$'}}, KS_NONE},
1796 NULL_MENU,
1797 NULL_MENU,
1798 NULL_MENU,
1799 NULL_MENU,
1800 NULL_MENU,
1801 HOMEKEY_MENU,
1802 ENDKEY_MENU};
1803 INST_KEY_MENU(config_text_wshuf_keymenu, config_text_wshuf_keys);
1806 struct key config_text_wshufandfldr_keys[] =
1807 {HELP_MENU,
1808 OTHER_MENU,
1809 EXIT_SETUP_MENU,
1810 {"C", "[" N_("Change Val") "]", {MC_EDIT,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE},
1811 PREV_MENU,
1812 NEXT_MENU,
1813 PREVPAGE_MENU,
1814 NEXTPAGE_MENU,
1815 {"A", N_("Add Value"), {MC_ADD,1,{'a'}}, KS_NONE},
1816 {"D", N_("Delete Val"), {MC_DELETE,1,{'d'}}, KS_NONE},
1817 PRYNTTXT_MENU,
1818 WHEREIS_MENU,
1820 HELP_MENU,
1821 OTHER_MENU,
1822 NULL_MENU,
1823 NULL_MENU,
1824 {"$", N_("Shuffle"), {MC_SHUFFLE,1,{'$'}}, KS_NONE},
1825 {"T", N_("ToFldrs"), {MC_CHOICE,2,{'t', ctrl('T')}}, KS_NONE},
1826 NULL_MENU,
1827 NULL_MENU,
1828 NULL_MENU,
1829 NULL_MENU,
1830 HOMEKEY_MENU,
1831 ENDKEY_MENU};
1832 INST_KEY_MENU(config_text_wshufandfldr_keymenu, config_text_wshufandfldr_keys);
1835 struct key config_role_file_keys[] =
1836 {HELP_MENU,
1837 OTHER_MENU,
1838 EXIT_SETUP_MENU,
1839 {"C", "[" N_("Change Val") "]", {MC_EDIT,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE},
1840 PREV_MENU,
1841 NEXT_MENU,
1842 PREVPAGE_MENU,
1843 NEXTPAGE_MENU,
1844 {"A", N_("Add Value"), {MC_ADD,1,{'a'}}, KS_NONE},
1845 {"D", N_("Delete Val"), {MC_DELETE,1,{'d'}}, KS_NONE},
1846 PRYNTTXT_MENU,
1847 WHEREIS_MENU,
1849 HELP_MENU,
1850 OTHER_MENU,
1851 NULL_MENU,
1852 NULL_MENU,
1853 /* TRANSLATORS: go to list of Files */
1854 {"T", N_("ToFiles"), {MC_CHOICE, 2, {'t', ctrl('T')}}, KS_NONE},
1855 /* TRANSLATORS: edit a file */
1856 {"F", N_("editFile"), {MC_EDITFILE, 1, {'f'}}, KS_NONE},
1857 NULL_MENU,
1858 NULL_MENU,
1859 NULL_MENU,
1860 NULL_MENU,
1861 HOMEKEY_MENU,
1862 ENDKEY_MENU};
1863 INST_KEY_MENU(config_role_file_keymenu, config_role_file_keys);
1866 struct key config_role_file_res_keys[] =
1867 {HELP_MENU,
1868 OTHER_MENU,
1869 EXIT_SETUP_MENU,
1870 {"C", "[" N_("Change Val") "]", {MC_EDIT,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE},
1871 PREV_MENU,
1872 NEXT_MENU,
1873 PREVPAGE_MENU,
1874 NEXTPAGE_MENU,
1875 {"A", N_("Add Value"), {MC_ADD,1,{'a'}}, KS_NONE},
1876 {"D", N_("Delete Val"), {MC_DELETE,1,{'d'}}, KS_NONE},
1877 PRYNTTXT_MENU,
1878 WHEREIS_MENU,
1880 HELP_MENU,
1881 OTHER_MENU,
1882 NULL_MENU,
1883 NULL_MENU,
1884 {"T", N_("ToFiles"), {MC_CHOICE, 2, {'t', ctrl('T')}}, KS_NONE},
1885 NULL_MENU,
1886 NULL_MENU,
1887 NULL_MENU,
1888 NULL_MENU,
1889 NULL_MENU,
1890 HOMEKEY_MENU,
1891 ENDKEY_MENU};
1892 INST_KEY_MENU(config_role_file_res_keymenu, config_role_file_res_keys);
1895 struct key config_role_keyword_keys[] =
1896 {HELP_MENU,
1897 OTHER_MENU,
1898 EXIT_SETUP_MENU,
1899 {"C", "[" N_("Change Val") "]", {MC_EDIT,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE},
1900 PREV_MENU,
1901 NEXT_MENU,
1902 PREVPAGE_MENU,
1903 NEXTPAGE_MENU,
1904 {"A", N_("Add Value"), {MC_ADD,1,{'a'}}, KS_NONE},
1905 {"D", N_("Delete Val"), {MC_DELETE,1,{'d'}}, KS_NONE},
1906 PRYNTTXT_MENU,
1907 WHEREIS_MENU,
1909 HELP_MENU,
1910 OTHER_MENU,
1911 NULL_MENU,
1912 NULL_MENU,
1913 /* TRANSLATORS: go to list of keywords */
1914 {"T", N_("ToKeywords"), {MC_CHOICE, 2, {'t', ctrl('T')}}, KS_NONE},
1915 NULL_MENU,
1916 NULL_MENU,
1917 NULL_MENU,
1918 NULL_MENU,
1919 NULL_MENU,
1920 HOMEKEY_MENU,
1921 ENDKEY_MENU};
1922 INST_KEY_MENU(config_role_keyword_keymenu, config_role_keyword_keys);
1925 struct key config_role_keyword_keys_not[] =
1926 {HELP_MENU,
1927 OTHER_MENU,
1928 EXIT_SETUP_MENU,
1929 {"C", "[" N_("Change Val") "]", {MC_EDIT,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE},
1930 PREV_MENU,
1931 NEXT_MENU,
1932 PREVPAGE_MENU,
1933 NEXTPAGE_MENU,
1934 {"A", N_("Add Value"), {MC_ADD,1,{'a'}}, KS_NONE},
1935 {"D", N_("Delete Val"), {MC_DELETE,1,{'d'}}, KS_NONE},
1936 PRYNTTXT_MENU,
1937 WHEREIS_MENU,
1939 HELP_MENU,
1940 OTHER_MENU,
1941 NULL_MENU,
1942 NULL_MENU,
1943 {"T", N_("ToKeywords"), {MC_CHOICE, 2, {'t', ctrl('T')}}, KS_NONE},
1944 NULL_MENU,
1945 /* TRANSLATORS: toggle between NOT and not NOT, turn NOT on or off */
1946 {"!", N_("toggle NOT"), {MC_NOT,1,{'!'}}, KS_NONE},
1947 NULL_MENU,
1948 NULL_MENU,
1949 NULL_MENU,
1950 HOMEKEY_MENU,
1951 ENDKEY_MENU};
1952 INST_KEY_MENU(config_role_keyword_keymenu_not, config_role_keyword_keys_not);
1955 struct key config_role_charset_keys_not[] =
1956 {HELP_MENU,
1957 OTHER_MENU,
1958 EXIT_SETUP_MENU,
1959 {"C", "[" N_("Change Val") "]", {MC_EDIT,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE},
1960 PREV_MENU,
1961 NEXT_MENU,
1962 PREVPAGE_MENU,
1963 NEXTPAGE_MENU,
1964 {"A", N_("Add Value"), {MC_ADD,1,{'a'}}, KS_NONE},
1965 {"D", N_("Delete Val"), {MC_DELETE,1,{'d'}}, KS_NONE},
1966 PRYNTTXT_MENU,
1967 WHEREIS_MENU,
1969 HELP_MENU,
1970 OTHER_MENU,
1971 NULL_MENU,
1972 NULL_MENU,
1973 /* TRANSLATORS: go to list of character sets */
1974 {"T", N_("ToCharSets"), {MC_CHOICE, 2, {'t', ctrl('T')}}, KS_NONE},
1975 NULL_MENU,
1976 {"!", N_("toggle NOT"), {MC_NOT,1,{'!'}}, KS_NONE},
1977 NULL_MENU,
1978 NULL_MENU,
1979 NULL_MENU,
1980 HOMEKEY_MENU,
1981 ENDKEY_MENU};
1982 INST_KEY_MENU(config_role_charset_keymenu_not, config_role_charset_keys_not);
1985 struct key config_role_keys[] =
1986 {HELP_MENU,
1987 OTHER_MENU,
1988 EXIT_SETUP_MENU,
1989 {"C", "[" N_("Change Val") "]", {MC_EDIT,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE},
1990 PREV_MENU,
1991 NEXT_MENU,
1992 PREVPAGE_MENU,
1993 NEXTPAGE_MENU,
1994 {"A", N_("Add Value"), {MC_ADD,1,{'a'}}, KS_NONE},
1995 {"D", N_("Delete Val"), {MC_DELETE,1,{'d'}}, KS_NONE},
1996 PRYNTTXT_MENU,
1997 WHEREIS_MENU,
1999 HELP_MENU,
2000 OTHER_MENU,
2001 NULL_MENU,
2002 NULL_MENU,
2003 NULL_MENU,
2004 NULL_MENU,
2005 NULL_MENU,
2006 NULL_MENU,
2007 NULL_MENU,
2008 NULL_MENU,
2009 HOMEKEY_MENU,
2010 ENDKEY_MENU};
2011 INST_KEY_MENU(config_role_keymenu, config_role_keys);
2014 struct key config_role_keys_not[] =
2015 {HELP_MENU,
2016 OTHER_MENU,
2017 EXIT_SETUP_MENU,
2018 {"C", "[" N_("Change Val") "]", {MC_EDIT,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE},
2019 PREV_MENU,
2020 NEXT_MENU,
2021 PREVPAGE_MENU,
2022 NEXTPAGE_MENU,
2023 {"A", N_("Add Value"), {MC_ADD,1,{'a'}}, KS_NONE},
2024 {"D", N_("Delete Val"), {MC_DELETE,1,{'d'}}, KS_NONE},
2025 PRYNTTXT_MENU,
2026 WHEREIS_MENU,
2028 HELP_MENU,
2029 OTHER_MENU,
2030 NULL_MENU,
2031 NULL_MENU,
2032 NULL_MENU,
2033 /* TRANSLATORS: add extra headers to list */
2034 {"X", N_("eXtraHdr"), {MC_ADDHDR, 1, {'x'}}, KS_NONE},
2035 {"!", N_("toggle NOT"), {MC_NOT,1,{'!'}}, KS_NONE},
2036 NULL_MENU,
2037 NULL_MENU,
2038 NULL_MENU,
2039 HOMEKEY_MENU,
2040 ENDKEY_MENU};
2041 INST_KEY_MENU(config_role_keymenu_not, config_role_keys_not);
2044 struct key config_role_keys_extra[] =
2045 {HELP_MENU,
2046 NULL_MENU,
2047 EXIT_SETUP_MENU,
2048 {"X", "[" N_("eXtraHdr") "]", {MC_ADDHDR, 3,{'x',ctrl('M'),ctrl('J')}}, KS_NONE},
2049 PREV_MENU,
2050 NEXT_MENU,
2051 PREVPAGE_MENU,
2052 NEXTPAGE_MENU,
2053 HOMEKEY_MENU,
2054 ENDKEY_MENU,
2055 PRYNTTXT_MENU,
2056 WHEREIS_MENU};
2057 INST_KEY_MENU(config_role_keymenu_extra, config_role_keys_extra);
2060 struct key config_role_addr_pat_keys[] =
2061 {HELP_MENU,
2062 OTHER_MENU,
2063 EXIT_SETUP_MENU,
2064 {"C", "[" N_("Change Val") "]", {MC_EDIT,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE},
2065 PREV_MENU,
2066 NEXT_MENU,
2067 PREVPAGE_MENU,
2068 NEXTPAGE_MENU,
2069 {"A", N_("Add Value"), {MC_ADD,1,{'a'}}, KS_NONE},
2070 {"D", N_("Delete Val"), {MC_DELETE,1,{'d'}}, KS_NONE},
2071 PRYNTTXT_MENU,
2072 WHEREIS_MENU,
2074 HELP_MENU,
2075 OTHER_MENU,
2076 NULL_MENU,
2077 NULL_MENU,
2078 /* TRANSLATORS: go to address book to get address */
2079 {"T", N_("ToAddrBk"), {MC_CHOICEB, 2, {'t', ctrl('T')}}, KS_NONE},
2080 {"X", N_("eXtraHdr"), {MC_ADDHDR, 1, {'x'}}, KS_NONE},
2081 {"!", N_("toggle NOT"), {MC_NOT,1,{'!'}}, KS_NONE},
2082 NULL_MENU,
2083 NULL_MENU,
2084 NULL_MENU,
2085 HOMEKEY_MENU,
2086 ENDKEY_MENU};
2087 INST_KEY_MENU(config_role_addr_pat_keymenu, config_role_addr_pat_keys);
2090 struct key config_role_xtrahdr_keys[] =
2091 {HELP_MENU,
2092 OTHER_MENU,
2093 EXIT_SETUP_MENU,
2094 {"C", "[" N_("Change Val") "]", {MC_EDIT,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE},
2095 PREV_MENU,
2096 NEXT_MENU,
2097 PREVPAGE_MENU,
2098 NEXTPAGE_MENU,
2099 {"A", N_("Add Value"), {MC_ADD,1,{'a'}}, KS_NONE},
2100 {"D", N_("Delete Val"), {MC_DELETE,1,{'d'}}, KS_NONE},
2101 PRYNTTXT_MENU,
2102 WHEREIS_MENU,
2104 HELP_MENU,
2105 OTHER_MENU,
2106 NULL_MENU,
2107 NULL_MENU,
2108 NULL_MENU,
2109 {"X", N_("eXtraHdr"), {MC_ADDHDR, 1, {'x'}}, KS_NONE},
2110 {"!", N_("toggle NOT"), {MC_NOT,1,{'!'}}, KS_NONE},
2111 NULL_MENU,
2112 /* TRANSLATORS: remove a header we previously added */
2113 {"R", N_("RemoveHdr"), {MC_DELHDR, 1, {'r'}}, KS_NONE},
2114 NULL_MENU,
2115 HOMEKEY_MENU,
2116 ENDKEY_MENU};
2117 INST_KEY_MENU(config_role_xtrahdr_keymenu, config_role_xtrahdr_keys);
2120 struct key config_role_addr_act_keys[] =
2121 {HELP_MENU,
2122 OTHER_MENU,
2123 EXIT_SETUP_MENU,
2124 {"C", "[" N_("Change Val") "]", {MC_EDIT,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE},
2125 PREV_MENU,
2126 NEXT_MENU,
2127 PREVPAGE_MENU,
2128 NEXTPAGE_MENU,
2129 {"A", N_("Add Value"), {MC_ADD,1,{'a'}}, KS_NONE},
2130 {"D", N_("Delete Val"), {MC_DELETE,1,{'d'}}, KS_NONE},
2131 PRYNTTXT_MENU,
2132 WHEREIS_MENU,
2134 HELP_MENU,
2135 OTHER_MENU,
2136 NULL_MENU,
2137 NULL_MENU,
2138 {"T", N_("ToAddrBk"), {MC_CHOICEC, 2, {'t', ctrl('T')}}, KS_NONE},
2139 NULL_MENU,
2140 NULL_MENU,
2141 NULL_MENU,
2142 NULL_MENU,
2143 NULL_MENU,
2144 HOMEKEY_MENU,
2145 ENDKEY_MENU};
2146 INST_KEY_MENU(config_role_addr_act_keymenu, config_role_addr_act_keys);
2149 struct key config_role_patfolder_keys[] =
2150 {HELP_MENU,
2151 OTHER_MENU,
2152 EXIT_SETUP_MENU,
2153 {"C", "[" N_("Change Val") "]", {MC_EDIT,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE},
2154 PREV_MENU,
2155 NEXT_MENU,
2156 PREVPAGE_MENU,
2157 NEXTPAGE_MENU,
2158 {"A", N_("Add Value"), {MC_ADD,1,{'a'}}, KS_NONE},
2159 {"D", N_("Delete Val"), {MC_DELETE,1,{'d'}}, KS_NONE},
2160 PRYNTTXT_MENU,
2161 WHEREIS_MENU,
2163 HELP_MENU,
2164 OTHER_MENU,
2165 NULL_MENU,
2166 NULL_MENU,
2167 /* TRANSLATORS: go to list of folders */
2168 {"T", N_("ToFldrs"), {MC_CHOICED, 2, {'t', ctrl('T')}}, KS_NONE},
2169 NULL_MENU,
2170 NULL_MENU,
2171 NULL_MENU,
2172 NULL_MENU,
2173 NULL_MENU,
2174 HOMEKEY_MENU,
2175 ENDKEY_MENU};
2176 INST_KEY_MENU(config_role_patfolder_keymenu, config_role_patfolder_keys);
2179 struct key config_role_actionfolder_keys[] =
2180 {HELP_MENU,
2181 OTHER_MENU,
2182 EXIT_SETUP_MENU,
2183 {"C", "[" N_("Change Val") "]", {MC_EDIT,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE},
2184 PREV_MENU,
2185 NEXT_MENU,
2186 PREVPAGE_MENU,
2187 NEXTPAGE_MENU,
2188 {"A", N_("Add Value"), {MC_ADD,1,{'a'}}, KS_NONE},
2189 {"D", N_("Delete Val"), {MC_DELETE,1,{'d'}}, KS_NONE},
2190 PRYNTTXT_MENU,
2191 WHEREIS_MENU,
2193 HELP_MENU,
2194 OTHER_MENU,
2195 NULL_MENU,
2196 NULL_MENU,
2197 {"T", N_("ToFldrs"), {MC_CHOICEE, 2, {'t', ctrl('T')}}, KS_NONE},
2198 NULL_MENU,
2199 NULL_MENU,
2200 NULL_MENU,
2201 NULL_MENU,
2202 NULL_MENU,
2203 HOMEKEY_MENU,
2204 ENDKEY_MENU};
2205 INST_KEY_MENU(config_role_actionfolder_keymenu, config_role_actionfolder_keys);
2208 struct key config_role_inick_keys[] =
2209 {HELP_MENU,
2210 OTHER_MENU,
2211 EXIT_SETUP_MENU,
2212 {"C", "[" N_("Change Val") "]", {MC_EDIT,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE},
2213 PREV_MENU,
2214 NEXT_MENU,
2215 PREVPAGE_MENU,
2216 NEXTPAGE_MENU,
2217 {"A", N_("Add Value"), {MC_ADD,1,{'a'}}, KS_NONE},
2218 {"D", N_("Delete Val"), {MC_DELETE,1,{'d'}}, KS_NONE},
2219 PRYNTTXT_MENU,
2220 WHEREIS_MENU,
2222 HELP_MENU,
2223 OTHER_MENU,
2224 NULL_MENU,
2225 NULL_MENU,
2226 /* TRANSLATORS: go to list of nicknames */
2227 {"T", N_("ToNicks"), {MC_CHOICE, 2, {'t', ctrl('T')}}, KS_NONE},
2228 NULL_MENU,
2229 NULL_MENU,
2230 NULL_MENU,
2231 NULL_MENU,
2232 NULL_MENU,
2233 HOMEKEY_MENU,
2234 ENDKEY_MENU};
2235 INST_KEY_MENU(config_role_inick_keymenu, config_role_inick_keys);
2238 struct key config_role_afrom_keys[] =
2239 {HELP_MENU,
2240 OTHER_MENU,
2241 EXIT_SETUP_MENU,
2242 {"C", "[" N_("Change Val") "]", {MC_EDIT,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE},
2243 PREV_MENU,
2244 NEXT_MENU,
2245 PREVPAGE_MENU,
2246 NEXTPAGE_MENU,
2247 {"A", N_("Add Value"), {MC_ADD,1,{'a'}}, KS_NONE},
2248 {"D", N_("Delete Val"), {MC_DELETE,1,{'d'}}, KS_NONE},
2249 PRYNTTXT_MENU,
2250 WHEREIS_MENU,
2252 HELP_MENU,
2253 OTHER_MENU,
2254 NULL_MENU,
2255 NULL_MENU,
2256 /* TRANSLATORS: go to list of address books */
2257 {"T", N_("ToAbookList"), {MC_CHOICE, 2, {'t', ctrl('T')}}, KS_NONE},
2258 NULL_MENU,
2259 NULL_MENU,
2260 NULL_MENU,
2261 NULL_MENU,
2262 NULL_MENU,
2263 HOMEKEY_MENU,
2264 ENDKEY_MENU};
2265 INST_KEY_MENU(config_role_afrom_keymenu, config_role_afrom_keys);
2268 struct key config_checkbox_keys[] =
2269 {HELP_MENU,
2270 NULL_MENU,
2271 EXIT_SETUP_MENU,
2272 TOGGLE_MENU,
2273 PREV_MENU,
2274 NEXT_MENU,
2275 PREVPAGE_MENU,
2276 NEXTPAGE_MENU,
2277 HOMEKEY_MENU,
2278 ENDKEY_MENU,
2279 PRYNTTXT_MENU,
2280 WHEREIS_MENU};
2281 INST_KEY_MENU(config_checkbox_keymenu, config_checkbox_keys);
2284 struct key config_radiobutton_keys[] =
2285 {HELP_MENU,
2286 NULL_MENU,
2287 EXIT_SETUP_MENU,
2288 {"*", "[" N_("Select") "]", {MC_CHOICE,3,{'*',ctrl('M'),ctrl('J')}}, KS_NONE},
2289 PREV_MENU,
2290 NEXT_MENU,
2291 PREVPAGE_MENU,
2292 NEXTPAGE_MENU,
2293 HOMEKEY_MENU,
2294 ENDKEY_MENU,
2295 PRYNTTXT_MENU,
2296 WHEREIS_MENU};
2297 INST_KEY_MENU(config_radiobutton_keymenu, config_radiobutton_keys);
2300 struct key config_yesno_keys[] =
2301 {HELP_MENU,
2302 NULL_MENU,
2303 EXIT_SETUP_MENU,
2304 {"C", "[" N_("Change") "]", {MC_TOGGLE,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE},
2305 PREV_MENU,
2306 NEXT_MENU,
2307 PREVPAGE_MENU,
2308 NEXTPAGE_MENU,
2309 HOMEKEY_MENU,
2310 ENDKEY_MENU,
2311 PRYNTTXT_MENU,
2312 WHEREIS_MENU};
2313 INST_KEY_MENU(config_yesno_keymenu, config_yesno_keys);
2316 struct key color_changing_keys[] =
2317 {HELP_MENU,
2318 NULL_MENU,
2319 {"E", N_("To Colors"), {MC_EXIT,1,{'e'}}, KS_EXITMODE},
2320 {"*", "[" N_("Select") "]", {MC_CHOICE,3,{'*',ctrl('M'),ctrl('J')}}, KS_NONE},
2321 PREV_MENU,
2322 NEXT_MENU,
2323 PREVPAGE_MENU,
2324 NEXTPAGE_MENU,
2325 HOMEKEY_MENU,
2326 ENDKEY_MENU,
2327 PRYNTTXT_MENU,
2328 WHEREIS_MENU};
2329 INST_KEY_MENU(color_changing_keymenu, color_changing_keys);
2332 struct key custom_color_changing_keys[] =
2333 {HELP_MENU,
2334 NULL_MENU,
2335 /* TRANSLATORS: go to color configuration screen */
2336 {"E", N_("To Colors"), {MC_EXIT,1,{'e'}}, KS_EXITMODE},
2337 {"*", "[" N_("Select") "]", {MC_CHOICEB,3,{'*',ctrl('M'),ctrl('J')}}, KS_NONE},
2338 PREV_MENU,
2339 NEXT_MENU,
2340 PREVPAGE_MENU,
2341 NEXTPAGE_MENU,
2342 HOMEKEY_MENU,
2343 ENDKEY_MENU,
2344 PRYNTTXT_MENU,
2345 WHEREIS_MENU};
2346 INST_KEY_MENU(custom_color_changing_keymenu, custom_color_changing_keys);
2349 struct key kw_color_changing_keys[] =
2350 {HELP_MENU,
2351 NULL_MENU,
2352 {"E", N_("To Colors"), {MC_EXIT,1,{'e'}}, KS_EXITMODE},
2353 {"*", "[" N_("Select") "]", {MC_CHOICEC,3,{'*',ctrl('M'),ctrl('J')}}, KS_NONE},
2354 PREV_MENU,
2355 NEXT_MENU,
2356 PREVPAGE_MENU,
2357 NEXTPAGE_MENU,
2358 HOMEKEY_MENU,
2359 ENDKEY_MENU,
2360 PRYNTTXT_MENU,
2361 WHEREIS_MENU};
2362 INST_KEY_MENU(kw_color_changing_keymenu, kw_color_changing_keys);
2365 #ifdef _WINDOWS
2367 struct key color_rgb_changing_keys[] =
2368 {HELP_MENU,
2369 OTHER_MENU,
2370 {"E", N_("To Colors"), {MC_EXIT,1,{'e'}}, KS_EXITMODE},
2371 {"*", "[" N_("Select") "]", {MC_CHOICE,3,{'*',ctrl('M'),ctrl('J')}}, KS_NONE},
2372 PREV_MENU,
2373 NEXT_MENU,
2374 PREVPAGE_MENU,
2375 NEXTPAGE_MENU,
2376 {"C", N_("Customize"), {MC_RGB1,1,{'c'}},KS_NONE},
2377 NULL_MENU,
2378 PRYNTTXT_MENU,
2379 WHEREIS_MENU,
2381 HELP_MENU,
2382 OTHER_MENU,
2383 NULL_MENU,
2384 NULL_MENU,
2385 NULL_MENU,
2386 NULL_MENU,
2387 NULL_MENU,
2388 NULL_MENU,
2389 NULL_MENU,
2390 NULL_MENU,
2391 HOMEKEY_MENU,
2392 ENDKEY_MENU};
2393 INST_KEY_MENU(color_rgb_keymenu, color_rgb_changing_keys);
2396 struct key custom_rgb_changing_keys[] =
2397 {HELP_MENU,
2398 OTHER_MENU,
2399 {"E", N_("To Colors"), {MC_EXIT,1,{'e'}}, KS_EXITMODE},
2400 {"*", "[" N_("Select") "]", {MC_CHOICEB,3,{'*',ctrl('M'),ctrl('J')}}, KS_NONE},
2401 PREV_MENU,
2402 NEXT_MENU,
2403 PREVPAGE_MENU,
2404 NEXTPAGE_MENU,
2405 {"C", N_("Customize"), {MC_RGB2,1,{'c'}},KS_NONE},
2406 NULL_MENU,
2407 PRYNTTXT_MENU,
2408 WHEREIS_MENU,
2410 HELP_MENU,
2411 OTHER_MENU,
2412 NULL_MENU,
2413 NULL_MENU,
2414 NULL_MENU,
2415 NULL_MENU,
2416 NULL_MENU,
2417 NULL_MENU,
2418 NULL_MENU,
2419 NULL_MENU,
2420 HOMEKEY_MENU,
2421 ENDKEY_MENU};
2422 INST_KEY_MENU(custom_rgb_keymenu, custom_rgb_changing_keys);
2425 struct key kw_rgb_changing_keys[] =
2426 {HELP_MENU,
2427 OTHER_MENU,
2428 {"E", N_("To Colors"), {MC_EXIT,1,{'e'}}, KS_EXITMODE},
2429 {"*", "[" N_("Select") "]", {MC_CHOICEC,3,{'*',ctrl('M'),ctrl('J')}}, KS_NONE},
2430 PREV_MENU,
2431 NEXT_MENU,
2432 PREVPAGE_MENU,
2433 NEXTPAGE_MENU,
2434 {"C", N_("Customize"), {MC_RGB3,1,{'c'}},KS_NONE},
2435 NULL_MENU,
2436 PRYNTTXT_MENU,
2437 WHEREIS_MENU,
2439 HELP_MENU,
2440 OTHER_MENU,
2441 NULL_MENU,
2442 NULL_MENU,
2443 NULL_MENU,
2444 NULL_MENU,
2445 NULL_MENU,
2446 NULL_MENU,
2447 NULL_MENU,
2448 NULL_MENU,
2449 HOMEKEY_MENU,
2450 ENDKEY_MENU};
2451 INST_KEY_MENU(kw_rgb_keymenu, kw_rgb_changing_keys);
2453 #endif
2456 struct key color_setting_keys[] =
2457 {HELP_MENU,
2458 OTHER_MENU,
2459 EXIT_SETUP_MENU,
2460 {"C", "[" N_("Change") "]", {MC_EDIT,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE},
2461 PREV_MENU,
2462 NEXT_MENU,
2463 PREVPAGE_MENU,
2464 NEXTPAGE_MENU,
2465 {"A", N_("AddHeader"), {MC_ADD,1,{'a'}}, KS_NONE},
2466 /* TRANSLATORS: restore defaults */
2467 {"R", N_("RestoreDefs"), {MC_DEFAULT,1,{'r'}}, KS_NONE},
2468 PRYNTTXT_MENU,
2469 WHEREIS_MENU,
2471 HELP_MENU,
2472 OTHER_MENU,
2473 {"I", N_("IndxHdr"), {MC_ADDHEADER,1,{'i'}}, KS_NONE},
2474 NULL_MENU,
2475 NULL_MENU,
2476 NULL_MENU,
2477 NULL_MENU,
2478 NULL_MENU,
2479 NULL_MENU,
2480 NULL_MENU,
2481 HOMEKEY_MENU,
2482 ENDKEY_MENU};
2483 INST_KEY_MENU(color_setting_keymenu, color_setting_keys);
2486 struct key custom_color_setting_keys[] =
2487 {HELP_MENU,
2488 OTHER_MENU,
2489 EXIT_SETUP_MENU,
2490 {"C", "[" N_("Change") "]", {MC_EDIT,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE},
2491 PREV_MENU,
2492 NEXT_MENU,
2493 PREVPAGE_MENU,
2494 NEXTPAGE_MENU,
2495 {"A", N_("AddHeader"), {MC_ADD,1,{'a'}}, KS_NONE},
2496 {"R", N_("RestoreDefs"), {MC_DEFAULT,1,{'r'}}, KS_NONE},
2497 PRYNTTXT_MENU,
2498 WHEREIS_MENU,
2500 HELP_MENU,
2501 OTHER_MENU,
2502 {"I", N_("IndxHdr"), {MC_ADDHEADER,1,{'i'}}, KS_NONE},
2503 NULL_MENU,
2504 {"D", N_("DeleteHdr"), {MC_DELETE,1,{'d'}}, KS_NONE},
2505 /* TRANSLATORS: shuffle headers (change the order of headers) */
2506 {"$", N_("ShuffleHdr"), {MC_SHUFFLE,1,{'$'}}, KS_NONE},
2507 NULL_MENU,
2508 NULL_MENU,
2509 NULL_MENU,
2510 NULL_MENU,
2511 HOMEKEY_MENU,
2512 ENDKEY_MENU};
2513 INST_KEY_MENU(custom_color_setting_keymenu, custom_color_setting_keys);
2516 struct key role_color_setting_keys[] =
2517 {HELP_MENU,
2518 NULL_MENU,
2519 EXIT_SETUP_MENU,
2520 {"*", "[" N_("Select") "]", {MC_CHOICE,3,{'*',ctrl('M'),ctrl('J')}}, KS_NONE},
2521 PREV_MENU,
2522 NEXT_MENU,
2523 PREVPAGE_MENU,
2524 NEXTPAGE_MENU,
2525 HOMEKEY_MENU,
2526 ENDKEY_MENU,
2527 PRYNTTXT_MENU,
2528 WHEREIS_MENU};
2529 INST_KEY_MENU(role_color_setting_keymenu, role_color_setting_keys);
2532 struct key kw_color_setting_keys[] =
2533 {HELP_MENU,
2534 OTHER_MENU,
2535 EXIT_SETUP_MENU,
2536 {"C", "[" N_("Change") "]", {MC_EDIT,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE},
2537 PREV_MENU,
2538 NEXT_MENU,
2539 PREVPAGE_MENU,
2540 NEXTPAGE_MENU,
2541 {"A", N_("AddHeader"), {MC_ADD,1,{'a'}}, KS_NONE},
2542 {"R", N_("RestoreDefs"), {MC_DEFAULT,1,{'r'}}, KS_NONE},
2543 PRYNTTXT_MENU,
2544 WHEREIS_MENU,
2546 HELP_MENU,
2547 OTHER_MENU,
2548 {"I", N_("IndxHdr"), {MC_ADDHEADER,1,{'i'}}, KS_NONE},
2549 NULL_MENU,
2550 NULL_MENU,
2551 NULL_MENU,
2552 NULL_MENU,
2553 NULL_MENU,
2554 NULL_MENU,
2555 NULL_MENU,
2556 HOMEKEY_MENU,
2557 ENDKEY_MENU};
2558 INST_KEY_MENU(kw_color_setting_keymenu, kw_color_setting_keys);
2561 struct key take_export_keys_sm[] =
2562 {HELP_MENU,
2563 WHEREIS_MENU,
2564 /* TRANSLATORS: exit the Take Address screen */
2565 {"<",N_("ExitTake"), {MC_EXIT,4,{'e',ctrl('C'),'<',','}}, KS_EXITMODE},
2566 {"T","[" N_("Take") "]",{MC_TAKE,3,{'t',ctrl('M'),ctrl('J')}}, KS_NONE},
2567 PREV_MENU,
2568 NEXT_MENU,
2569 PREVPAGE_MENU,
2570 NEXTPAGE_MENU,
2571 NULL_MENU,
2572 NULL_MENU,
2573 NULL_MENU,
2574 {"L",N_("ListMode"),{MC_LISTMODE,1,{'l'}},KS_NONE}};
2575 INST_KEY_MENU(take_export_keymenu_sm, take_export_keys_sm);
2578 struct key take_export_keys_lm[] =
2579 {HELP_MENU,
2580 WHEREIS_MENU,
2581 {"<",N_("ExitTake"), {MC_EXIT,4,{'e',ctrl('C'),'<',','}}, KS_EXITMODE},
2582 {"T",N_("Take"), {MC_TAKE,1,{'t'}}, KS_NONE},
2583 PREV_MENU,
2584 NEXT_MENU,
2585 PREVPAGE_MENU,
2586 NEXTPAGE_MENU,
2587 {"X","[" N_("Set/Unset") "]", {MC_CHOICE,3,{'x',ctrl('M'),ctrl('J')}}, KS_NONE},
2588 {"A", N_("SetAll"),{MC_SELALL,1,{'a'}},KS_NONE},
2589 {"U",N_("UnSetAll"),{MC_UNSELALL,1,{'u'}},KS_NONE},
2590 {"S",N_("SinglMode"),{MC_LISTMODE,1,{'s'}},KS_NONE}};
2591 INST_KEY_MENU(take_export_keymenu_lm, take_export_keys_lm);
2594 struct key smime_info_keys[] =
2595 {HELP_MENU,
2596 OTHER_MENU,
2597 {"<","Back",{MC_VIEW_TEXT,2,{'<',','}},KS_EXITMODE},
2598 NULL_MENU,
2599 NULL_MENU,
2600 NULL_MENU,
2601 PREVPAGE_MENU,
2602 NEXTPAGE_MENU,
2603 NULL_MENU,
2604 NULL_MENU,
2605 NULL_MENU,
2606 NULL_MENU,
2608 HELP_MENU,
2609 OTHER_MENU,
2610 MAIN_MENU,
2611 QUIT_MENU,
2612 NULL_MENU,
2613 NULL_MENU,
2614 NULL_MENU,
2615 NULL_MENU,
2616 NULL_MENU,
2617 INDEX_MENU,
2618 NULL_MENU,
2619 NULL_MENU};
2620 INST_KEY_MENU(smime_info_keymenu, smime_info_keys);
2623 struct key config_smime_helper_keys[] =
2624 {HELP_MENU,
2625 WHEREIS_MENU,
2626 EXIT_SETUP_MENU,
2627 {"T","[" N_("Transfer") "]", {MC_CHOICE,3,{'t',ctrl('M'),ctrl('J')}}, KS_NONE},
2628 PREV_MENU,
2629 NEXT_MENU,
2630 PREVPAGE_MENU,
2631 NEXTPAGE_MENU,
2632 NULL_MENU,
2633 NULL_MENU,
2634 HOMEKEY_MENU,
2635 ENDKEY_MENU};
2636 INST_KEY_MENU(config_smime_helper_keymenu, config_smime_helper_keys);
2638 struct key config_smime_manage_certs_menu_keys[] =
2639 {HELP_MENU,
2640 WHEREIS_MENU,
2641 EXIT_SETUP_MENU,
2642 {"S", "[" N_("Select") "]", {MC_CHOICE,3,{'s',ctrl('M'),ctrl('J')}}, KS_NONE},
2643 {"I", N_("Import Cert"), {MC_IMPORT,1,{'i'}}, KS_NONE},
2644 NULL_MENU,
2645 PREV_MENU,
2646 NEXT_MENU,
2647 PREVPAGE_MENU,
2648 NEXTPAGE_MENU,
2649 HOMEKEY_MENU,
2650 ENDKEY_MENU};
2651 INST_KEY_MENU(config_smime_manage_certs_menu_keymenu, config_smime_manage_certs_menu_keys);
2653 struct key config_smime_add_certs_keys[] =
2654 {HELP_MENU,
2655 NULL_MENU,
2656 EXIT_SETUP_MENU,
2657 {"I", N_("Import Cert"), {MC_IMPORT,3,{'i', ctrl('M'), ctrl('J')}}, KS_NONE},
2658 NULL_MENU,
2659 NULL_MENU,
2660 NULL_MENU,
2661 NULL_MENU,
2662 NULL_MENU,
2663 NULL_MENU,
2664 NULL_MENU,
2665 NULL_MENU};
2666 INST_KEY_MENU(config_smime_add_certs_keymenu, config_smime_add_certs_keys);
2668 struct key config_smime_add_new_key[] =
2669 {HELP_MENU,
2670 NULL_MENU,
2671 EXIT_SETUP_MENU,
2672 {"I", N_("Import Key"), {MC_IMPORT,3,{'i', ctrl('M'), ctrl('J')}}, KS_NONE},
2673 {"C", N_("Create Key"), {MC_ADD,1,{'c'}}, KS_NONE},
2674 NULL_MENU,
2675 NULL_MENU,
2676 NULL_MENU,
2677 NULL_MENU,
2678 NULL_MENU,
2679 NULL_MENU,
2680 NULL_MENU};
2681 INST_KEY_MENU(config_smime_add_new_key_keymenu, config_smime_add_new_key);
2683 struct key config_smime_manage_certs_work_keys[] =
2684 {HELP_MENU,
2685 OTHER_MENU,
2686 EXIT_SETUP_MENU,
2687 {"V", "[" N_("View Info") "]", {MC_CHOICE,3,{'v',ctrl('M'),ctrl('J')}}, KS_NONE},
2688 {"I", N_("Import Cert"), {MC_IMPORT,1,{'i'}}, KS_NONE},
2689 NULL_MENU,
2690 {"D", N_("Delete"), {MC_DELETE,1,{'d'}}, KS_NONE},
2691 {"U", N_("Undelete"), {MC_UNDELETE,1,{'u'}}, KS_NONE},
2692 {"X", N_("Expunge"), {MC_EXPUNGE,1,{'x'}}, KS_NONE},
2693 NULL_MENU,
2694 NULL_MENU,
2695 WHEREIS_MENU,
2697 PREV_MENU,
2698 NEXT_MENU,
2699 PREVPAGE_MENU,
2700 NEXTPAGE_MENU,
2701 NULL_MENU,
2702 NULL_MENU,
2703 NULL_MENU,
2704 NULL_MENU,
2705 NULL_MENU,
2706 NULL_MENU,
2707 HOMEKEY_MENU,
2708 ENDKEY_MENU};
2709 INST_KEY_MENU(config_smime_manage_certs_work_keymenu, config_smime_manage_certs_work_keys);
2711 struct key config_smime_view_cert[] =
2712 {HELP_MENU,
2713 OTHER_MENU,
2714 EXIT_SETUP_MENU,
2715 {"V", "[" N_("View Info") "]", {MC_CHOICE,3,{'v',ctrl('M'),ctrl('J')}}, KS_NONE},
2716 NULL_MENU,
2717 NULL_MENU,
2718 NULL_MENU,
2719 NULL_MENU,
2720 NULL_MENU,
2721 NULL_MENU,
2722 NULL_MENU,
2723 NULL_MENU};
2724 INST_KEY_MENU(config_smime_manage_view_cert_keymenu, config_smime_view_cert);
2726 struct key smime_certificate_info_keys[] =
2727 {HELP_MENU,
2728 OTHER_MENU,
2729 {"E",N_("Exit Viewer"),{MC_EXIT,1,{'e'}},KS_EXITMODE},
2730 {"T",N_("Trust Cert"), {MC_TRUST,1,{'t'}},KS_NONE},
2731 {"D",N_("Delete"), {MC_DELETE,1,{'d'}},KS_NONE},
2732 {"U",N_("Undelete"), {MC_UNDELETE,1,{'u'}},KS_NONE},
2733 {"B",N_("Public Key"), {MC_PUBLIC,1,{'b'}},KS_NONE},
2734 {"R",N_("Private Key"),{MC_PRIVATE,1,{'r'}},KS_NONE},
2735 NULL_MENU,
2736 NULL_MENU,
2737 NULL_MENU,
2738 NULL_MENU,
2740 HELP_MENU,
2741 OTHER_MENU,
2742 PREVPAGE_MENU,
2743 NEXTPAGE_MENU,
2744 PRYNTTXT_MENU,
2745 WHEREIS_MENU,
2746 NULL_MENU,
2747 NULL_MENU,
2748 NULL_MENU,
2749 NULL_MENU,
2750 HOMEKEY_MENU,
2751 ENDKEY_MENU};
2752 INST_KEY_MENU(smime_certificate_info_keymenu, smime_certificate_info_keys);
2755 struct key config_smime_manage_password_file_menu_keys[] =
2756 {HELP_MENU,
2757 WHEREIS_MENU,
2758 EXIT_SETUP_MENU,
2759 {"S", "[" N_("Select") "]", {MC_CHOICE,3,{'s',ctrl('M'),ctrl('J')}}, KS_NONE},
2760 {"I", N_("Import Cert"), {MC_IMPORT,1,{'i'}}, KS_NONE},
2761 NULL_MENU,
2762 PREV_MENU,
2763 NEXT_MENU,
2764 PREVPAGE_MENU,
2765 NEXTPAGE_MENU,
2766 HOMEKEY_MENU,
2767 ENDKEY_MENU};
2768 INST_KEY_MENU(config_smime_manage_password_file_menu_keymenu, config_smime_manage_password_file_menu_keys);
2773 * Internal prototypes
2775 void output_keymenu(struct key_menu *, bitmap_t, int, int);
2776 void format_keymenu(struct key_menu *, bitmap_t, int);
2777 void menu_clear_cmd_binding(struct key_menu *, int);
2778 #ifdef MOUSE
2779 void print_inverted_label(int, MENUITEM *);
2780 #endif
2783 /* Saved key menu drawing state */
2784 static struct {
2785 struct key_menu *km;
2786 int row,
2787 column,
2788 blanked;
2789 bitmap_t bitmap;
2790 } km_state;
2794 * Longest label that can be displayed in keymenu
2796 #define MAX_LABEL 40
2797 #define MAX_KEYNAME 3
2798 static struct key last_time_buf[12];
2799 static int keymenu_is_dirty = 1;
2801 void
2802 mark_keymenu_dirty(void)
2804 keymenu_is_dirty = 1;
2809 * Write an already formatted key_menu to the screen
2811 * Args: km -- key_menu structure
2812 * bm -- bitmap, 0's mean don't draw this key
2813 * row -- the row on the screen to begin on, negative values
2814 * are counted from the bottom of the screen up
2815 * column -- column on the screen to begin on
2817 * The bits in the bitmap are used from least significant to most significant,
2818 * not left to right. So, if you write out the bitmap in the normal way, for
2819 * example,
2820 * bm[0] = 0x5, bm[1] = 0x8, bm[2] = 0x21, bm[3] = bm[4] = bm[5] = 0
2821 * 0000 0101 0000 1000 0010 0001 ...
2822 * means that menu item 0 (first row, first column) is set, item 1 (2nd row,
2823 * first column) is not set, item 2 is set, items 3-10 are not set, item 11
2824 * (2nd row, 6th and last column) is set. In the second menu (the second set
2825 * of 12 bits) items 0-3 are unset, 4 is set, 5-8 unset, 9 set, 10-11 unset.
2826 * That uses up bm[0] - bm[2].
2827 * Just to make sure, here it is drawn out for the first set of 12 items in
2828 * the first keymenu (0-11)
2829 * bm[0] x x x x x x x x bm[1] x x x x x x x x
2830 * 7 6 5 4 3 2 1 0 1110 9 8
2832 void
2833 output_keymenu(struct key_menu *km, unsigned char *bm, int row, int column)
2835 #ifdef __CYGWIN__
2836 extern char term_name[];
2837 #endif
2838 register struct key *k;
2839 struct key *last_time;
2840 int i, j,
2841 ufk, /* using function keys */
2842 real_row,
2843 max_column, /* number of columns on screen */
2844 off; /* offset into keymap */
2845 struct variable *vars = ps_global->vars;
2846 COLOR_PAIR *lastc=NULL, *label_color=NULL, *name_color=NULL;
2847 #ifdef MOUSE
2848 /* 6's are for UTF-8 */
2849 char keystr[6*MAX_KEYNAME + 6*MAX_LABEL + 2];
2850 #endif
2852 off = km->which * 12;
2853 max_column = ps_global->ttyo->screen_cols;
2855 if((ps_global->ttyo->screen_rows - FOOTER_ROWS(ps_global)) < 0
2856 || max_column <= 0){
2857 keymenu_is_dirty = 1;
2858 return;
2862 real_row = row > 0 ? row : ps_global->ttyo->screen_rows + row;
2864 if(pico_usingcolor()){
2865 lastc = pico_get_cur_color();
2866 if(lastc && VAR_KEYLABEL_FORE_COLOR && VAR_KEYLABEL_BACK_COLOR &&
2867 pico_is_good_color(VAR_KEYLABEL_FORE_COLOR) &&
2868 pico_is_good_color(VAR_KEYLABEL_BACK_COLOR)){
2869 label_color = new_color_pair(VAR_KEYLABEL_FORE_COLOR,
2870 VAR_KEYLABEL_BACK_COLOR);
2871 if(label_color)
2872 (void)pico_set_colorp(label_color, PSC_NONE);
2875 if(label_color && VAR_KEYNAME_FORE_COLOR && VAR_KEYNAME_BACK_COLOR &&
2876 pico_is_good_color(VAR_KEYNAME_FORE_COLOR) &&
2877 pico_is_good_color(VAR_KEYNAME_BACK_COLOR)){
2878 name_color = new_color_pair(VAR_KEYNAME_FORE_COLOR,
2879 VAR_KEYNAME_BACK_COLOR);
2883 if(keymenu_is_dirty){
2884 ClearLines(real_row, real_row+1);
2885 keymenu_is_dirty = 0;
2886 /* first time through, set up storage */
2887 if(!last_time_buf[0].name){
2888 for(i = 0; i < 12; i++){
2889 last_time = &last_time_buf[i];
2890 last_time->name = (char *) fs_get(6*MAX_KEYNAME + 1);
2891 last_time->label = (char *) fs_get(6*MAX_LABEL + 1);
2895 for(i = 0; i < 12; i++)
2896 last_time_buf[i].column = -1;
2899 for(i = 0; i < 12; i++){
2900 int e;
2902 e = off + i;
2903 dprint((9, "%2d %-7.7s %-10.10s %d\n", i,
2904 km == NULL ? "(no km)"
2905 : km->keys[e].name == NULL ? "(null)"
2906 : km->keys[e].name,
2907 km == NULL ? "(no km)"
2908 : km->keys[e].label == NULL ? "(null)"
2909 : km->keys[e].label, km ? km->keys[e].column : 0));
2910 #ifdef MOUSE
2911 register_key(i, NO_OP_COMMAND, "", NULL, 0, 0, 0, NULL, NULL);
2912 #endif
2915 ufk = F_ON(F_USE_FK, ps_global);
2916 dprint((9, "row: %d, real_row: %d, column: %d\n", row,
2917 real_row, column));
2919 for(i = 0; i < 2; i++){
2920 int c, el, empty, fkey, last_in_row, fix_start;
2921 short next_col;
2922 char temp[6*MAX_SCREEN_COLS+1];
2923 char temp2[6*MAX_SCREEN_COLS+1];
2924 char this_label[6*MAX_LABEL+1];
2926 j = 6*i - 1;
2927 #ifndef __CYGWIN__
2928 if(i == 1 && !label_color)
2929 #else
2930 if(i == 1 && (!label_color || !struncmp(term_name,"cygwin", 6)))
2931 #endif
2932 max_column--; /* Some terminals scroll if you write in the
2933 lower right hand corner. If user has a
2934 label_color set we'll take our chances.
2935 Otherwise, we'd get one cell of Normal. */
2938 * k is the key struct we're working on
2939 * c is the column number
2940 * el is an index into the whole keys array
2941 * Last_time_buf is ordered strangely. It goes row by row instead
2942 * of down each column like km does. J is an index into it.
2944 for(c = 0, el = off+i, k = &km->keys[el];
2945 k < &km->keys[off+12] && c < max_column;
2946 k += 2, el += 2){
2948 if(k->column > max_column)
2949 break;
2951 j++;
2952 if(ufk)
2953 fkey = 1 + k - &km->keys[off];
2955 empty = (!bitnset(el,bm) || !(k->name && *k->name));
2956 last_time = &last_time_buf[j];
2957 if(k+2 < &km->keys[off+12]){
2958 last_in_row = 0;
2959 next_col = last_time_buf[j+1].column;
2960 fix_start = (k == &km->keys[off] ||
2961 k == &km->keys[off+1]) ? k->column : 0;
2963 else{
2964 last_in_row = 1;
2965 fix_start = 0;
2969 * Make sure there is a space between this label and
2970 * the next name. That is, we prefer a space to the
2971 * extra character of the label because the space
2972 * separates the commands and looks nicer.
2974 if(k->label){
2975 size_t l;
2976 char tmp_label[6*MAX_LABEL+1];
2978 if(k->label[0] == '[' && k->label[(l=strlen(k->label))-1] == ']' && l > 2){
2980 * Can't write in k->label, which might be a constant array.
2982 strncpy(tmp_label, &k->label[1], MIN(sizeof(tmp_label),l-2));
2983 tmp_label[MIN(sizeof(tmp_label)-1,l-2)] = '\0';
2985 snprintf(this_label, sizeof(this_label), "[%s]", _(tmp_label));
2987 else
2988 strncpy(this_label, _(k->label), sizeof(this_label));
2990 this_label[sizeof(this_label)-1] = '\0';
2991 if(!last_in_row){
2992 int trunc;
2994 trunc = (k+2)->column - k->column
2995 - ((k->name ? utf8_width(k->name) : 0) + 1);
2997 * trunc columns available for label but we don't want the label
2998 * to go all the way to the edge
3000 if(utf8_width(this_label) >= trunc){
3001 if(trunc > 1){
3002 strncpy(tmp_label, this_label, sizeof(tmp_label));
3003 tmp_label[sizeof(tmp_label)-1] = '\0';
3004 l = utf8_pad_to_width(this_label, tmp_label, sizeof(this_label)-2, trunc-1, 1);
3005 this_label[l++] = SPACE;
3006 this_label[l] = '\0';;
3008 else if(trunc == 1)
3009 this_label[0] = SPACE;
3010 else
3011 this_label[0] = '\0';
3013 this_label[sizeof(this_label)-1] = '\0';
3017 else
3018 this_label[0] = '\0';
3020 if(!(k->column == last_time->column
3021 && (last_in_row || (k+2)->column <= next_col)
3022 && ((empty && !*last_time->label && !*last_time->name)
3023 || (!empty
3024 && this_label && !strcmp(this_label,last_time->label)
3025 && ((k->name && !strcmp(k->name,last_time->name))
3026 || ufk))))){
3027 if(empty){
3028 /* blank out key with spaces */
3029 strncpy(temp, repeat_char(
3030 ((last_in_row || (k+2)->column > max_column)
3031 ? max_column
3032 : (k+2)->column) -
3033 (fix_start
3035 : k->column),
3036 SPACE), sizeof(temp));
3037 temp[sizeof(temp)-1] = '\0';
3038 last_time->column = k->column;
3039 *last_time->name = '\0';
3040 *last_time->label = '\0';
3041 MoveCursor(real_row + i, column + (fix_start ? 0 : k->column));
3042 Write_to_screen(temp);
3043 c = (fix_start ? 0 : k->column) + strlen(temp);
3045 else{
3046 /* make sure extra space before key name is there */
3047 if(fix_start){
3048 strncpy(temp, repeat_char(k->column, SPACE), sizeof(temp));
3049 temp[sizeof(temp)-1] = '\0';
3050 MoveCursor(real_row + i, column + 0);
3051 Write_to_screen(temp);
3054 /* short name of the key */
3055 if(ufk)
3056 snprintf(temp, sizeof(temp), "F%d", fkey);
3057 else
3058 strncpy(temp, k->name, sizeof(temp));
3060 temp[sizeof(temp)-1] = '\0';
3061 last_time->column = k->column;
3062 strncpy(last_time->name, temp, 6*MAX_KEYNAME);
3063 last_time->name[6*MAX_KEYNAME] = '\0';
3064 /* make sure name not too long */
3065 #ifdef MOUSE
3066 strncpy(keystr, temp, sizeof(keystr));
3067 keystr[sizeof(keystr)-1] = '\0';
3068 #endif
3069 MoveCursor(real_row + i, column + k->column);
3070 if(!empty){
3071 if(name_color)
3072 (void)pico_set_colorp(name_color, PSC_NONE);
3073 else
3074 StartInverse();
3077 Write_to_screen(temp);
3078 c = k->column + utf8_width(temp);
3079 if(!empty){
3080 if(!name_color)
3081 EndInverse();
3084 /* now the space after the name and the label */
3085 temp[0] = '\0';
3086 if(c < max_column){
3087 temp[0] = SPACE;
3088 temp[1] = '\0';
3089 strncat(temp, this_label, sizeof(temp)-strlen(temp)-1);
3091 /* Don't run over the right hand edge */
3092 if(utf8_width(temp) > max_column - c){
3093 size_t l;
3095 l = utf8_pad_to_width(temp2, temp, sizeof(temp2)-1, max_column-c, 1);
3096 temp2[l] = '\0';
3097 strncpy(temp, temp2, sizeof(temp));
3098 temp[sizeof(temp)-1] = '\0';
3101 c += utf8_width(temp);
3104 #ifdef MOUSE
3105 strncat(keystr, temp, sizeof(keystr)-strlen(keystr)-1);
3106 keystr[sizeof(keystr)-1] = '\0';
3107 #endif
3108 /* fill out rest of this key with spaces */
3109 if(c < max_column){
3110 if(last_in_row){
3111 strncat(temp, repeat_char(max_column - c, SPACE), sizeof(temp)-strlen(temp)-1);
3112 c = max_column;
3114 else{
3115 if(c < (k+2)->column){
3116 strncat(temp,
3117 repeat_char((k+2)->column - c, SPACE), sizeof(temp)-strlen(temp)-1);
3118 c = (k+2)->column;
3122 temp[sizeof(temp)-1] = '\0';
3125 strncpy(last_time->label, this_label, 6*MAX_LABEL);
3126 last_time->label[6*MAX_LABEL] = '\0';
3127 if(label_color)
3128 (void)pico_set_colorp(label_color, PSC_NONE);
3130 Write_to_screen(temp);
3133 #ifdef MOUSE
3134 else if(!empty)
3135 /* fill in what register_key needs from cached data */
3136 snprintf(keystr, sizeof(keystr), "%s %s", last_time->name, last_time->label);
3138 if(!empty){
3139 int len;
3142 * If label ends in space,
3143 * don't register the space part of label.
3145 len = strlen(keystr);
3146 while(keystr[len-1] == SPACE)
3147 len--;
3148 len--;
3150 register_key(j, ufk ? PF1 + fkey - 1
3151 : (k->name[0] == '^')
3152 ? ctrl(k->name[1])
3153 : (!strucmp(k->name, "ret"))
3154 ? ctrl('M')
3155 : (!strucmp(k->name, "tab"))
3156 ? '\t'
3157 : (!strucmp(k->name, "spc"))
3158 ? SPACE
3159 : (!strucmp(k->name, HISTORY_UP_KEYNAME))
3160 ? KEY_UP
3161 : (!strucmp(k->name, HISTORY_DOWN_KEYNAME))
3162 ? KEY_DOWN
3163 : (k->bind.nch)
3164 ? ((isascii((int) k->bind.ch[0]) && islower((int) k->bind.ch[0]))
3165 ? toupper((unsigned char) k->bind.ch[0])
3166 : k->bind.ch[0])
3167 : k->name[0],
3168 keystr, print_inverted_label,
3169 real_row+i, k->column, len,
3170 name_color, label_color);
3172 #endif
3176 while(++j < 6*(i+1))
3177 last_time_buf[j].column = -1;
3180 fflush(stdout);
3181 if(lastc){
3182 (void)pico_set_colorp(lastc, PSC_NONE);
3183 free_color_pair(&lastc);
3184 if(label_color)
3185 free_color_pair(&label_color);
3186 if(name_color)
3187 free_color_pair(&name_color);
3193 * Clear the key menu lines.
3195 void
3196 blank_keymenu(int row, int column)
3198 struct variable *vars = ps_global->vars;
3199 COLOR_PAIR *lastc;
3201 if(FOOTER_ROWS(ps_global) > 1){
3202 km_state.blanked = 1;
3203 km_state.row = row;
3204 km_state.column = column;
3205 MoveCursor(row, column);
3206 lastc = pico_set_colors(VAR_KEYLABEL_FORE_COLOR,
3207 VAR_KEYLABEL_BACK_COLOR, PSC_NORM|PSC_RET);
3209 CleartoEOLN();
3210 MoveCursor(row+1, column);
3211 CleartoEOLN();
3212 fflush(stdout);
3213 if(lastc){
3214 (void)pico_set_colorp(lastc, PSC_NONE);
3215 free_color_pair(&lastc);
3221 void
3222 draw_cancel_keymenu(void)
3224 bitmap_t bitmap;
3226 setbitmap(bitmap);
3227 draw_keymenu(&cancel_keymenu, bitmap, ps_global->ttyo->screen_cols,
3228 1-FOOTER_ROWS(ps_global), 0, FirstMenu);
3232 void
3233 clearfooter(struct pine *ps)
3235 ClearLines(ps->ttyo->screen_rows - 3, ps->ttyo->screen_rows - 1);
3236 mark_keymenu_dirty();
3237 mark_status_unknown();
3242 * Calculate formatting for key menu at bottom of screen
3244 * Args: km -- The key_menu structure to format
3245 * bm -- Bitmap indicating which menu items should be displayed. If
3246 * an item is NULL, that also means it shouldn't be displayed.
3247 * Sometimes the bitmap will be turned on in that case and just
3248 * rely on the NULL entry.
3249 * width -- the screen width to format it at
3251 * If already formatted for this particular screen width and the requested
3252 * bitmap and formatted bitmap agree, return.
3254 * The formatting results in the column field in the key_menu being
3255 * filled in. The column field is the column to start the label at, the
3256 * name of the key; after that is the label for the key. The basic idea
3257 * is to line up the end of the names and beginning of the labels. If
3258 * the name is too long and shifting it left would run into previous
3259 * label, then shift the whole menu right, or at least that entry if
3260 * things following are short enough to fit back into the regular
3261 * spacing. This has to be calculated and not fixed so it can cope with
3262 * screen resize.
3264 void
3265 format_keymenu(struct key_menu *km, unsigned char *bm, int width)
3267 int spacing[7], w[6], min_w[6], tw[6], extra[6], ufk, i, set;
3269 /* already formatted? */
3270 if(!km || (width == km->width &&
3271 km->how_many <= km->formatted_hm &&
3272 !memcmp(km->bitmap, bm, BM_SIZE)))
3273 return;
3276 * If we're in the initial command sequence we may be using function
3277 * keys instead of alphas, or vice versa, so we want to recalculate
3278 * the formatting next time through.
3280 if((F_ON(F_USE_FK,ps_global) && ps_global->orig_use_fkeys) ||
3281 (F_OFF(F_USE_FK,ps_global) && !ps_global->orig_use_fkeys)){
3282 km->width = width;
3283 km->formatted_hm = km->how_many;
3284 memcpy(km->bitmap, bm, BM_SIZE);
3287 ufk = F_ON(F_USE_FK,ps_global); /* ufk = "Using Function Keys" */
3289 /* set up "ideal" columns to start in, plus fake 7th column start */
3290 for(i = 0; i < 7; i++)
3291 spacing[i] = (i * width) / 6;
3293 /* Loop thru each set of 12 menus */
3294 for(set = 0; set < km->how_many; set++){
3295 int k_top, k_bot, top_name_width, bot_name_width,
3296 top_label_width, bot_label_width, done, offset, next_one;
3297 struct key *keytop, *keybot;
3299 offset = set * 12; /* offset into keymenu */
3302 * Find the required widths for each box.
3304 for(i = 0; i < 6; i++){
3305 k_top = offset + i*2;
3306 k_bot = k_top + 1;
3307 keytop = &km->keys[k_top];
3308 keybot = &km->keys[k_bot];
3311 * The width of a box is the max width of top or bottom name,
3312 * plus 1 space, plus the max width of top or bottom label.
3314 * ? HelpInfo
3315 * ^C Cancel
3316 * ||||||||||| = 2 + 1 + 8 = 11
3318 * Then we adjust that by adding one space after the box to
3319 * separate it from the next box. The last box doesn't need that
3320 * but we may need an extra space for last box to avoid putting
3321 * a character in the lower right hand cell of display.
3322 * We also have a minimum label width (if screen is really narrow)
3323 * of 3, so at least "Hel" and "Can" shows and the rest gets
3324 * truncated off right hand side.
3327 top_name_width = (keytop->name && bitnset(k_top,bm))
3328 ? (ufk ? (i >= 5 ? 3 : 2)
3329 : utf8_width(keytop->name)) : 0;
3330 bot_name_width = (keybot->name && bitnset(k_bot,bm))
3331 ? (ufk ? (i >= 4 ? 3 : 2)
3332 : utf8_width(keybot->name)) : 0;
3334 * Labels are complicated by the fact that we want to look
3335 * up their translation, but also by the fact that we surround
3336 * the word with brackets like [ViewMsg] when the command is
3337 * the default. We want to look up the translation of the
3338 * part inside the brackets, not the whole thing.
3340 if(keytop->label && bitnset(k_top,bm)){
3341 char tmp_label[6*MAX_LABEL+1];
3342 size_t l;
3344 if(keytop->label[0] == '[' && keytop->label[(l=strlen(keytop->label))-1] == ']' && l > 2){
3346 * Can't write in k->label, which might be a constant array.
3348 strncpy(tmp_label, &keytop->label[1], MIN(sizeof(tmp_label),l-2));
3349 tmp_label[MIN(sizeof(tmp_label)-1,l-2)] = '\0';
3351 top_label_width = 2 + utf8_width(_(tmp_label));
3353 else
3354 top_label_width = utf8_width(_(keytop->label));
3356 else
3357 top_label_width = 0;
3359 if(keybot->label && bitnset(k_bot,bm)){
3360 char tmp_label[6*MAX_LABEL+1];
3361 size_t l;
3363 if(keybot->label[0] == '[' && keybot->label[(l=strlen(keybot->label))-1] == ']' && l > 2){
3364 strncpy(tmp_label, &keybot->label[1], MIN(sizeof(tmp_label),l-2));
3365 tmp_label[MIN(sizeof(tmp_label)-1,l-2)] = '\0';
3367 bot_label_width = 2 + utf8_width(_(tmp_label));
3369 else
3370 bot_label_width = utf8_width(_(keybot->label));
3372 else
3373 bot_label_width = 0;
3376 * The 1 for i < 5 is the space between adjacent boxes.
3377 * The last 1 or 0 when i == 5 is so that we won't try to put
3378 * a character in the lower right cell of the display, since that
3379 * causes a linefeed on some terminals.
3381 w[i] = MAX(top_name_width, bot_name_width) + 1 +
3382 MAX(top_label_width, bot_label_width) +
3383 ((i < 5) ? 1
3384 : ((bot_label_width >= top_label_width) ? 1 : 0));
3387 * The smallest we'll squeeze a column.
3389 * X ABCDEF we'll squeeze to X ABC
3390 * YZ GHIJ YZ GHI
3392 min_w[i] = MAX(top_name_width, bot_name_width) + 1 +
3393 MIN(MAX(top_label_width, bot_label_width), 3) +
3394 ((i < 5) ? 1
3395 : ((bot_label_width >= top_label_width) ? 1 : 0));
3397 /* init trial width */
3398 tw[i] = spacing[i+1] - spacing[i];
3399 extra[i] = tw[i] - w[i]; /* negative if it doesn't fit */
3403 * See if we can fit everything on the screen.
3405 done = 0;
3406 while(!done){
3407 int smallest_extra, how_small;
3409 /* Find smallest extra */
3410 smallest_extra = -1;
3411 how_small = 100;
3412 for(i = 0; i < 6; i++){
3413 if(extra[i] < how_small){
3414 smallest_extra = i;
3415 how_small = extra[i];
3419 if(how_small >= 0) /* everything fits */
3420 done++;
3421 else{
3422 int take_from, how_close;
3425 * Find the one that is closest to the ideal width
3426 * that has some extra to spare.
3428 take_from = -1;
3429 how_close = 100;
3430 for(i = 0; i < 6; i++){
3431 if(extra[i] > 0 &&
3432 ((spacing[i+1]-spacing[i]) - tw[i]) < how_close){
3433 take_from = i;
3434 how_close = (spacing[i+1]-spacing[i]) - tw[i];
3438 if(take_from >= 0){
3440 * Found one. Take one from take_from and add it
3441 * to the smallest_extra.
3443 tw[smallest_extra]++;
3444 extra[smallest_extra]++;
3445 tw[take_from]--;
3446 extra[take_from]--;
3448 else{
3449 int used_width;
3452 * Oops. Not enough space to fit everything in.
3453 * Some of the labels are truncated. Some may even be
3454 * truncated past the minimum. We make sure that each
3455 * field is at least its minimum size, and then we cut
3456 * back those over the minimum until we can fit all the
3457 * minimal names on the screen (if possible).
3459 for(i = 0; i < 6; i++)
3460 tw[i] = MAX(tw[i], min_w[i]);
3462 used_width = 0;
3463 for(i = 0; i < 6; i++)
3464 used_width += tw[i];
3466 while(used_width > width && !done){
3467 int candidate, excess;
3470 * Find the one with the most width over it's
3471 * minimum width.
3473 candidate = -1;
3474 excess = -100;
3475 for(i = 0; i < 6; i++){
3476 if(tw[i] - min_w[i] > excess){
3477 candidate = i;
3478 excess = tw[i] - min_w[i];
3482 if(excess > 0){
3483 tw[candidate]--;
3484 used_width--;
3486 else
3487 done++;
3490 done++;
3496 * Assign the format we came up with to the keymenu.
3498 next_one = 0;
3499 for(i = 0; i < 6; i++){
3500 k_top = offset + i*2;
3501 k_bot = k_top + 1;
3502 keytop = &km->keys[k_top];
3503 keybot = &km->keys[k_bot];
3504 top_name_width = (keytop->name && bitnset(k_top,bm))
3505 ? (ufk ? (i >= 5 ? 3 : 2)
3506 : utf8_width(keytop->name)) : 0;
3507 bot_name_width = (keybot->name && bitnset(k_bot,bm))
3508 ? (ufk ? (i >= 4 ? 3 : 2)
3509 : utf8_width(keybot->name)) : 0;
3511 if(top_name_width >= bot_name_width){
3512 keytop->column = next_one;
3513 keybot->column = next_one + (top_name_width - bot_name_width);
3515 else{
3516 keytop->column = next_one + (bot_name_width - top_name_width);
3517 keybot->column = next_one;
3520 next_one += tw[i];
3527 * Draw the key menu at bottom of screen
3529 * Args: km -- key_menu structure
3530 * bitmap -- which fields are active
3531 * width -- the screen width to format it at
3532 * row -- where to put it
3533 * column -- where to put it
3534 * what -- this is an enum telling us whether to display the
3535 * first menu (first set of 12 keys), or to display the same
3536 * one we displayed last time, or to display a particular
3537 * one (which), or to display the next one.
3539 * Fields are inactive if *either* the corresponding bitmap entry is 0 *or*
3540 * the actual entry in the key_menu is NULL. Therefore, it is sometimes
3541 * useful to just turn on all the bits in a bitmap and let the NULLs take
3542 * care of it. On the other hand, the bitmap gives a convenient method
3543 * for turning some keys on or off dynamically or due to options.
3544 * Both methods are used about equally.
3546 * Also saves the state for a possible redraw later.
3548 * Row should usually be a negative number. If row is 0, the menu is not
3549 * drawn.
3551 void
3552 draw_keymenu(struct key_menu *km, unsigned char *bitmap, int width, int row,
3553 int column, OtherMenu what)
3555 #ifdef _WINDOWS
3556 configure_menu_items (km, bitmap);
3557 #endif
3558 format_keymenu(km, bitmap, width);
3560 /*--- save state for a possible redraw ---*/
3561 km_state.km = km;
3562 km_state.row = row;
3563 km_state.column = column;
3564 memcpy(km_state.bitmap, bitmap, BM_SIZE);
3566 if(row == 0)
3567 return;
3569 if(km_state.blanked)
3570 keymenu_is_dirty = 1;
3572 if(what == FirstMenu || what == SecondMenu || what == ThirdMenu ||
3573 what == FourthMenu || what == MenuNotSet){
3574 if(what == FirstMenu || what == MenuNotSet)
3575 km->which = 0;
3576 else if(what == SecondMenu)
3577 km->which = 1;
3578 else if(what == ThirdMenu)
3579 km->which = 2;
3580 else if(what == FourthMenu)
3581 km->which = 3;
3583 if(km->which >= km->how_many)
3584 km->which = 0;
3586 else if(what == NextMenu)
3587 km->which = (km->which + 1) % km->how_many;
3588 /* else what must be SameMenu */
3590 output_keymenu(km, bitmap, row, column);
3592 km_state.blanked = 0;
3596 void
3597 redraw_keymenu(void)
3599 if(km_state.blanked)
3600 blank_keymenu(km_state.row, km_state.column);
3601 else
3602 draw_keymenu(km_state.km, km_state.bitmap, ps_global->ttyo->screen_cols,
3603 km_state.row, km_state.column, SameMenu);
3608 * end_keymenu - free resources associated with keymenu display cache
3610 void
3611 end_keymenu(void)
3613 int i;
3615 for(i = 0; i < 12; i++){
3616 if(last_time_buf[i].name)
3617 fs_give((void **) &last_time_buf[i].name);
3619 if(last_time_buf[i].label)
3620 fs_give((void **) &last_time_buf[i].label);
3625 /*----------------------------------------------------------------------
3626 Reveal Keymenu to Pine Command mappings
3628 Args:
3630 ----*/
3632 menu_command(UCS keystroke, struct key_menu *menu)
3634 int i, n;
3636 if(keystroke == KEY_UTF8 || keystroke == KEY_UNKNOWN)
3637 return(MC_UTF8);
3639 if(!menu)
3640 return(MC_UNKNOWN);
3642 if(F_ON(F_USE_FK,ps_global)){
3643 /* No alpha commands permitted in function key mode */
3644 if(keystroke < 0x80 && isalpha((unsigned char) keystroke))
3645 return(MC_UNKNOWN);
3647 /* Tres simple: compute offset, and test */
3648 if(keystroke >= F1 && keystroke <= F12){
3649 n = (menu->which * 12) + (keystroke - F1);
3650 if(bitnset(n, menu->bitmap))
3651 return(menu->keys[n].bind.cmd);
3654 else if(keystroke >= F1 && keystroke <= F12)
3655 return(MC_UNKNOWN);
3657 /* if ascii, coerce lower case */
3658 if(keystroke < 0x80 && isupper((unsigned char) keystroke))
3659 keystroke = tolower((unsigned char) keystroke);
3661 /* keep this here for Windows port */
3662 if((keystroke = validatekeys(keystroke)) == KEY_JUNK)
3663 return(MC_UNKNOWN);
3665 /* Scan the list for any keystroke/command binding */
3666 if(keystroke != NO_OP_COMMAND)
3667 for(i = (menu->how_many * 12) - 1; i >= 0; i--)
3668 if(bitnset(i, menu->bitmap))
3669 for(n = menu->keys[i].bind.nch - 1; n >= 0; n--)
3670 if(keystroke == menu->keys[i].bind.ch[n])
3671 return(menu->keys[i].bind.cmd);
3674 * If explicit mapping failed, check feature mappings and
3675 * hardwired defaults...
3677 if(F_ON(F_ENABLE_PRYNT,ps_global)
3678 && (keystroke == 'y' || keystroke == 'Y')){
3679 /* SPECIAL CASE: Scan the list for print bindings */
3680 for(i = (menu->how_many * 12) - 1; i >= 0; i--)
3681 if(bitnset(i, menu->bitmap))
3682 if(menu->keys[i].bind.cmd == MC_PRINTMSG
3683 || menu->keys[i].bind.cmd == MC_PRINTTXT)
3684 return(menu->keys[i].bind.cmd);
3687 if(F_ON(F_ENABLE_LESSTHAN_EXIT,ps_global)
3688 && (keystroke == '<' || keystroke == ','
3689 || (F_ON(F_ARROW_NAV,ps_global) && keystroke == KEY_LEFT))){
3690 /* SPECIAL CASE: Scan the list for MC_EXIT bindings */
3691 for(i = (menu->how_many * 12) - 1; i >= 0; i--)
3692 if(bitnset(i, menu->bitmap))
3693 if(menu->keys[i].bind.cmd == MC_EXIT)
3694 return(MC_EXIT);
3698 * If no match after scanning bindings, try universally
3699 * bound keystrokes...
3701 switch(keystroke){
3702 case KEY_MOUSE :
3703 return(MC_MOUSE);
3705 case ctrl('P') :
3706 case KEY_UP :
3707 return(MC_CHARUP);
3709 case ctrl('N') :
3710 case KEY_DOWN :
3711 return(MC_CHARDOWN);
3713 case ctrl('F') :
3714 case KEY_RIGHT :
3715 return(MC_CHARRIGHT);
3717 case ctrl('B') :
3718 case KEY_LEFT :
3719 return(MC_CHARLEFT);
3721 case ctrl('A') :
3722 return(MC_GOTOBOL);
3724 case ctrl('E') :
3725 return(MC_GOTOEOL);
3727 case ctrl('L') :
3728 return(MC_REPAINT);
3730 case KEY_RESIZE :
3731 return(MC_RESIZE);
3733 case NO_OP_IDLE:
3734 case NO_OP_COMMAND:
3735 if(USER_INPUT_TIMEOUT(ps_global))
3736 user_input_timeout_exit(ps_global->hours_to_timeout); /* no return */
3738 return(MC_NONE);
3740 default :
3741 break;
3744 return(MC_UNKNOWN); /* utter failure */
3749 /*----------------------------------------------------------------------
3750 Set up a binding for cmd, with one key bound to it.
3751 Use menu_add_binding to add more keys to this binding.
3753 Args: menu -- the keymenu
3754 key -- the initial key to bind to
3755 cmd -- the command to initialize to
3756 name -- a pointer to the string to point name to
3757 label -- a pointer to the string to point label to
3758 keynum -- which key in the keys array to initialize
3760 For translation purposes, the label in the calling routine
3761 should be wrapped in an N_() macro.
3763 ----*/
3764 void
3765 menu_init_binding(struct key_menu *menu, UCS key, int cmd, char *name, char *label, int keynum)
3767 /* if ascii, coerce to lower case */
3768 if(key < 0x80 && isupper((unsigned char)key))
3769 key = tolower((unsigned char)key);
3771 /* remove binding from any other key */
3772 menu_clear_cmd_binding(menu, cmd);
3774 menu->keys[keynum].name = name;
3775 menu->keys[keynum].label = label;
3776 menu->keys[keynum].bind.cmd = cmd;
3777 menu->keys[keynum].bind.nch = 0;
3778 menu->keys[keynum].bind.ch[menu->keys[keynum].bind.nch++] = key;
3782 /*----------------------------------------------------------------------
3783 Add a key/command binding to the given keymenu structure
3785 Args:
3787 ----*/
3788 void
3789 menu_add_binding(struct key_menu *menu, UCS key, int cmd)
3791 int i, n;
3793 /* NOTE: cmd *MUST* already have had a binding */
3794 for(i = (menu->how_many * 12) - 1; i >= 0; i--)
3795 if(menu->keys[i].bind.cmd == cmd){
3796 for(n = menu->keys[i].bind.nch - 1;
3797 n >= 0 && key != menu->keys[i].bind.ch[n];
3798 n--)
3801 /* if ascii, coerce to lower case */
3802 if(key < 0x80 && isupper((unsigned char)key))
3803 key = tolower((unsigned char)key);
3805 if(n < 0) /* not already bound, bind it */
3806 menu->keys[i].bind.ch[menu->keys[i].bind.nch++] = key;
3808 break;
3813 /*----------------------------------------------------------------------
3814 REMOVE a key/command binding from the given keymenu structure
3816 Args:
3818 ----*/
3820 menu_clear_binding(struct key_menu *menu, UCS key)
3822 int i, n;
3824 /* if ascii, coerce to lower case */
3825 if(key < 0x80 && isupper((unsigned char)key))
3826 key = tolower((unsigned char)key);
3828 for(i = (menu->how_many * 12) - 1; i >= 0; i--)
3829 for(n = menu->keys[i].bind.nch - 1; n >= 0; n--)
3830 if(key == menu->keys[i].bind.ch[n]){
3831 int cmd = menu->keys[i].bind.cmd;
3833 for(--menu->keys[i].bind.nch; n < menu->keys[i].bind.nch; n++)
3834 menu->keys[i].bind.ch[n] = menu->keys[i].bind.ch[n+1];
3836 return(cmd);
3839 return(MC_UNKNOWN);
3843 void
3844 menu_clear_cmd_binding(struct key_menu *menu, int cmd)
3846 int i;
3848 for(i = (menu->how_many * 12) - 1; i >= 0; i--){
3849 if(cmd == menu->keys[i].bind.cmd){
3850 menu->keys[i].name = NULL;
3851 menu->keys[i].label = NULL;
3852 menu->keys[i].bind.cmd = 0;
3853 menu->keys[i].bind.nch = 0;
3854 menu->keys[i].bind.ch[0] = 0;
3861 menu_binding_index(struct key_menu *menu, int cmd)
3863 int i;
3865 for(i = 0; i < menu->how_many * 12; i++)
3866 if(cmd == menu->keys[i].bind.cmd)
3867 return(i);
3869 return(-1);
3873 #ifdef MOUSE
3875 * print_inverted_label - highlight the label of the given menu item.
3876 * (callback from pico mouse routines)
3878 * So far, this is only
3879 * ever called with the top left row equal to the bottom right row.
3880 * If you change that you probably need to fix it.
3882 void
3883 print_inverted_label(int state, MENUITEM *m)
3885 unsigned i, j, k;
3886 int col_offsetwid, col_offsetchars, do_color = 0, skipwid = 0, skipchars = 0, len, c;
3887 char prename[100];
3888 char namepart[100];
3889 char labelpart[100];
3890 char *lp, *label;
3891 COLOR_PAIR *name_color = NULL, *label_color = NULL, *lastc = NULL;
3892 struct variable *vars = ps_global->vars;
3894 if(m->label && (lp=strchr(m->label, ' '))){
3895 char save;
3897 save = *lp;
3898 *lp = '\0';
3899 col_offsetwid = utf8_width(m->label);
3900 col_offsetchars = lp - m->label;
3901 *lp = save;
3903 else
3904 col_offsetwid = col_offsetchars = 0;
3906 if(pico_usingcolor() && ((VAR_KEYLABEL_FORE_COLOR &&
3907 VAR_KEYLABEL_BACK_COLOR) ||
3908 (VAR_KEYNAME_FORE_COLOR &&
3909 VAR_KEYNAME_BACK_COLOR))){
3910 lastc = pico_get_cur_color();
3912 if(VAR_KEYNAME_FORE_COLOR && VAR_KEYNAME_BACK_COLOR){
3913 name_color = state ? new_color_pair(VAR_KEYNAME_BACK_COLOR,
3914 VAR_KEYNAME_FORE_COLOR)
3915 : new_color_pair(VAR_KEYNAME_FORE_COLOR,
3916 VAR_KEYNAME_BACK_COLOR);
3918 else if(VAR_REV_FORE_COLOR && VAR_REV_BACK_COLOR)
3919 name_color = new_color_pair(VAR_REV_FORE_COLOR, VAR_REV_BACK_COLOR);
3921 if(VAR_KEYLABEL_FORE_COLOR && VAR_KEYLABEL_BACK_COLOR){
3922 label_color = state ? new_color_pair(VAR_KEYLABEL_BACK_COLOR,
3923 VAR_KEYLABEL_FORE_COLOR)
3924 : new_color_pair(VAR_KEYLABEL_FORE_COLOR,
3925 VAR_KEYLABEL_BACK_COLOR);
3927 else if(VAR_REV_FORE_COLOR && VAR_REV_BACK_COLOR){
3928 label_color = state ? new_color_pair(VAR_REV_FORE_COLOR,
3929 VAR_REV_BACK_COLOR)
3930 : new_color_pair(VAR_NORM_FORE_COLOR,
3931 VAR_NORM_BACK_COLOR);
3935 * See if we can grok all these colors. If not, we're going to
3936 * punt and pretend there are no colors at all.
3938 if(!pico_is_good_colorpair(name_color) ||
3939 !pico_is_good_colorpair(label_color)){
3940 if(name_color)
3941 free_color_pair(&name_color);
3942 if(label_color)
3943 free_color_pair(&label_color);
3944 if(lastc)
3945 free_color_pair(&lastc);
3947 else{
3948 do_color++;
3949 (void)pico_set_colorp(label_color, PSC_NONE);
3950 if(!(VAR_KEYLABEL_FORE_COLOR && VAR_KEYLABEL_BACK_COLOR)){
3951 if(state)
3952 StartInverse();
3953 else
3954 EndInverse();
3959 if(!do_color){
3961 * Command name's already inverted, leave it.
3963 skipwid = state ? 0 : col_offsetwid;
3964 skipchars = state ? 0 : col_offsetchars;
3965 if(state)
3966 StartInverse();
3967 else
3968 EndInverse();
3971 MoveCursor((int)(m->tl.r), (int)(m->tl.c) + skipwid);
3973 label = m->label ? m->label : "";
3974 len = strlen(label);
3977 * this is a bit complicated by the fact that we have to keep track of
3978 * the screenwidth as we print the label, because the screenwidth might
3979 * not be the same as the number of characters.
3980 * UNTESTED SINCE switching to UTF-8 *
3982 for(i = m->tl.r; i <= m->br.r; i++){
3983 /* collect part before name */
3984 for(k=0, j = m->tl.c + skipchars; j < MIN(m->lbl.c,m->br.c); j++){
3985 if(k < sizeof(prename))
3986 prename[k++] = ' ';
3989 if(k < sizeof(prename))
3990 prename[k] = '\0';
3992 /* collect name part */
3993 for(k=0; j < MIN(m->lbl.c+col_offsetchars,m->br.c); j++){
3994 c = (i == m->lbl.r &&
3995 j - m->lbl.c < len) ? label[j - m->lbl.c] : ' ';
3996 if(k < sizeof(namepart))
3997 namepart[k++] = c;
4000 if(k < sizeof(namepart))
4001 namepart[k] = '\0';
4003 /* collect label part */
4004 for(k=0; j <= m->br.c; j++){
4005 c = (i == m->lbl.r &&
4006 j - m->lbl.c < len) ? label[j - m->lbl.c] : ' ';
4007 if(k < sizeof(labelpart))
4008 labelpart[k++] = c;
4011 if(k < sizeof(labelpart))
4012 labelpart[k] = '\0';
4015 if(prename)
4016 Write_to_screen(prename);
4018 if(namepart){
4019 if(name_color && col_offsetchars)
4020 (void) pico_set_colorp(name_color, PSC_NONE);
4022 Write_to_screen(namepart);
4025 if(labelpart){
4026 if(name_color && col_offsetchars){
4027 if(label_color)
4028 (void) pico_set_colorp(label_color, PSC_NONE);
4029 else{
4030 if(state)
4031 StartInverse();
4032 else
4033 EndInverse();
4037 Write_to_screen(labelpart);
4040 if(do_color){
4041 if(lastc){
4042 (void)pico_set_colorp(lastc, PSC_NONE);
4043 free_color_pair(&lastc);
4045 else if(state)
4046 EndInverse();
4047 else
4048 pico_set_normal_color();
4050 if(name_color)
4051 free_color_pair(&name_color);
4052 if(label_color)
4053 free_color_pair(&label_color);
4055 else{
4056 if(state)
4057 EndInverse();
4060 #endif /* MOUSE */
4063 #ifdef _WINDOWS
4065 * This function scans the key menu and calls mswin.c functions
4066 * to build a corresponding windows menu.
4068 void
4069 configure_menu_items (struct key_menu *km, bitmap_t bitmap)
4071 int i;
4072 struct key *k;
4073 UCS key;
4075 mswin_menuitemclear ();
4077 if(!km)
4078 return;
4080 for (i = 0, k = km->keys ; i < km->how_many * 12; i++, k++) {
4081 if (k->name != NULL && k->label != NULL && bitnset (i, bitmap) &&
4082 k->menuitem != KS_NONE) {
4084 if (k->name[0] == '^')
4085 key = ctrl(k->name[1]);
4086 else if (strcmp(k->name, "Ret") == 0)
4087 key = '\r';
4088 else if (strcmp(k->name, "Spc") == 0)
4089 key = ' ';
4090 else
4091 key = k->name[0];
4093 mswin_menuitemadd (key, k->label, k->menuitem, 0);
4097 #endif