2 * ========================================================================
3 * Copyright 2013-2022 Eduardo Chappa
4 * Copyright 2006-2008 University of Washington
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * ========================================================================
20 #include "../pith/bitmap.h"
21 #include "../pith/conf.h"
22 #include "../pith/state.h"
26 * We put all of the keymenu definitions here so that it is easy to
27 * share them. The names are in keymenu.h, as well. Some of these
28 * aren't easily shareable because we modify them dynamically but
29 * here they are anyway. It's not altogether clear that this is a good idea.
30 * Perhaps it would be better to just define the keymenus multiple times
31 * in different source files even though they are the same, with static
34 * The key numbers are sometimes used symbolically, like OTHER_KEY. Those
35 * are in keymenu.h, too, and are hard to use. If you change a menu here
36 * be sure to check those key numbers that go with it in keymenu.h.
40 void configure_menu_items (struct key_menu
*, bitmap_t
);
45 * Macro to simplify instantiation of key_menu structs from key structs
47 #define INST_KEY_MENU(X, Y) struct key_menu X = \
48 {sizeof(Y)/(sizeof(Y[0])*12), 0, 0, Y}
50 struct key cancel_keys
[] =
52 {"^C",N_("Cancel"),{MC_NONE
},KS_NONE
},
63 INST_KEY_MENU(cancel_keymenu
, cancel_keys
);
67 * A bunch of these are NULL_MENU because we want to change them dynamically.
69 struct key ab_keys
[] =
74 /* TRANSLATORS: go to Previous Entry */
75 {"P", N_("PrevEntry"), {MC_PREVITEM
,1,{'p'}}, KS_NONE
},
76 /* TRANSLATORS: go to Next Entry */
77 {"N", N_("NextEntry"), {MC_NEXTITEM
,1,{'n'}}, KS_NONE
},
100 /* TRANSLATORS: Select this Entry */
101 {";",N_("Select"),{MC_SELECT
,1,{';'}},KS_NONE
},
102 /* TRANSLATORS: Apply a command to several objects at once */
103 {"A",N_("Apply"),{MC_APPLY
,1,{'a'}},KS_APPLY
},
104 /* TRANSLATORS: Select Current entry */
105 {":",N_("SelectCur"),{MC_SELCUR
,1,{':'}},KS_SELECTCUR
},
106 /* TRANSLATORS: Zoom refers to zooming in on a smaller set of
107 items, like with a camera zoom lense */
108 {"Z",N_("ZoomMode"),{MC_ZOOM
,1,{'z'}},KS_NONE
},
116 INST_KEY_MENU(ab_keymenu
, ab_keys
);
119 struct key abook_select_keys
[] =
122 {"E", N_("Exit"), {MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
123 {"S", "[" N_("Select") "]", {MC_CHOICE
,3,{'s',ctrl('M'),ctrl('J')}}, KS_NONE
},
124 /* TRANSLATORS: go to Previous entry */
125 {"P", N_("Prev"), {MC_PREVITEM
, 1, {'p'}}, KS_NONE
},
126 {"N", N_("Next"), {MC_NEXTITEM
, 2, {'n', TAB
}}, KS_NONE
},
133 INST_KEY_MENU(abook_select_km
, abook_select_keys
);
136 struct key abook_view_keys
[] =
139 /* TRANSLATORS: Abook is an abbreviation for Address Book */
140 {"<",N_("Abook"),{MC_EXIT
,2,{'<',','}},KS_NONE
},
141 {"U",N_("Update"),{MC_EDIT
,1,{'u'}},KS_NONE
},
142 /* TRANSLATORS: ComposeTo means to start editing a new message to
143 this address book entry */
144 {"C",N_("ComposeTo"),{MC_COMPOSE
,1,{'c'}},KS_COMPOSER
},
150 /* TRANSLATORS: abbreviation for Forward as Email */
151 {"F", N_("Fwd Email"), {MC_FORWARD
, 1, {'f'}}, KS_FORWARD
},
156 /* TRANSLATORS: View the highlighted link, for example, a URL */
157 {"V",N_("ViewLink"),{MC_VIEW_HANDLE
,3,{'v',ctrl('m'),ctrl('j')}},KS_NONE
},
159 /* TRANSLATORS: go to the previous link, for example, the previous URL */
160 {"^B",N_("PrevLink"),{MC_PREV_HANDLE
,1,{ctrl('B')}},KS_NONE
},
161 {"^F",N_("NextLink"),{MC_NEXT_HANDLE
,1,{ctrl('F')}},KS_NONE
},
168 INST_KEY_MENU(abook_view_keymenu
, abook_view_keys
);
171 struct key abook_text_keys
[] =
174 {"E",N_("Exit Viewer"),{MC_EXIT
,1,{'e'}},KS_NONE
},
183 {"S", N_("Save"), {MC_SAVETEXT
,1,{'s'}}, KS_SAVE
}};
184 INST_KEY_MENU(abook_text_km
, abook_text_keys
);
187 struct key ldap_view_keys
[] =
190 /* TRANSLATORS: go back to the index of results instead of
191 viewing this particular entry */
192 {"<",N_("Results Index"),{MC_EXIT
,2,{'<',','}},KS_NONE
},
194 {"C", N_("ComposeTo"), {MC_COMPOSE
,1,{'c'}}, KS_COMPOSER
},
205 {"V",N_("ViewLink"),{MC_VIEW_HANDLE
,3,{'v',ctrl('m'),ctrl('j')}},KS_NONE
},
207 {"^B",N_("PrevLink"),{MC_PREV_HANDLE
,1,{ctrl('B')}},KS_NONE
},
208 {"^F",N_("NextLink"),{MC_NEXT_HANDLE
,1,{ctrl('F')}},KS_NONE
},
215 INST_KEY_MENU(ldap_view_keymenu
, ldap_view_keys
);
218 struct key context_mgr_keys
[] =
221 {"<", N_("Main Menu"), {MC_MAIN
,3,{'m','<',','}}, KS_EXITMODE
},
222 /* TRANSLATORS: View this Collection of folders */
223 {">", "[" N_("View Cltn") "]",
224 {MC_CHOICE
,5,{'v','>','.',ctrl('M'),ctrl('J')}}, KS_NONE
},
246 INST_KEY_MENU(c_mgr_km
, context_mgr_keys
);
249 struct key context_cfg_keys
[] =
252 {"E", N_("Exit Setup"), {MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
253 {"C", "[" N_("Change") "]", {MC_EDIT
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
258 /* TRANSLATORS; Add a Collection of folders */
259 {"A", N_("Add Cltn"), {MC_ADD
,1,{'a'}}, KS_NONE
},
261 /* TRANSLATORS; Change the order of items in a list */
262 {"$", N_("Shuffle"), {MC_SHUFFLE
,1,{'$'}},KS_NONE
},
277 INST_KEY_MENU(c_cfg_km
, context_cfg_keys
);
280 struct key context_select_keys
[] =
282 {"E", N_("ExitSelect"), {MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
284 /* TRANSLATORS: View this collection */
285 {">", "[" N_("View Cltn") "]",
286 {MC_CHOICE
, 5, {'v','>','.',ctrl('M'),ctrl('J')}}, KS_NONE
},
295 INST_KEY_MENU(c_sel_km
, context_select_keys
);
298 struct key context_fcc_keys
[] =
300 {"E", N_("ExitSelect"), {MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
302 {">", "[" N_("View Cltn") "]",
303 {MC_CHOICE
, 5, {'v','>','.',ctrl('M'),ctrl('J')}}, KS_NONE
},
312 INST_KEY_MENU(c_fcc_km
, context_fcc_keys
);
314 struct key folder_keys
[] =
317 {"<", NULL
, {MC_EXIT
,2,{'<',','}}, KS_NONE
},
318 {">", NULL
, {MC_CHOICE
,2,{'>','.'}}, KS_NONE
},
323 /* TRANSLATORS: make an addition, for example add a new folder
324 or a new entry in an address book */
325 {"A",N_("Add"),{MC_ADDFLDR
,1,{'a'}},KS_NONE
},
327 /* TRANSLATORS: change the name of something */
328 {"R",N_("Rename"),{MC_RENAMEFLDR
,1,{'r'}}, KS_NONE
},
335 {"V", "[" N_("View Fldr") "]", {MC_OPENFLDR
}, KS_NONE
},
339 {"%", N_("Print"), {MC_PRINTFLDR
,1,{'%'}}, KS_PRINT
},
340 {"Z", N_("ZoomMode"), {MC_ZOOM
,1,{'z'}}, KS_NONE
},
341 {";",N_("Select"),{MC_SELECT
,1,{';'}},KS_SELECT
},
342 /* TRANSLATORS: Select current item */
343 {":",N_("SelectCur"),{MC_SELCUR
,1,{':'}},KS_SELECT
},
351 {"$", N_("Shuffle"), {MC_SHUFFLE
,1,{'$'}},KS_NONE
},
354 /* TRANSLATORS: Import refers to bringing something in from
355 outside of alpine's normal world */
356 {"U", N_("Import"), {MC_IMPORT
,1,{'u'}},KS_NONE
},
359 INST_KEY_MENU(folder_km
, folder_keys
);
362 struct key folder_sel_keys
[] =
364 {"E", N_("ExitSelect"), {MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
366 {NULL
, NULL
, {MC_CHOICE
,0}, KS_NONE
},
371 {"S", N_("Select"), {MC_OPENFLDR
,1,{'s'}}, KS_NONE
},
388 INST_KEY_MENU(folder_sel_km
, folder_sel_keys
);
391 struct key folder_sela_keys
[] =
393 {"E", N_("ExitSelect"), {MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
395 {NULL
, NULL
, {MC_CHOICE
,0}, KS_NONE
},
400 {"S", N_("Select"), {MC_OPENFLDR
,1,{'s'}}, KS_NONE
},
402 {"A", N_("AddNew"), {MC_ADD
,1,{'a'}}, KS_NONE
},
417 INST_KEY_MENU(folder_sela_km
, folder_sela_keys
);
420 struct key folder_sub_keys
[] =
422 /* TRANSLATORS: Subscribe to a news group */
423 {"S", N_("Subscribe"), {MC_CHOICE
,1,{'s'}}, KS_NONE
},
424 /* TRANSLATORS: Exit Subscribe screen */
425 {"E", N_("ExitSubscb"), {MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
426 {NULL
, "[" N_("Select") "]", {MC_CHOICE
,3,{'s',ctrl('M'),ctrl('J')}}, KS_NONE
},
431 /* TRANSLATORS: List Mode in alpine is where you can select not just
432 one of something but you can select a whole list of something, for
433 example a whole list of addresses to send to. */
434 {"L", N_("List Mode"), {MC_LISTMODE
, 1, {'l'}}, KS_NONE
},
451 INST_KEY_MENU(folder_sub_km
, folder_sub_keys
);
454 struct key folder_post_keys
[] =
457 {"E", N_("ExitSelect"), {MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
458 {"S", "[" N_("Select") "]", {MC_CHOICE
, 3, {'s',ctrl('M'),ctrl('J')}}, KS_NONE
},
467 INST_KEY_MENU(folder_post_km
, folder_post_keys
);
470 struct key help_keys
[] =
472 {NULL
,NULL
,{MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
473 {NULL
,NULL
,{MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
474 {NULL
,NULL
,{MC_VIEW_HANDLE
,3,{'v',ctrl('m'),ctrl('j')}},KS_NONE
},
475 {"^B",N_("PrevLink"),{MC_PREV_HANDLE
,1,{ctrl('B')}},KS_NONE
},
476 {"^F",N_("NextLink"),{MC_NEXT_HANDLE
,1,{ctrl('F')}},KS_NONE
},
480 {"Z",N_("Print All"),{MC_PRINTALL
,1,{'z'}},KS_NONE
},
481 {"N",N_("Name"),{MC_EXPORT
,1,{'n'}},KS_NONE
},
496 INST_KEY_MENU(help_keymenu
, help_keys
);
499 struct key rev_msg_keys
[] =
502 {"E",N_("Exit Viewer"),{MC_EXIT
,1,{'e'}},KS_EXITMODE
},
504 {"T",NULL
,{MC_TOGGLE
,1,{'t'}},KS_NONE
},
505 {"D",NULL
,{MC_JUMP
,1,{'d'}},KS_NONE
},
511 {"S", N_("Save"), {MC_SAVETEXT
,1,{'s'}}, KS_SAVE
},
525 INST_KEY_MENU(rev_msg_keymenu
, rev_msg_keys
);
528 struct key ans_certfail_keys
[] =
532 /* TRANSLATORS: Continue means to keep going. The user is paused to read
533 something and has to tell us to continue when they are finished. */
534 {"C","[" N_("Continue") "]",{MC_YES
,3,{'c',ctrl('J'),ctrl('M')}},KS_NONE
},
543 INST_KEY_MENU(ans_certfail_keymenu
, ans_certfail_keys
);
546 struct key ans_certquery_keys
[] =
549 {"Y",N_("Yes, continue"),{MC_YES
,1,{'y'}},KS_NONE
},
550 {"D","[" N_("Details") "]",{MC_VIEW_HANDLE
,3,{'d',ctrl('M'),ctrl('J')}},KS_NONE
},
551 {"N",N_("No"),{MC_NO
,1,{'n'}},KS_NONE
},
558 {"S", N_("Save"), {MC_SAVETEXT
,1,{'s'}}, KS_SAVE
}};
559 INST_KEY_MENU(ans_certquery_keymenu
, ans_certquery_keys
);
561 struct key oauth2_alpine_auth_keys
[] =
564 {"C",N_("Enter Code"),{MC_YES
,1,{'c'}},KS_NONE
},
565 {"V","[" N_("View URL") "]",{MC_VIEW_HANDLE
,3,{'v',ctrl('M'),ctrl('J')}},KS_NONE
},
566 {"E",N_("Exit"),{MC_NO
,1,{'e'}},KS_NONE
},
573 {"S", N_("Save"), {MC_SAVETEXT
,1,{'s'}}, KS_SAVE
}};
574 INST_KEY_MENU(oauth2_auth_keymenu
, oauth2_alpine_auth_keys
);
576 struct key oauth2_device_alpine_auth_keys
[] =
579 {"V","[" N_("View URL") "]",{MC_VIEW_HANDLE
,3,{'v',ctrl('M'),ctrl('J')}},KS_NONE
},
580 {"E",N_("Exit"),{MC_NO
,1,{'e'}},KS_NONE
},
586 {"S", N_("Save"), {MC_SAVETEXT
,1,{'s'}}, KS_SAVE
},
589 INST_KEY_MENU(oauth2_device_auth_keymenu
, oauth2_device_alpine_auth_keys
);
591 struct key forge_keys
[] =
594 {"Y",N_("Yes, continue"),{MC_YES
,1,{'y'}},KS_NONE
},
595 {"N",N_("No"),{MC_NO
,1,{'n'}},KS_NONE
},
603 {"S", N_("Save"), {MC_SAVETEXT
,1,{'s'}}, KS_SAVE
}};
604 INST_KEY_MENU(forge_keymenu
, forge_keys
);
607 struct key listmgr_keys
[] =
610 /* TRANSLATORS: Exit Command List */
611 {"E",N_("Exit CmdList"),{MC_EXIT
,1,{'e'}},KS_EXITMODE
},
612 {"Ret","[" N_("Try Command") "]",{MC_VIEW_HANDLE
,3,
613 {ctrl('m'),ctrl('j'),KEY_RIGHT
}},KS_NONE
},
614 /* TRANSLATORS: go to Previous Command in list */
615 {"^B",N_("Prev Cmd"),{MC_PREV_HANDLE
,1,{ctrl('B')}},KS_NONE
},
616 /* TRANSLATORS: go to Next Command in list */
617 {"^F",N_("Next Cmd"),{MC_NEXT_HANDLE
,1,{ctrl('F')}},KS_NONE
},
624 INST_KEY_MENU(listmgr_keymenu
, listmgr_keys
);
627 struct key index_keys
[] =
630 {"<", NULL
, {MC_FOLDERS
,2,{'<',','}}, KS_NONE
},
656 {"X",NULL
,{MC_EXPUNGE
,1,{'x'}},KS_NONE
},
657 /* TRANSLATORS: this stands for unexclude which is the opposite
658 of the exclude command. Exclude eliminates some messages from
659 the view and unexclude gets them back. */
660 {"&",N_("unXclude"),{MC_UNEXCLUDE
,1,{'&'}},KS_NONE
},
661 {";",N_("Select"),{MC_SELECT
,1,{';'}},KS_SELECT
},
662 {"A",N_("Apply"),{MC_APPLY
,1,{'a'}},KS_APPLY
},
672 {":",N_("SelectCur"),{MC_SELCUR
,1,{':'}},KS_SELECTCUR
},
673 {"Z",N_("ZoomMode"),{MC_ZOOM
,1,{'z'}},KS_ZOOM
},
679 /* TRANSLATORS: toggles a collapsed view or an expanded view
680 of a message thread on and off */
681 {"/",N_("Collapse/Expand"),{MC_COLLAPSE
,1,{'/'}},KS_NONE
},
682 {"@", N_("Quota"), {MC_QUOTA
,1,{'@'}}, KS_NONE
},
684 INST_KEY_MENU(index_keymenu
, index_keys
);
687 struct key simple_index_keys
[] =
689 {"E",N_("ExitSelect"),{MC_EXIT
,1,{'e'}},KS_EXITMODE
},
691 {"S","[" N_("Select") "]",{MC_SELECT
,3,{'s',ctrl('M'),ctrl('J')}},KS_SELECT
},
700 INST_KEY_MENU(simple_index_keymenu
, simple_index_keys
);
703 struct key thread_keys
[] =
706 /* TRANSLATORS: go to the Folder List */
707 {"<", N_("FldrList"), {MC_FOLDERS
,2,{'<',','}}, KS_NONE
},
708 /* TRANSLATORS: View a Thread of messages */
709 {">", "[" N_("ViewThd") "]", {MC_VIEW_ENTRY
,5,{'v','.','>',ctrl('M'),ctrl('J')}},
711 /* TRANSLATORS: go to the Previous Thread */
712 {"P", N_("PrevThd"), {MC_PREVITEM
, 1, {'p'}}, KS_PREVMSG
},
713 /* TRANSLATORS: go to the Next Thread */
714 {"N", N_("NextThd"), {MC_NEXTITEM
, 1, {'n'}}, KS_NEXTMSG
},
737 {"X",NULL
,{MC_EXPUNGE
,1,{'x'}},KS_NONE
},
738 {"&",N_("unXclude"),{MC_UNEXCLUDE
,1,{'&'}},KS_NONE
},
739 {";",N_("Select"),{MC_SELECT
,1,{';'}},KS_SELECT
},
740 {"A",N_("Apply"),{MC_APPLY
,1,{'a'}},KS_APPLY
},
750 {":",N_("SelectCur"),{MC_SELCUR
,1,{':'}},KS_SELECTCUR
},
751 {"Z",N_("ZoomMode"),{MC_ZOOM
,1,{'z'}},KS_ZOOM
},
757 {"/",N_("Collapse/Expand"),{MC_COLLAPSE
,1,{'/'}},KS_NONE
},
758 {"@", N_("Quota"), {MC_QUOTA
,1,{'@'}}, KS_NONE
},
760 INST_KEY_MENU(thread_keymenu
, thread_keys
);
763 struct key att_index_keys
[] =
766 {"<",NULL
,{MC_EXIT
,2,{'<',','}},KS_EXITMODE
},
767 {">","[" N_("View") "]",{MC_VIEW_ATCH
,5,{'v','>','.',ctrl('M'),ctrl('J')}},
769 /* TRANSLATORS: go to Previous Attachment */
770 {"P", N_("PrevAttch"),{MC_PREVITEM
,4,{'p',ctrl('B'),ctrl('P'),KEY_UP
}},
772 /* TRANSLATORS: go to Next Attachment */
773 {"N", N_("NextAtch"),
774 {MC_NEXTITEM
, 5, {'n','\t',ctrl('F'),ctrl('N'), KEY_DOWN
}},
780 {"S", N_("Save"), {MC_SAVETEXT
,1,{'s'}}, KS_SAVE
},
781 {NULL
, NULL
, {MC_EXPORT
, 1, {'e'}}, KS_EXPORT
},
789 /* TRANSLATORS: About Attachment, a short description of the attachment */
790 {"A",N_("AboutAttch"),{MC_ABOUTATCH
,1,{'a'}},KS_NONE
},
792 {"%", N_("Print"), {MC_PRINTMSG
,1,{'%'}}, KS_PRINT
},
800 {"X",N_("eXternal"),{MC_EXTERNAL
,1,{'x'}},KS_NONE
},
809 INST_KEY_MENU(att_index_keymenu
, att_index_keys
);
812 struct key att_view_keys
[] =
815 {"<",NULL
,{MC_EXIT
,2,{'<',','}},KS_EXITMODE
},
816 /* TRANSLATORS: View highlighted URL */
817 {"Ret","[" N_("View Hilite") "]",{MC_VIEW_HANDLE
,3,
818 {ctrl('m'),ctrl('j'),KEY_RIGHT
}},KS_NONE
},
819 /* TRANSLATORS: go to Previous URL */
820 {"^B",N_("Prev URL"),{MC_PREV_HANDLE
,1,{ctrl('B')}},KS_NONE
},
821 /* TRANSLATORS: go to Next URL */
822 {"^F",N_("Next URL"),{MC_NEXT_HANDLE
,1,{ctrl('F')}},KS_NONE
},
838 {"%", N_("Print"), {MC_PRINTMSG
,1,{'%'}}, KS_PRINT
},
850 {"^D","Decrypt", {MC_DECRYPT
,1,{ctrl('d')}},KS_NONE
},
851 {"^E","Security", {MC_SECURITY
,1,{ctrl('e')}},KS_NONE
},
860 INST_KEY_MENU(att_view_keymenu
, att_view_keys
);
863 struct key view_keys
[] =
866 /* TRANSLATORS: go to Message Index */
867 {"<",N_("MsgIndex"),{MC_INDEX
,3,{'i','<',','}},KS_FLDRINDEX
},
868 /* TRANSLATORS: View the Attachment */
869 {">",N_("ViewAttch"),{MC_VIEW_ATCH
,3,{'v','>','.'}},KS_NONE
},
894 /* TRANSLATORS: View the highlighted URL */
895 {"Ret","[" N_("View Hilite") "]",{MC_VIEW_HANDLE
,3,
896 {ctrl('m'),ctrl('j'),KEY_RIGHT
}},KS_NONE
},
897 /* TRANSLATORS: Select the current item */
898 {":",N_("SelectCur"),{MC_SELCUR
,1,{':'}},KS_SELECTCUR
},
899 /* TRANSLATORS: go to previous URL */
900 {"^B",N_("Prev URL"),{MC_PREV_HANDLE
,1,{ctrl('B')}},KS_NONE
},
901 /* TRANSLATORS: go to next URL */
902 {"^F",N_("Next URL"),{MC_NEXT_HANDLE
,1,{ctrl('F')}},KS_NONE
},
915 {"A",N_("TogglePreferPlain"),{MC_TOGGLE
,1,{'a'}},KS_NONE
},
917 {"^D","Decrypt", {MC_DECRYPT
,1,{ctrl('d')}},KS_NONE
},
918 {"^E","Security", {MC_SECURITY
,1,{ctrl('e')}},KS_NONE
},
927 INST_KEY_MENU(view_keymenu
, view_keys
);
930 struct key simple_text_keys
[] =
933 {"E",N_("Exit Viewer"),{MC_EXIT
,1,{'e'}},KS_EXITMODE
},
942 {"S", N_("Save"), {MC_SAVETEXT
,1,{'s'}}, KS_SAVE
},
956 INST_KEY_MENU(simple_text_keymenu
, simple_text_keys
);
959 struct key oe_keys
[] =
960 {{"^G",N_("Help"),{MC_NONE
},KS_SCREENHELP
},
961 {"^C",N_("Cancel"),{MC_NONE
},KS_NONE
},
962 {"^T","xxx",{MC_NONE
},KS_NONE
},
963 /* TRANSLATORS: The user is entering characters, for example, the
964 name of a folder. Accept means the user is done and wants to
965 accept what is currently displayed. */
966 {"Ret",N_("Accept"),{MC_NONE
},KS_NONE
},
975 INST_KEY_MENU(oe_keymenu
, oe_keys
);
978 struct key choose_setup_keys
[] =
981 {"E",N_("Exit Setup"),{MC_EXIT
,2,{'e',ctrl('C')}},KS_EXITMODE
},
982 {"P",N_("Printer"),{MC_PRINTER
,1,{'p'}},KS_NONE
},
983 /* TRANSLATORS: Change password */
984 {"N",N_("Newpassword"),{MC_PASSWD
,1,{'n'}},KS_NONE
},
985 /* TRANSLATORS: Configure Alpine */
986 {"C",N_("Config"),{MC_CONFIG
,1,{'c'}},KS_NONE
},
987 /* TRANSLATORS: Edit signature block */
988 {"S",N_("Signature"),{MC_SIG
,1,{'s'}},KS_NONE
},
989 /* TRANSLATORS: configure address books */
990 {"A",N_("AddressBooks"),{MC_ABOOKS
,1,{'a'}},KS_NONE
},
991 /* TRANSLATORS: configure collection lists */
992 {"L",N_("collectionList"),{MC_CLISTS
,1,{'l'}},KS_NONE
},
993 /* TRANSLATORS: configure rules, an alpine concept */
994 {"R",N_("Rules"),{MC_RULES
,1,{'r'}},KS_NONE
},
995 /* TRANSLATORS: configure directory servers */
996 {"D",N_("Directory"),{MC_DIRECTORY
,1,{'d'}},KS_NONE
},
997 /* TRANSLATORS: configure color */
998 {"K",N_("Kolor"),{MC_KOLOR
,1,{'k'}},KS_NONE
},
1003 /* TRANSLATORS: remote configuration setup */
1004 {"Z",N_("RemoteConfigSetup"),{MC_REMOTE
,1,{'z'}},KS_NONE
},
1005 /* TRANSLATORS: configure S/MIME */
1006 {"M",N_("S/Mime"),{MC_SECURITY
,1,{'m'}},KS_NONE
},
1007 {"U",N_("xoaUth2"),{MC_XOAUTH2
,1,{'u'}},KS_NONE
},
1014 INST_KEY_MENU(choose_setup_keymenu
, choose_setup_keys
);
1017 struct key main_keys
[] =
1022 /* TRANSLATORS: go to Previous Command in list */
1023 {"P",N_("PrevCmd"),{MC_PREVITEM
,3,{'p',ctrl('P'),KEY_UP
}},KS_NONE
},
1024 {"N",N_("NextCmd"),{MC_NEXTITEM
,3,{'n',ctrl('N'),KEY_DOWN
}},KS_NONE
},
1027 /* TRANSLATORS: show release notes */
1028 {"R",N_("RelNotes"),{MC_RELNOTES
,1,{'r'}},KS_NONE
},
1029 /* TRANSLATORS: lock keyboard */
1030 {"K",N_("KBLock"),{MC_KBLOCK
,1,{'k'}},KS_NONE
},
1040 {"I",N_("Index"),{MC_INDEX
,1,{'i'}},KS_FLDRINDEX
},
1041 /* TRANSLATORS: go to the Journal. The Journal shows past
1042 messages that alpine has shown the user. */
1043 {"J",N_("Journal"),{MC_JOURNAL
,1,{'j'}},KS_REVIEW
},
1044 /* TRANSLATORS: go to the Setup screen */
1045 {"S",N_("Setup"),{MC_SETUP
,1,{'s'}},KS_NONE
},
1046 /* TRANSLATORS: go to the address book screen */
1047 {"A",N_("AddrBook"),{MC_ADDRBOOK
,1,{'a'}},KS_ADDRBOOK
},
1050 INST_KEY_MENU(main_keymenu
, main_keys
);
1053 struct key simple_file_keys
[] =
1056 {"Q",N_("Quit Viewer"),{MC_EXIT
,1,{'q'}},KS_NONE
},
1065 {"S", N_("Save"), {MC_SAVETEXT
,1,{'s'}}, KS_SAVE
},
1079 INST_KEY_MENU(simple_file_keymenu
, simple_file_keys
);
1082 struct key nuov_keys
[] =
1085 {"E",NULL
,{MC_EXIT
,1,{'e'}},KS_NONE
},
1086 {"V",N_("ViewLink"),{MC_VIEW_HANDLE
,3,{'v',ctrl('m'),ctrl('j')}},KS_NONE
},
1093 /* TRANSLATORS: show release notes */
1094 {"R",N_("RelNotes"),{MC_RELNOTES
,1,{'r'}},KS_NONE
},
1109 INST_KEY_MENU(nuov_keymenu
, nuov_keys
);
1112 struct key modal_message_keys
[] =
1115 {"Ret",N_("Finished"),{MC_EXIT
,2,{ctrl('m'),ctrl('j')}},KS_NONE
},
1125 INST_KEY_MENU(modal_message_keymenu
, modal_message_keys
);
1128 struct key ta_keys_lm
[] =
1132 /* TRANSLATORS: Take this address into the address book */
1133 {"T", N_("Take"), {MC_TAKE
,1,{'t'}}, KS_NONE
},
1138 {"X","[" N_("Set/Unset") "]", {MC_CHOICE
,3,{'x',ctrl('M'),ctrl('J')}}, KS_NONE
},
1139 {"A", N_("SetAll"),{MC_SELALL
,1,{'a'}},KS_NONE
},
1140 {"U",N_("UnSetAll"),{MC_UNSELALL
,1,{'u'}},KS_NONE
},
1141 /* TRANSLATORS: The Take Address screen has a Single mode and a
1142 List mode. This command causes us to go into Single mode. */
1143 {"S",N_("SinglMode"),{MC_LISTMODE
,1,{'s'}},KS_NONE
}};
1144 INST_KEY_MENU(ta_keymenu_lm
, ta_keys_lm
);
1147 struct key ta_keys_sm
[] =
1151 {"T","[" N_("Take") "]",{MC_TAKE
,3,{'t',ctrl('M'),ctrl('J')}}, KS_NONE
},
1159 /* TRANSLATORS: The Take Address screen has a Single mode and a
1160 List mode. This command causes us to go into List mode. */
1161 {"L",N_("ListMode"),{MC_LISTMODE
,1,{'l'}},KS_NONE
}};
1162 INST_KEY_MENU(ta_keymenu_sm
, ta_keys_sm
);
1165 struct key pipe_cancel_keys
[] =
1167 {"^C",N_("Stop Waiting"),{MC_NONE
},KS_NONE
},
1178 INST_KEY_MENU(pipe_cancel_keymenu
, pipe_cancel_keys
);
1181 struct key color_pattern_keys
[] =
1185 /* TRANSLATORS: Change Value */
1186 {"C", "[" N_("Change Val") "]", {MC_EDIT
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
1192 /* TRANSLATORS: Delete Value */
1193 {"D", N_("Delete Val"), {MC_DELETE
,1,{'d'}}, KS_NONE
},
1199 {"I", N_("IndxHdr"), {MC_ADDHEADER
,1,{'i'}}, KS_NONE
},
1209 INST_KEY_MENU(color_pattern_keymenu
, color_pattern_keys
);
1212 struct key hdr_color_checkbox_keys
[] =
1225 INST_KEY_MENU(hdr_color_checkbox_keymenu
, hdr_color_checkbox_keys
);
1228 struct key kw_color_checkbox_keys
[] =
1241 INST_KEY_MENU(kw_color_checkbox_keymenu
, kw_color_checkbox_keys
);
1244 struct key selectable_bold_checkbox_keys
[] =
1257 INST_KEY_MENU(selectable_bold_checkbox_keymenu
, selectable_bold_checkbox_keys
);
1260 struct key flag_keys
[] =
1262 {"A", N_("Add KW"), {MC_ADD
,1,{'a'}}, KS_NONE
},
1263 /* TRANSLATORS: Exit from the Flags screen */
1264 {"E", N_("Exit Flags"), {MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
1274 INST_KEY_MENU(flag_keymenu
, flag_keys
);
1277 struct key addr_select_keys
[] =
1279 {"E", N_("ExitSelect"), {MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
1281 {"S", "[" N_("Select") "]", {MC_CHOICE
,3,{'s',ctrl('M'),ctrl('J')}}, KS_NONE
},
1290 INST_KEY_MENU(addr_s_km
, addr_select_keys
);
1293 struct key addr_select_with_goback_keys
[] =
1296 /* TRANSLATORS: go to address book list */
1297 {"<", N_("AddressBkList"), {MC_ADDRBOOK
,2,{'<',','}}, KS_NONE
},
1298 {"S", "[" N_("Select") "]", {MC_CHOICE
,3,{'s',ctrl('M'),ctrl('J')}}, KS_NONE
},
1305 {"E", N_("ExitSelect"), {MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
1307 INST_KEY_MENU(addr_s_km_with_goback
, addr_select_with_goback_keys
);
1309 static struct key addr_select_with_view_keys
[] =
1312 {"<", N_("AddressBkList"), {MC_ADDRBOOK
,2,{'<',','}}, KS_NONE
},
1313 {">", "[" N_("View") "]",
1314 {MC_VIEW_TEXT
,5,{'v','>','.',ctrl('M'),ctrl('J')}}, KS_NONE
},
1319 /* TRANSLATORS: compose a message to the current address */
1320 {"C", N_("ComposeTo"), {MC_COMPOSE
,1,{'c'}}, KS_COMPOSER
},
1337 INST_KEY_MENU(addr_s_km_with_view
, addr_select_with_view_keys
);
1340 struct key addr_select_for_url_keys
[] =
1343 {"<", N_("Exit Viewer"), {MC_ADDRBOOK
,3,{'<',',','e'}}, KS_NONE
},
1344 {">", "[" N_("View") "]",
1345 {MC_VIEW_TEXT
,5,{'v','>','.',ctrl('M'),ctrl('J')}}, KS_NONE
},
1350 {"C", N_("ComposeTo"), {MC_COMPOSE
,1,{'c'}}, KS_COMPOSER
},
1367 INST_KEY_MENU(addr_s_km_for_url
, addr_select_for_url_keys
);
1370 struct key addr_select_exit_keys
[] =
1373 {"E", "[" N_("Exit") "]", {MC_EXIT
,3,{'e',ctrl('M'),ctrl('J')}},
1384 INST_KEY_MENU(addr_s_km_exit
, addr_select_exit_keys
);
1387 struct key addr_select_goback_keys
[] =
1390 {"E", "[" N_("Exit") "]", {MC_ADDRBOOK
,3,{'e',ctrl('M'),ctrl('J')}},
1401 INST_KEY_MENU(addr_s_km_goback
, addr_select_goback_keys
);
1404 struct key config_text_keys
[] =
1408 {"C", "[" N_("Change Val") "]", {MC_EDIT
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
1413 {"A", N_("Add Value"), {MC_ADD
,1,{'a'}}, KS_NONE
},
1414 {"D", N_("Delete Val"), {MC_DELETE
,1,{'d'}}, KS_NONE
},
1430 INST_KEY_MENU(config_text_keymenu
, config_text_keys
);
1432 struct key config_xoauth2_text_keys
[] =
1436 {"C", "[" N_("Change Val") "]", {MC_EDIT
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
1441 {"A", N_("Add Value"), {MC_ADD
,1,{'a'}}, KS_NONE
},
1442 {"D", N_("Delete Val"), {MC_DELETE
,1,{'d'}}, KS_NONE
},
1448 {"^A", N_("Add Server"), {MC_XSADD
,1,{ctrl('A')}}, KS_NONE
},
1449 {"^D", N_("Del Server"), {MC_XSDELETE
,1,{ctrl('d')}}, KS_NONE
},
1451 {"^H", N_("Conf Help"), {MC_XSHELP
,1,{ctrl('h')}}, KS_NONE
},
1458 INST_KEY_MENU(config_xoauth2_text_keymenu
, config_xoauth2_text_keys
);
1461 struct key config_text_to_charsets_keys
[] =
1465 {"C", "[" N_("Change Val") "]", {MC_EDIT
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
1470 {"A", N_("Add Value"), {MC_ADD
,1,{'a'}}, KS_NONE
},
1471 {"D", N_("Delete Val"), {MC_DELETE
,1,{'d'}}, KS_NONE
},
1479 /* TRANSLATORS: go to list of keywords */
1480 {"T", N_("ToCharsets"), {MC_CHOICE
, 2, {'t', ctrl('T')}}, KS_NONE
},
1488 INST_KEY_MENU(config_text_to_charsets_keymenu
, config_text_to_charsets_keys
);
1491 struct key direct_config_keys
[] =
1494 {"E", N_("Exit Setup"), {MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
1495 {"C", "[" N_("Change") "]", {MC_EDIT
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
1496 /* TRANSLATORS: go to previous LDAP directory server in the list */
1497 {"P", N_("PrevDir"), {MC_PREVITEM
, 1, {'p'}}, KS_NONE
},
1498 {"N", N_("NextDir"), {MC_NEXTITEM
, 2, {'n', TAB
}}, KS_NONE
},
1501 /* TRANSLATORS: add a directory server to configuration */
1502 {"A", N_("Add Dir"), {MC_ADD
,1,{'a'}}, KS_NONE
},
1503 /* TRANSLATORS: delete a directory */
1504 {"D", N_("Del Dir"), {MC_DELETE
,1,{'d'}}, KS_NONE
},
1505 {"$", N_("Shuffle"), {MC_SHUFFLE
,1,{'$'}}, KS_NONE
},
1520 INST_KEY_MENU(dir_conf_km
, direct_config_keys
);
1523 struct key sel_from_list_keys
[] =
1526 {"E", N_("Exit"), {MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
1527 {"S", "[" N_("Select") "]", {MC_SELECT
,3,{'s',ctrl('J'),ctrl('M')}}, KS_NONE
},
1528 {"P", N_("Prev"), {MC_PREVITEM
, 1, {'p'}}, KS_NONE
},
1529 {"N", N_("Next"), {MC_NEXTITEM
, 2, {'n', TAB
}}, KS_NONE
},
1536 INST_KEY_MENU(sel_from_list
, sel_from_list_keys
);
1539 struct key sel_from_list_keys_ctrlc
[] =
1542 {"^C", N_("exit"), {MC_EXIT
,1,{ctrl('C')}}, KS_EXITMODE
},
1543 {"S", "[" N_("Select") "]", {MC_SELECT
,3,{'s',ctrl('J'),ctrl('M')}}, KS_NONE
},
1544 {"P", N_("Prev"), {MC_PREVITEM
, 1, {'p'}}, KS_NONE
},
1545 {"N", N_("Next"), {MC_NEXTITEM
, 2, {'n', TAB
}}, KS_NONE
},
1552 INST_KEY_MENU(sel_from_list_ctrlc
, sel_from_list_keys_ctrlc
);
1555 struct key sel_from_list_keys_sm
[] =
1558 {"E", N_("Exit"), {MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
1559 {"S", "[" N_("Select") "]", {MC_SELECT
,3,{'s',ctrl('J'),ctrl('M')}}, KS_NONE
},
1560 {"P", N_("Prev"), {MC_PREVITEM
, 1, {'p'}}, KS_NONE
},
1561 {"N", N_("Next"), {MC_NEXTITEM
, 2, {'n', TAB
}}, KS_NONE
},
1565 {"L",N_("ListMode"),{MC_LISTMODE
,1,{'l'}},KS_NONE
},
1581 INST_KEY_MENU(sel_from_list_sm
, sel_from_list_keys_sm
);
1584 struct key sel_from_list_keys_sm_ctrlc
[] =
1587 {"^C", N_("exit"), {MC_EXIT
,1,{ctrl('C')}}, KS_EXITMODE
},
1588 {"S", "[" N_("Select") "]", {MC_SELECT
,3,{'s',ctrl('J'),ctrl('M')}}, KS_NONE
},
1589 {"P", N_("Prev"), {MC_PREVITEM
, 1, {'p'}}, KS_NONE
},
1590 {"N", N_("Next"), {MC_NEXTITEM
, 2, {'n', TAB
}}, KS_NONE
},
1594 {"L",N_("ListMode"),{MC_LISTMODE
,1,{'l'}},KS_NONE
},
1610 INST_KEY_MENU(sel_from_list_sm_ctrlc
, sel_from_list_keys_sm_ctrlc
);
1613 struct key sel_from_list_keys_lm
[] =
1616 {"E", N_("Exit"), {MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
1617 {"S", "[" N_("Select") "]", {MC_SELECT
,3,{'s',ctrl('J'),ctrl('M')}}, KS_NONE
},
1618 {"P", N_("Prev"), {MC_PREVITEM
, 1, {'p'}}, KS_NONE
},
1619 {"N", N_("Next"), {MC_NEXTITEM
, 2, {'n', TAB
}}, KS_NONE
},
1622 {"X", N_("Set/Unset"), {MC_TOGGLE
,1,{'x'}}, KS_NONE
},
1623 {"1",N_("SinglMode"),{MC_LISTMODE
,1,{'1'}},KS_NONE
},
1639 INST_KEY_MENU(sel_from_list_lm
, sel_from_list_keys_lm
);
1642 struct key sel_from_list_keys_lm_ctrlc
[] =
1645 {"^C", N_("exit"), {MC_EXIT
,1,{ctrl('C')}}, KS_EXITMODE
},
1646 {"S", "[" N_("Select") "]", {MC_SELECT
,3,{'s',ctrl('J'),ctrl('M')}}, KS_NONE
},
1647 {"P", N_("Prev"), {MC_PREVITEM
, 1, {'p'}}, KS_NONE
},
1648 {"N", N_("Next"), {MC_NEXTITEM
, 2, {'n', TAB
}}, KS_NONE
},
1651 {"X", N_("Set/Unset"), {MC_TOGGLE
,1,{'x'}}, KS_NONE
},
1652 {"1",N_("SinglMode"),{MC_LISTMODE
,1,{'1'}},KS_NONE
},
1668 INST_KEY_MENU(sel_from_list_lm_ctrlc
, sel_from_list_keys_lm_ctrlc
);
1671 struct key sel_from_list_keys_olm
[] =
1674 {"E", N_("Exit"), {MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
1675 {"S", "[" N_("Select") "]", {MC_SELECT
,3,{'s',ctrl('J'),ctrl('M')}}, KS_NONE
},
1676 {"P", N_("Prev"), {MC_PREVITEM
, 1, {'p'}}, KS_NONE
},
1677 {"N", N_("Next"), {MC_NEXTITEM
, 2, {'n', TAB
}}, KS_NONE
},
1680 {"X", N_("Set/Unset"), {MC_TOGGLE
,1,{'x'}}, KS_NONE
},
1697 INST_KEY_MENU(sel_from_list_olm
, sel_from_list_keys_olm
);
1700 struct key sel_from_list_keys_olm_ctrlc
[] =
1703 {"^C", N_("exit"), {MC_EXIT
,1,{ctrl('C')}}, KS_EXITMODE
},
1704 {"S", "[" N_("Select") "]", {MC_SELECT
,3,{'s',ctrl('J'),ctrl('M')}}, KS_NONE
},
1705 {"P", N_("Prev"), {MC_PREVITEM
, 1, {'p'}}, KS_NONE
},
1706 {"N", N_("Next"), {MC_NEXTITEM
, 2, {'n', TAB
}}, KS_NONE
},
1709 {"X", N_("Set/Unset"), {MC_TOGGLE
,1,{'x'}}, KS_NONE
},
1726 INST_KEY_MENU(sel_from_list_olm_ctrlc
, sel_from_list_keys_olm_ctrlc
);
1731 struct key printer_edit_keys
[] =
1735 {"S", "[" N_("Select") "]", {MC_CHOICE
,3,{'s',ctrl('M'),ctrl('J')}}, KS_NONE
},
1740 /* TRANSLATORS: add a printer to configuration */
1741 {"A", N_("Add Printer"), {MC_ADD
,1,{'a'}}, KS_NONE
},
1742 /* TRANSLATORS: delete a printer from configuration */
1743 {"D", N_("DeletePrint"), {MC_DELETE
,1,{'d'}}, KS_NONE
},
1744 {"C", N_("Change"), {MC_EDIT
,1,{'c'}}, KS_NONE
},
1759 INST_KEY_MENU(printer_edit_keymenu
, printer_edit_keys
);
1762 struct key printer_select_keys
[] =
1766 {"S", "[" N_("Select") "]", {MC_CHOICE
,3,{'s',ctrl('M'),ctrl('J')}}, KS_NONE
},
1775 INST_KEY_MENU(printer_select_keymenu
, printer_select_keys
);
1780 struct key role_select_keys
[] =
1783 {"E", N_("Exit"), {MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
1785 /* TRANSLATORS: go to previous Role in list */
1786 {"P", N_("PrevRole"), {MC_PREVITEM
, 1, {'p'}}, KS_NONE
},
1787 {"N", N_("NextRole"), {MC_NEXTITEM
, 2, {'n', TAB
}}, KS_NONE
},
1792 {"D", "", {MC_TOGGLE
, 1, {'d'}}, KS_NONE
},
1794 INST_KEY_MENU(role_select_km
, role_select_keys
);
1796 struct key xoauth2_flow_select_keys
[] =
1799 {"E", N_("Exit"), {MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
1800 {"S", "[" N_("Select") "]", {MC_CHOICE
,3,{'s',ctrl('M'),ctrl('J')}}, KS_NONE
},
1801 {"P", N_("PrevFlow"), {MC_PREVITEM
, 1, {'p'}}, KS_NONE
},
1802 {"N", N_("NextFlow"), {MC_NEXTITEM
, 2, {'n', TAB
}}, KS_NONE
},
1809 INST_KEY_MENU(xoauth2_flow_select_km
, xoauth2_flow_select_keys
);
1811 struct key xoauth2_id_select_keys
[] =
1814 {"E", N_("Exit"), {MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
1815 {"S", "[" N_("Select") "]", {MC_CHOICE
,3,{'s',ctrl('M'),ctrl('J')}}, KS_NONE
},
1816 {"P", N_("PrevID"), {MC_PREVITEM
, 1, {'p'}}, KS_NONE
},
1817 {"N", N_("NextID"), {MC_NEXTITEM
, 2, {'n', TAB
}}, KS_NONE
},
1824 INST_KEY_MENU(xoauth2_id_select_km
, xoauth2_id_select_keys
);
1827 struct key role_config_keys
[] =
1830 {"E", N_("Exit Setup"), {MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
1831 {"C", "[" N_("Change") "]", {MC_EDIT
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
1832 /* TRANSLATORS: go to previous Rule in list */
1833 {"P", N_("PrevRule"), {MC_PREVITEM
, 1, {'p'}}, KS_NONE
},
1834 {"N", N_("NextRule"), {MC_NEXTITEM
, 2, {'n', TAB
}}, KS_NONE
},
1837 {"A", N_("Add"), {MC_ADD
,1,{'a'}}, KS_NONE
},
1838 {"D", N_("Delete"), {MC_DELETE
,1,{'d'}}, KS_NONE
},
1839 {"$", N_("Shuffle"), {MC_SHUFFLE
,1,{'$'}}, KS_NONE
},
1846 /* TRANSLATORS: Include a File from filesystem */
1847 {"I", N_("IncludeFile"), {MC_ADDFILE
,1,{'i'}}, KS_NONE
},
1848 {"X", N_("eXcludeFile"), {MC_DELFILE
,1,{'x'}}, KS_NONE
},
1851 {"R", N_("Replicate"), {MC_COPY
,1,{'r'}}, KS_NONE
},
1855 INST_KEY_MENU(role_conf_km
, role_config_keys
);
1858 struct key config_text_wshuf_keys
[] =
1862 {"C", "[" N_("Change Val") "]", {MC_EDIT
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
1867 {"A", N_("Add Value"), {MC_ADD
,1,{'a'}}, KS_NONE
},
1868 {"D", N_("Delete Val"), {MC_DELETE
,1,{'d'}}, KS_NONE
},
1876 {"$", N_("Shuffle"), {MC_SHUFFLE
,1,{'$'}}, KS_NONE
},
1884 INST_KEY_MENU(config_text_wshuf_keymenu
, config_text_wshuf_keys
);
1886 struct key config_xoauth2_wshuf_keys
[] =
1890 {"C", "[" N_("Change Val") "]", {MC_EDIT
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
1895 {"A", N_("Add Value"), {MC_ADD
,1,{'a'}}, KS_NONE
},
1896 {"D", N_("Delete Val"), {MC_DELETE
,1,{'d'}}, KS_NONE
},
1902 {"^A", N_("Add Server"), {MC_XSADD
,1,{ctrl('A')}}, KS_NONE
},
1903 {"^D", N_("Del Server"), {MC_XSDELETE
,1,{ctrl('d')}}, KS_NONE
},
1904 {"$", N_("Shuffle"), {MC_SHUFFLE
,1,{'$'}}, KS_NONE
},
1905 {"^H", N_("Conf Help"), {MC_XSHELP
,1,{ctrl('h')}}, KS_NONE
},
1912 INST_KEY_MENU(config_xoauth2_wshuf_keymenu
, config_xoauth2_wshuf_keys
);
1914 struct key config_text_wshufandfldr_keys
[] =
1918 {"C", "[" N_("Change Val") "]", {MC_EDIT
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
1923 {"A", N_("Add Value"), {MC_ADD
,1,{'a'}}, KS_NONE
},
1924 {"D", N_("Delete Val"), {MC_DELETE
,1,{'d'}}, KS_NONE
},
1932 {"$", N_("Shuffle"), {MC_SHUFFLE
,1,{'$'}}, KS_NONE
},
1933 {"T", N_("ToFldrs"), {MC_CHOICE
,2,{'t', ctrl('T')}}, KS_NONE
},
1940 INST_KEY_MENU(config_text_wshufandfldr_keymenu
, config_text_wshufandfldr_keys
);
1943 struct key config_role_file_keys
[] =
1947 {"C", "[" N_("Change Val") "]", {MC_EDIT
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
1952 {"A", N_("Add Value"), {MC_ADD
,1,{'a'}}, KS_NONE
},
1953 {"D", N_("Delete Val"), {MC_DELETE
,1,{'d'}}, KS_NONE
},
1961 /* TRANSLATORS: go to list of Files */
1962 {"T", N_("ToFiles"), {MC_CHOICE
, 2, {'t', ctrl('T')}}, KS_NONE
},
1963 /* TRANSLATORS: edit a file */
1964 {"F", N_("editFile"), {MC_EDITFILE
, 1, {'f'}}, KS_NONE
},
1971 INST_KEY_MENU(config_role_file_keymenu
, config_role_file_keys
);
1974 struct key config_role_file_res_keys
[] =
1978 {"C", "[" N_("Change Val") "]", {MC_EDIT
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
1983 {"A", N_("Add Value"), {MC_ADD
,1,{'a'}}, KS_NONE
},
1984 {"D", N_("Delete Val"), {MC_DELETE
,1,{'d'}}, KS_NONE
},
1992 {"T", N_("ToFiles"), {MC_CHOICE
, 2, {'t', ctrl('T')}}, KS_NONE
},
2000 INST_KEY_MENU(config_role_file_res_keymenu
, config_role_file_res_keys
);
2003 struct key config_role_keyword_keys
[] =
2007 {"C", "[" N_("Change Val") "]", {MC_EDIT
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
2012 {"A", N_("Add Value"), {MC_ADD
,1,{'a'}}, KS_NONE
},
2013 {"D", N_("Delete Val"), {MC_DELETE
,1,{'d'}}, KS_NONE
},
2021 /* TRANSLATORS: go to list of keywords */
2022 {"T", N_("ToKeywords"), {MC_CHOICE
, 2, {'t', ctrl('T')}}, KS_NONE
},
2030 INST_KEY_MENU(config_role_keyword_keymenu
, config_role_keyword_keys
);
2033 struct key config_role_keyword_keys_not
[] =
2037 {"C", "[" N_("Change Val") "]", {MC_EDIT
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
2042 {"A", N_("Add Value"), {MC_ADD
,1,{'a'}}, KS_NONE
},
2043 {"D", N_("Delete Val"), {MC_DELETE
,1,{'d'}}, KS_NONE
},
2051 {"T", N_("ToKeywords"), {MC_CHOICE
, 2, {'t', ctrl('T')}}, KS_NONE
},
2053 /* TRANSLATORS: toggle between NOT and not NOT, turn NOT on or off */
2054 {"!", N_("toggle NOT"), {MC_NOT
,1,{'!'}}, KS_NONE
},
2060 INST_KEY_MENU(config_role_keyword_keymenu_not
, config_role_keyword_keys_not
);
2063 struct key config_role_charset_keys_not
[] =
2067 {"C", "[" N_("Change Val") "]", {MC_EDIT
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
2072 {"A", N_("Add Value"), {MC_ADD
,1,{'a'}}, KS_NONE
},
2073 {"D", N_("Delete Val"), {MC_DELETE
,1,{'d'}}, KS_NONE
},
2081 /* TRANSLATORS: go to list of character sets */
2082 {"T", N_("ToCharSets"), {MC_CHOICE
, 2, {'t', ctrl('T')}}, KS_NONE
},
2084 {"!", N_("toggle NOT"), {MC_NOT
,1,{'!'}}, KS_NONE
},
2090 INST_KEY_MENU(config_role_charset_keymenu_not
, config_role_charset_keys_not
);
2093 struct key config_role_keys
[] =
2097 {"C", "[" N_("Change Val") "]", {MC_EDIT
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
2102 {"A", N_("Add Value"), {MC_ADD
,1,{'a'}}, KS_NONE
},
2103 {"D", N_("Delete Val"), {MC_DELETE
,1,{'d'}}, KS_NONE
},
2119 INST_KEY_MENU(config_role_keymenu
, config_role_keys
);
2122 struct key config_role_keys_not
[] =
2126 {"C", "[" N_("Change Val") "]", {MC_EDIT
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
2131 {"A", N_("Add Value"), {MC_ADD
,1,{'a'}}, KS_NONE
},
2132 {"D", N_("Delete Val"), {MC_DELETE
,1,{'d'}}, KS_NONE
},
2141 /* TRANSLATORS: add extra headers to list */
2142 {"X", N_("eXtraHdr"), {MC_ADDHDR
, 1, {'x'}}, KS_NONE
},
2143 {"!", N_("toggle NOT"), {MC_NOT
,1,{'!'}}, KS_NONE
},
2149 INST_KEY_MENU(config_role_keymenu_not
, config_role_keys_not
);
2152 struct key config_role_keys_extra
[] =
2156 {"X", "[" N_("eXtraHdr") "]", {MC_ADDHDR
, 3,{'x',ctrl('M'),ctrl('J')}}, KS_NONE
},
2165 INST_KEY_MENU(config_role_keymenu_extra
, config_role_keys_extra
);
2168 struct key config_role_addr_pat_keys
[] =
2172 {"C", "[" N_("Change Val") "]", {MC_EDIT
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
2177 {"A", N_("Add Value"), {MC_ADD
,1,{'a'}}, KS_NONE
},
2178 {"D", N_("Delete Val"), {MC_DELETE
,1,{'d'}}, KS_NONE
},
2186 /* TRANSLATORS: go to address book to get address */
2187 {"T", N_("ToAddrBk"), {MC_CHOICEB
, 2, {'t', ctrl('T')}}, KS_NONE
},
2188 {"X", N_("eXtraHdr"), {MC_ADDHDR
, 1, {'x'}}, KS_NONE
},
2189 {"!", N_("toggle NOT"), {MC_NOT
,1,{'!'}}, KS_NONE
},
2195 INST_KEY_MENU(config_role_addr_pat_keymenu
, config_role_addr_pat_keys
);
2198 struct key config_role_xtrahdr_keys
[] =
2202 {"C", "[" N_("Change Val") "]", {MC_EDIT
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
2207 {"A", N_("Add Value"), {MC_ADD
,1,{'a'}}, KS_NONE
},
2208 {"D", N_("Delete Val"), {MC_DELETE
,1,{'d'}}, KS_NONE
},
2217 {"X", N_("eXtraHdr"), {MC_ADDHDR
, 1, {'x'}}, KS_NONE
},
2218 {"!", N_("toggle NOT"), {MC_NOT
,1,{'!'}}, KS_NONE
},
2220 /* TRANSLATORS: remove a header we previously added */
2221 {"R", N_("RemoveHdr"), {MC_DELHDR
, 1, {'r'}}, KS_NONE
},
2225 INST_KEY_MENU(config_role_xtrahdr_keymenu
, config_role_xtrahdr_keys
);
2228 struct key config_role_addr_act_keys
[] =
2232 {"C", "[" N_("Change Val") "]", {MC_EDIT
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
2237 {"A", N_("Add Value"), {MC_ADD
,1,{'a'}}, KS_NONE
},
2238 {"D", N_("Delete Val"), {MC_DELETE
,1,{'d'}}, KS_NONE
},
2246 {"T", N_("ToAddrBk"), {MC_CHOICEC
, 2, {'t', ctrl('T')}}, KS_NONE
},
2254 INST_KEY_MENU(config_role_addr_act_keymenu
, config_role_addr_act_keys
);
2257 struct key config_role_patfolder_keys
[] =
2261 {"C", "[" N_("Change Val") "]", {MC_EDIT
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
2266 {"A", N_("Add Value"), {MC_ADD
,1,{'a'}}, KS_NONE
},
2267 {"D", N_("Delete Val"), {MC_DELETE
,1,{'d'}}, KS_NONE
},
2275 /* TRANSLATORS: go to list of folders */
2276 {"T", N_("ToFldrs"), {MC_CHOICED
, 2, {'t', ctrl('T')}}, KS_NONE
},
2284 INST_KEY_MENU(config_role_patfolder_keymenu
, config_role_patfolder_keys
);
2287 struct key config_role_actionfolder_keys
[] =
2291 {"C", "[" N_("Change Val") "]", {MC_EDIT
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
2296 {"A", N_("Add Value"), {MC_ADD
,1,{'a'}}, KS_NONE
},
2297 {"D", N_("Delete Val"), {MC_DELETE
,1,{'d'}}, KS_NONE
},
2305 {"T", N_("ToFldrs"), {MC_CHOICEE
, 2, {'t', ctrl('T')}}, KS_NONE
},
2313 INST_KEY_MENU(config_role_actionfolder_keymenu
, config_role_actionfolder_keys
);
2316 struct key config_role_inick_keys
[] =
2320 {"C", "[" N_("Change Val") "]", {MC_EDIT
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
2325 {"A", N_("Add Value"), {MC_ADD
,1,{'a'}}, KS_NONE
},
2326 {"D", N_("Delete Val"), {MC_DELETE
,1,{'d'}}, KS_NONE
},
2334 /* TRANSLATORS: go to list of nicknames */
2335 {"T", N_("ToNicks"), {MC_CHOICE
, 2, {'t', ctrl('T')}}, KS_NONE
},
2343 INST_KEY_MENU(config_role_inick_keymenu
, config_role_inick_keys
);
2346 struct key config_role_afrom_keys
[] =
2350 {"C", "[" N_("Change Val") "]", {MC_EDIT
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
2355 {"A", N_("Add Value"), {MC_ADD
,1,{'a'}}, KS_NONE
},
2356 {"D", N_("Delete Val"), {MC_DELETE
,1,{'d'}}, KS_NONE
},
2364 /* TRANSLATORS: go to list of address books */
2365 {"T", N_("ToAbookList"), {MC_CHOICE
, 2, {'t', ctrl('T')}}, KS_NONE
},
2373 INST_KEY_MENU(config_role_afrom_keymenu
, config_role_afrom_keys
);
2376 struct key config_checkbox_keys
[] =
2389 INST_KEY_MENU(config_checkbox_keymenu
, config_checkbox_keys
);
2392 struct key config_radiobutton_keys
[] =
2396 {"*", "[" N_("Select") "]", {MC_CHOICE
,3,{'*',ctrl('M'),ctrl('J')}}, KS_NONE
},
2405 INST_KEY_MENU(config_radiobutton_keymenu
, config_radiobutton_keys
);
2408 struct key config_yesno_keys
[] =
2412 {"C", "[" N_("Change") "]", {MC_TOGGLE
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
2421 INST_KEY_MENU(config_yesno_keymenu
, config_yesno_keys
);
2424 struct key color_changing_keys
[] =
2427 {"E", N_("To Colors"), {MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
2428 {"*", "[" N_("Select") "]", {MC_CHOICE
,3,{'*',ctrl('M'),ctrl('J')}}, KS_NONE
},
2437 INST_KEY_MENU(color_changing_keymenu
, color_changing_keys
);
2440 struct key custom_color_changing_keys
[] =
2443 /* TRANSLATORS: go to color configuration screen */
2444 {"E", N_("To Colors"), {MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
2445 {"*", "[" N_("Select") "]", {MC_CHOICEB
,3,{'*',ctrl('M'),ctrl('J')}}, KS_NONE
},
2454 INST_KEY_MENU(custom_color_changing_keymenu
, custom_color_changing_keys
);
2457 struct key kw_color_changing_keys
[] =
2460 {"E", N_("To Colors"), {MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
2461 {"*", "[" N_("Select") "]", {MC_CHOICEC
,3,{'*',ctrl('M'),ctrl('J')}}, KS_NONE
},
2470 INST_KEY_MENU(kw_color_changing_keymenu
, kw_color_changing_keys
);
2475 struct key color_rgb_changing_keys
[] =
2478 {"E", N_("To Colors"), {MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
2479 {"*", "[" N_("Select") "]", {MC_CHOICE
,3,{'*',ctrl('M'),ctrl('J')}}, KS_NONE
},
2484 {"C", N_("Customize"), {MC_RGB1
,1,{'c'}},KS_NONE
},
2501 INST_KEY_MENU(color_rgb_keymenu
, color_rgb_changing_keys
);
2504 struct key custom_rgb_changing_keys
[] =
2507 {"E", N_("To Colors"), {MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
2508 {"*", "[" N_("Select") "]", {MC_CHOICEB
,3,{'*',ctrl('M'),ctrl('J')}}, KS_NONE
},
2513 {"C", N_("Customize"), {MC_RGB2
,1,{'c'}},KS_NONE
},
2530 INST_KEY_MENU(custom_rgb_keymenu
, custom_rgb_changing_keys
);
2533 struct key kw_rgb_changing_keys
[] =
2536 {"E", N_("To Colors"), {MC_EXIT
,1,{'e'}}, KS_EXITMODE
},
2537 {"*", "[" N_("Select") "]", {MC_CHOICEC
,3,{'*',ctrl('M'),ctrl('J')}}, KS_NONE
},
2542 {"C", N_("Customize"), {MC_RGB3
,1,{'c'}},KS_NONE
},
2559 INST_KEY_MENU(kw_rgb_keymenu
, kw_rgb_changing_keys
);
2564 struct key color_setting_keys
[] =
2568 {"C", "[" N_("Change") "]", {MC_EDIT
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
2573 {"A", N_("AddHeader"), {MC_ADD
,1,{'a'}}, KS_NONE
},
2574 /* TRANSLATORS: restore defaults */
2575 {"R", N_("RestoreDefs"), {MC_DEFAULT
,1,{'r'}}, KS_NONE
},
2581 {"I", N_("IndxHdr"), {MC_ADDHEADER
,1,{'i'}}, KS_NONE
},
2591 INST_KEY_MENU(color_setting_keymenu
, color_setting_keys
);
2594 struct key custom_color_setting_keys
[] =
2598 {"C", "[" N_("Change") "]", {MC_EDIT
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
2603 {"A", N_("AddHeader"), {MC_ADD
,1,{'a'}}, KS_NONE
},
2604 {"R", N_("RestoreDefs"), {MC_DEFAULT
,1,{'r'}}, KS_NONE
},
2610 {"I", N_("IndxHdr"), {MC_ADDHEADER
,1,{'i'}}, KS_NONE
},
2612 {"D", N_("DeleteHdr"), {MC_DELETE
,1,{'d'}}, KS_NONE
},
2613 /* TRANSLATORS: shuffle headers (change the order of headers) */
2614 {"$", N_("ShuffleHdr"), {MC_SHUFFLE
,1,{'$'}}, KS_NONE
},
2621 INST_KEY_MENU(custom_color_setting_keymenu
, custom_color_setting_keys
);
2624 struct key role_color_setting_keys
[] =
2628 {"*", "[" N_("Select") "]", {MC_CHOICE
,3,{'*',ctrl('M'),ctrl('J')}}, KS_NONE
},
2637 INST_KEY_MENU(role_color_setting_keymenu
, role_color_setting_keys
);
2640 struct key kw_color_setting_keys
[] =
2644 {"C", "[" N_("Change") "]", {MC_EDIT
,3,{'c',ctrl('M'),ctrl('J')}}, KS_NONE
},
2649 {"A", N_("AddHeader"), {MC_ADD
,1,{'a'}}, KS_NONE
},
2650 {"R", N_("RestoreDefs"), {MC_DEFAULT
,1,{'r'}}, KS_NONE
},
2656 {"I", N_("IndxHdr"), {MC_ADDHEADER
,1,{'i'}}, KS_NONE
},
2666 INST_KEY_MENU(kw_color_setting_keymenu
, kw_color_setting_keys
);
2669 struct key take_export_keys_sm
[] =
2672 /* TRANSLATORS: exit the Take Address screen */
2673 {"<",N_("ExitTake"), {MC_EXIT
,4,{'e',ctrl('C'),'<',','}}, KS_EXITMODE
},
2674 {"T","[" N_("Take") "]",{MC_TAKE
,3,{'t',ctrl('M'),ctrl('J')}}, KS_NONE
},
2682 {"L",N_("ListMode"),{MC_LISTMODE
,1,{'l'}},KS_NONE
}};
2683 INST_KEY_MENU(take_export_keymenu_sm
, take_export_keys_sm
);
2686 struct key take_export_keys_lm
[] =
2689 {"<",N_("ExitTake"), {MC_EXIT
,4,{'e',ctrl('C'),'<',','}}, KS_EXITMODE
},
2690 {"T",N_("Take"), {MC_TAKE
,1,{'t'}}, KS_NONE
},
2695 {"X","[" N_("Set/Unset") "]", {MC_CHOICE
,3,{'x',ctrl('M'),ctrl('J')}}, KS_NONE
},
2696 {"A", N_("SetAll"),{MC_SELALL
,1,{'a'}},KS_NONE
},
2697 {"U",N_("UnSetAll"),{MC_UNSELALL
,1,{'u'}},KS_NONE
},
2698 {"S",N_("SinglMode"),{MC_LISTMODE
,1,{'s'}},KS_NONE
}};
2699 INST_KEY_MENU(take_export_keymenu_lm
, take_export_keys_lm
);
2702 struct key smime_info_keys
[] =
2705 {"<","Back",{MC_VIEW_TEXT
,2,{'<',','}},KS_EXITMODE
},
2728 INST_KEY_MENU(smime_info_keymenu
, smime_info_keys
);
2731 struct key config_smime_helper_keys
[] =
2735 {"T","[" N_("Transfer") "]", {MC_CHOICE
,3,{'t',ctrl('M'),ctrl('J')}}, KS_NONE
},
2744 INST_KEY_MENU(config_smime_helper_keymenu
, config_smime_helper_keys
);
2746 struct key config_smime_manage_certs_menu_keys
[] =
2750 {"S", "[" N_("Select") "]", {MC_CHOICE
,3,{'s',ctrl('M'),ctrl('J')}}, KS_NONE
},
2751 {"I", N_("Import Cert"), {MC_IMPORT
,1,{'i'}}, KS_NONE
},
2759 INST_KEY_MENU(config_smime_manage_certs_menu_keymenu
, config_smime_manage_certs_menu_keys
);
2761 struct key config_smime_add_certs_keys
[] =
2765 {"I", N_("Import Cert"), {MC_IMPORT
,3,{'i', ctrl('M'), ctrl('J')}}, KS_NONE
},
2774 INST_KEY_MENU(config_smime_add_certs_keymenu
, config_smime_add_certs_keys
);
2776 struct key config_smime_add_new_key
[] =
2780 {"I", N_("Import Key"), {MC_IMPORT
,3,{'i', ctrl('M'), ctrl('J')}}, KS_NONE
},
2781 {"C", N_("Create Key"), {MC_ADD
,1,{'c'}}, KS_NONE
},
2789 INST_KEY_MENU(config_smime_add_new_key_keymenu
, config_smime_add_new_key
);
2791 struct key config_smime_manage_certs_work_keys
[] =
2795 {"V", "[" N_("View Info") "]", {MC_CHOICE
,3,{'v',ctrl('M'),ctrl('J')}}, KS_NONE
},
2796 {"I", N_("Import Cert"), {MC_IMPORT
,1,{'i'}}, KS_NONE
},
2798 {"D", N_("Delete"), {MC_DELETE
,1,{'d'}}, KS_NONE
},
2799 {"U", N_("Undelete"), {MC_UNDELETE
,1,{'u'}}, KS_NONE
},
2800 {"X", N_("Expunge"), {MC_EXPUNGE
,1,{'x'}}, KS_NONE
},
2817 INST_KEY_MENU(config_smime_manage_certs_work_keymenu
, config_smime_manage_certs_work_keys
);
2819 struct key config_smime_view_cert
[] =
2823 {"V", "[" N_("View Info") "]", {MC_CHOICE
,3,{'v',ctrl('M'),ctrl('J')}}, KS_NONE
},
2824 {"D", N_("Delete pwd"), {MC_DELETE
,1,{'d'}},KS_NONE
},
2832 INST_KEY_MENU(config_smime_manage_view_cert_keymenu
, config_smime_view_cert
);
2834 struct key config_smime_view_cert_no_delete
[] =
2838 {"V", "[" N_("View Info") "]", {MC_CHOICE
,3,{'v',ctrl('M'),ctrl('J')}}, KS_NONE
},
2847 INST_KEY_MENU(config_smime_manage_view_cert_keymenu_no_delete
, config_smime_view_cert_no_delete
);
2849 struct key smime_certificate_info_keys
[] =
2852 {"E",N_("Exit Viewer"),{MC_EXIT
,1,{'e'}},KS_EXITMODE
},
2853 {"T",N_("Trust Cert"), {MC_TRUST
,1,{'t'}},KS_NONE
},
2854 {"D",N_("Delete"), {MC_DELETE
,1,{'d'}},KS_NONE
},
2855 {"U",N_("Undelete"), {MC_UNDELETE
,1,{'u'}},KS_NONE
},
2856 {"B",N_("Public Key"), {MC_PUBLIC
,1,{'b'}},KS_NONE
},
2857 {"R",N_("Private Key"),{MC_PRIVATE
,1,{'r'}},KS_NONE
},
2875 INST_KEY_MENU(smime_certificate_info_keymenu
, smime_certificate_info_keys
);
2878 struct key config_smime_manage_password_file_menu_keys
[] =
2882 {"S", "[" N_("Select") "]", {MC_CHOICE
,3,{'s',ctrl('M'),ctrl('J')}}, KS_NONE
},
2883 {"I", N_("Import Cert"), {MC_IMPORT
,1,{'i'}}, KS_NONE
},
2891 INST_KEY_MENU(config_smime_manage_password_file_menu_keymenu
, config_smime_manage_password_file_menu_keys
);
2896 * Internal prototypes
2898 void output_keymenu(struct key_menu
*, unsigned char *, int, int);
2899 void format_keymenu(struct key_menu
*, unsigned char *, int);
2900 void menu_clear_cmd_binding(struct key_menu
*, int);
2902 void print_inverted_label(int, MENUITEM
*);
2906 /* Saved key menu drawing state */
2908 struct key_menu
*km
;
2917 * Longest label that can be displayed in keymenu
2919 #define MAX_LABEL 40
2920 #define MAX_KEYNAME 3
2921 static struct key last_time_buf
[12];
2922 static int keymenu_is_dirty
= 1;
2925 mark_keymenu_dirty(void)
2927 keymenu_is_dirty
= 1;
2932 * Write an already formatted key_menu to the screen
2934 * Args: km -- key_menu structure
2935 * bm -- bitmap, 0's mean don't draw this key
2936 * row -- the row on the screen to begin on, negative values
2937 * are counted from the bottom of the screen up
2938 * column -- column on the screen to begin on
2940 * The bits in the bitmap are used from least significant to most significant,
2941 * not left to right. So, if you write out the bitmap in the normal way, for
2943 * bm[0] = 0x5, bm[1] = 0x8, bm[2] = 0x21, bm[3] = bm[4] = bm[5] = 0
2944 * 0000 0101 0000 1000 0010 0001 ...
2945 * means that menu item 0 (first row, first column) is set, item 1 (2nd row,
2946 * first column) is not set, item 2 is set, items 3-10 are not set, item 11
2947 * (2nd row, 6th and last column) is set. In the second menu (the second set
2948 * of 12 bits) items 0-3 are unset, 4 is set, 5-8 unset, 9 set, 10-11 unset.
2949 * That uses up bm[0] - bm[2].
2950 * Just to make sure, here it is drawn out for the first set of 12 items in
2951 * the first keymenu (0-11)
2952 * bm[0] x x x x x x x x bm[1] x x x x x x x x
2953 * 7 6 5 4 3 2 1 0 1110 9 8
2956 output_keymenu(struct key_menu
*km
, unsigned char *bm
, int row
, int column
)
2959 extern char term_name
[];
2961 register struct key
*k
;
2962 struct key
*last_time
;
2964 ufk
, /* using function keys */
2966 max_column
, /* number of columns on screen */
2967 off
; /* offset into keymap */
2968 struct variable
*vars
= ps_global
->vars
;
2969 COLOR_PAIR
*lastc
=NULL
, *label_color
=NULL
, *name_color
=NULL
;
2971 /* 6's are for UTF-8 */
2972 char keystr
[6*MAX_KEYNAME
+ 6*MAX_LABEL
+ 2];
2975 off
= km
->which
* 12;
2976 max_column
= ps_global
->ttyo
->screen_cols
;
2978 if((ps_global
->ttyo
->screen_rows
- FOOTER_ROWS(ps_global
)) < 0
2979 || max_column
<= 0){
2980 keymenu_is_dirty
= 1;
2985 real_row
= row
> 0 ? row
: ps_global
->ttyo
->screen_rows
+ row
;
2987 if(pico_usingcolor()){
2988 lastc
= pico_get_cur_color();
2989 if(lastc
&& VAR_KEYLABEL_FORE_COLOR
&& VAR_KEYLABEL_BACK_COLOR
&&
2990 pico_is_good_color(VAR_KEYLABEL_FORE_COLOR
) &&
2991 pico_is_good_color(VAR_KEYLABEL_BACK_COLOR
)){
2992 label_color
= new_color_pair(VAR_KEYLABEL_FORE_COLOR
,
2993 VAR_KEYLABEL_BACK_COLOR
);
2995 (void)pico_set_colorp(label_color
, PSC_NONE
);
2998 if(label_color
&& VAR_KEYNAME_FORE_COLOR
&& VAR_KEYNAME_BACK_COLOR
&&
2999 pico_is_good_color(VAR_KEYNAME_FORE_COLOR
) &&
3000 pico_is_good_color(VAR_KEYNAME_BACK_COLOR
)){
3001 name_color
= new_color_pair(VAR_KEYNAME_FORE_COLOR
,
3002 VAR_KEYNAME_BACK_COLOR
);
3006 if(keymenu_is_dirty
){
3007 ClearLines(real_row
, real_row
+1);
3008 keymenu_is_dirty
= 0;
3009 /* first time through, set up storage */
3010 if(!last_time_buf
[0].name
){
3011 for(i
= 0; i
< 12; i
++){
3012 last_time
= &last_time_buf
[i
];
3013 last_time
->name
= (char *) fs_get(6*MAX_KEYNAME
+ 1);
3014 last_time
->label
= (char *) fs_get(6*MAX_LABEL
+ 1);
3018 for(i
= 0; i
< 12; i
++)
3019 last_time_buf
[i
].column
= -1;
3022 for(i
= 0; i
< 12; i
++){
3026 dprint((9, "%2d %-7.7s %-10.10s %d\n", i
,
3027 km
== NULL
? "(no km)"
3028 : km
->keys
[e
].name
== NULL
? "(null)"
3030 km
== NULL
? "(no km)"
3031 : km
->keys
[e
].label
== NULL
? "(null)"
3032 : km
->keys
[e
].label
, km
? km
->keys
[e
].column
: 0));
3034 register_key(i
, NO_OP_COMMAND
, "", NULL
, 0, 0, 0, NULL
, NULL
);
3038 ufk
= F_ON(F_USE_FK
, ps_global
);
3039 dprint((9, "row: %d, real_row: %d, column: %d\n", row
,
3042 for(i
= 0; i
< 2; i
++){
3043 int c
, el
, empty
, fkey
, last_in_row
, fix_start
;
3045 char temp
[6*MAX_SCREEN_COLS
+1];
3046 char temp2
[6*MAX_SCREEN_COLS
+1];
3047 char this_label
[6*MAX_LABEL
+1];
3051 if(i
== 1 && !label_color
)
3053 if(i
== 1 && (!label_color
|| !struncmp(term_name
,"cygwin", 6)))
3055 max_column
--; /* Some terminals scroll if you write in the
3056 lower right hand corner. If user has a
3057 label_color set we'll take our chances.
3058 Otherwise, we'd get one cell of Normal. */
3061 * k is the key struct we're working on
3062 * c is the column number
3063 * el is an index into the whole keys array
3064 * Last_time_buf is ordered strangely. It goes row by row instead
3065 * of down each column like km does. J is an index into it.
3067 for(c
= 0, el
= off
+i
, k
= &km
->keys
[el
];
3068 k
< &km
->keys
[off
+12] && c
< max_column
;
3071 if(k
->column
> max_column
)
3076 fkey
= 1 + k
- &km
->keys
[off
];
3078 empty
= (!bitnset(el
,bm
) || !(k
->name
&& *k
->name
));
3079 last_time
= &last_time_buf
[j
];
3080 if(k
+2 < &km
->keys
[off
+12]){
3082 next_col
= last_time_buf
[j
+1].column
;
3083 fix_start
= (k
== &km
->keys
[off
] ||
3084 k
== &km
->keys
[off
+1]) ? k
->column
: 0;
3092 * Make sure there is a space between this label and
3093 * the next name. That is, we prefer a space to the
3094 * extra character of the label because the space
3095 * separates the commands and looks nicer.
3099 char tmp_label
[6*MAX_LABEL
+1];
3101 if(k
->label
[0] == '[' && k
->label
[(l
=strlen(k
->label
))-1] == ']' && l
> 2){
3103 * Can't write in k->label, which might be a constant array.
3105 strncpy(tmp_label
, &k
->label
[1], MIN(sizeof(tmp_label
),l
-2));
3106 tmp_label
[MIN(sizeof(tmp_label
)-1,l
-2)] = '\0';
3108 snprintf(this_label
, sizeof(this_label
), "[%s]", _(tmp_label
));
3111 strncpy(this_label
, _(k
->label
), sizeof(this_label
));
3113 this_label
[sizeof(this_label
)-1] = '\0';
3117 trunc
= (k
+2)->column
- k
->column
3118 - ((k
->name
? utf8_width(k
->name
) : 0) + 1);
3120 * trunc columns available for label but we don't want the label
3121 * to go all the way to the edge
3123 if(utf8_width(this_label
) >= trunc
){
3125 strncpy(tmp_label
, this_label
, sizeof(tmp_label
));
3126 tmp_label
[sizeof(tmp_label
)-1] = '\0';
3127 l
= utf8_pad_to_width(this_label
, tmp_label
, sizeof(this_label
)-2, trunc
-1, 1);
3128 this_label
[l
++] = SPACE
;
3129 this_label
[l
] = '\0';;
3132 this_label
[0] = SPACE
;
3134 this_label
[0] = '\0';
3136 this_label
[sizeof(this_label
)-1] = '\0';
3141 this_label
[0] = '\0';
3143 if(!(k
->column
== last_time
->column
3144 && (last_in_row
|| (k
+2)->column
<= next_col
)
3145 && ((empty
&& !*last_time
->label
&& !*last_time
->name
)
3147 && this_label
&& !strcmp(this_label
,last_time
->label
)
3148 && ((k
->name
&& !strcmp(k
->name
,last_time
->name
))
3151 /* blank out key with spaces */
3152 strncpy(temp
, repeat_char(
3153 ((last_in_row
|| (k
+2)->column
> max_column
)
3159 SPACE
), sizeof(temp
));
3160 temp
[sizeof(temp
)-1] = '\0';
3161 last_time
->column
= k
->column
;
3162 *last_time
->name
= '\0';
3163 *last_time
->label
= '\0';
3164 MoveCursor(real_row
+ i
, column
+ (fix_start
? 0 : k
->column
));
3165 Write_to_screen(temp
);
3166 c
= (fix_start
? 0 : k
->column
) + strlen(temp
);
3169 /* make sure extra space before key name is there */
3171 strncpy(temp
, repeat_char(k
->column
, SPACE
), sizeof(temp
));
3172 temp
[sizeof(temp
)-1] = '\0';
3173 MoveCursor(real_row
+ i
, column
+ 0);
3174 Write_to_screen(temp
);
3177 /* short name of the key */
3179 snprintf(temp
, sizeof(temp
), "F%d", fkey
);
3181 strncpy(temp
, k
->name
, sizeof(temp
));
3183 temp
[sizeof(temp
)-1] = '\0';
3184 last_time
->column
= k
->column
;
3185 strncpy(last_time
->name
, temp
, 6*MAX_KEYNAME
);
3186 last_time
->name
[6*MAX_KEYNAME
] = '\0';
3187 /* make sure name not too long */
3189 strncpy(keystr
, temp
, sizeof(keystr
));
3190 keystr
[sizeof(keystr
)-1] = '\0';
3192 MoveCursor(real_row
+ i
, column
+ k
->column
);
3195 (void)pico_set_colorp(name_color
, PSC_NONE
);
3200 Write_to_screen(temp
);
3201 c
= k
->column
+ utf8_width(temp
);
3207 /* now the space after the name and the label */
3212 strncat(temp
, this_label
, sizeof(temp
)-strlen(temp
)-1);
3214 /* Don't run over the right hand edge */
3215 if(utf8_width(temp
) > max_column
- c
){
3218 l
= utf8_pad_to_width(temp2
, temp
, sizeof(temp2
)-1, max_column
-c
, 1);
3220 strncpy(temp
, temp2
, sizeof(temp
));
3221 temp
[sizeof(temp
)-1] = '\0';
3224 c
+= utf8_width(temp
);
3228 strncat(keystr
, temp
, sizeof(keystr
)-strlen(keystr
)-1);
3229 keystr
[sizeof(keystr
)-1] = '\0';
3231 /* fill out rest of this key with spaces */
3234 strncat(temp
, repeat_char(max_column
- c
, SPACE
), sizeof(temp
)-strlen(temp
)-1);
3238 if(c
< (k
+2)->column
){
3240 repeat_char((k
+2)->column
- c
, SPACE
), sizeof(temp
)-strlen(temp
)-1);
3245 temp
[sizeof(temp
)-1] = '\0';
3248 strncpy(last_time
->label
, this_label
, 6*MAX_LABEL
);
3249 last_time
->label
[6*MAX_LABEL
] = '\0';
3251 (void)pico_set_colorp(label_color
, PSC_NONE
);
3253 Write_to_screen(temp
);
3258 /* fill in what register_key needs from cached data */
3259 snprintf(keystr
, sizeof(keystr
), "%s %s", last_time
->name
, last_time
->label
);
3265 * If label ends in space,
3266 * don't register the space part of label.
3268 len
= strlen(keystr
);
3269 while(keystr
[len
-1] == SPACE
)
3273 register_key(j
, ufk
? PF1
+ fkey
- 1
3274 : (k
->name
[0] == '^')
3276 : (!strucmp(k
->name
, "ret"))
3278 : (!strucmp(k
->name
, "tab"))
3280 : (!strucmp(k
->name
, "spc"))
3282 : (!strucmp(k
->name
, HISTORY_UP_KEYNAME
))
3284 : (!strucmp(k
->name
, HISTORY_DOWN_KEYNAME
))
3287 ? ((isascii((int) k
->bind
.ch
[0]) && islower((int) k
->bind
.ch
[0]))
3288 ? toupper((unsigned char) k
->bind
.ch
[0])
3291 keystr
, print_inverted_label
,
3292 real_row
+i
, k
->column
, len
,
3293 name_color
, label_color
);
3299 while(++j
< 6*(i
+1))
3300 last_time_buf
[j
].column
= -1;
3305 (void)pico_set_colorp(lastc
, PSC_NONE
);
3306 free_color_pair(&lastc
);
3308 free_color_pair(&label_color
);
3310 free_color_pair(&name_color
);
3316 * Clear the key menu lines.
3319 blank_keymenu(int row
, int column
)
3321 struct variable
*vars
= ps_global
->vars
;
3324 if(FOOTER_ROWS(ps_global
) > 1){
3325 km_state
.blanked
= 1;
3327 km_state
.column
= column
;
3328 MoveCursor(row
, column
);
3329 lastc
= pico_set_colors(VAR_KEYLABEL_FORE_COLOR
,
3330 VAR_KEYLABEL_BACK_COLOR
, PSC_NORM
|PSC_RET
);
3333 MoveCursor(row
+1, column
);
3337 (void)pico_set_colorp(lastc
, PSC_NONE
);
3338 free_color_pair(&lastc
);
3345 draw_cancel_keymenu(void)
3350 draw_keymenu(&cancel_keymenu
, bitmap
, ps_global
->ttyo
->screen_cols
,
3351 1-FOOTER_ROWS(ps_global
), 0, FirstMenu
);
3356 clearfooter(struct pine
*ps
)
3358 ClearLines(ps
->ttyo
->screen_rows
- 3, ps
->ttyo
->screen_rows
- 1);
3359 mark_keymenu_dirty();
3360 mark_status_unknown();
3365 * Calculate formatting for key menu at bottom of screen
3367 * Args: km -- The key_menu structure to format
3368 * bm -- Bitmap indicating which menu items should be displayed. If
3369 * an item is NULL, that also means it shouldn't be displayed.
3370 * Sometimes the bitmap will be turned on in that case and just
3371 * rely on the NULL entry.
3372 * width -- the screen width to format it at
3374 * If already formatted for this particular screen width and the requested
3375 * bitmap and formatted bitmap agree, return.
3377 * The formatting results in the column field in the key_menu being
3378 * filled in. The column field is the column to start the label at, the
3379 * name of the key; after that is the label for the key. The basic idea
3380 * is to line up the end of the names and beginning of the labels. If
3381 * the name is too long and shifting it left would run into previous
3382 * label, then shift the whole menu right, or at least that entry if
3383 * things following are short enough to fit back into the regular
3384 * spacing. This has to be calculated and not fixed so it can cope with
3388 format_keymenu(struct key_menu
*km
, unsigned char *bm
, int width
)
3390 int spacing
[7], w
[6], min_w
[6], tw
[6], extra
[6], ufk
, i
, set
;
3392 /* already formatted? */
3393 if(!km
|| (width
== km
->width
&&
3394 km
->how_many
<= km
->formatted_hm
&&
3395 !memcmp(km
->bitmap
, bm
, BM_SIZE
)))
3399 * If we're in the initial command sequence we may be using function
3400 * keys instead of alphas, or vice versa, so we want to recalculate
3401 * the formatting next time through.
3403 if((F_ON(F_USE_FK
,ps_global
) && ps_global
->orig_use_fkeys
) ||
3404 (F_OFF(F_USE_FK
,ps_global
) && !ps_global
->orig_use_fkeys
)){
3406 km
->formatted_hm
= km
->how_many
;
3407 memcpy(km
->bitmap
, bm
, BM_SIZE
);
3410 ufk
= F_ON(F_USE_FK
,ps_global
); /* ufk = "Using Function Keys" */
3412 /* set up "ideal" columns to start in, plus fake 7th column start */
3413 for(i
= 0; i
< 7; i
++)
3414 spacing
[i
] = (i
* width
) / 6;
3416 /* Loop thru each set of 12 menus */
3417 for(set
= 0; set
< km
->how_many
; set
++){
3418 int k_top
, k_bot
, top_name_width
, bot_name_width
,
3419 top_label_width
, bot_label_width
, done
, offset
, next_one
;
3420 struct key
*keytop
, *keybot
;
3422 offset
= set
* 12; /* offset into keymenu */
3425 * Find the required widths for each box.
3427 for(i
= 0; i
< 6; i
++){
3428 k_top
= offset
+ i
*2;
3430 keytop
= &km
->keys
[k_top
];
3431 keybot
= &km
->keys
[k_bot
];
3434 * The width of a box is the max width of top or bottom name,
3435 * plus 1 space, plus the max width of top or bottom label.
3439 * ||||||||||| = 2 + 1 + 8 = 11
3441 * Then we adjust that by adding one space after the box to
3442 * separate it from the next box. The last box doesn't need that
3443 * but we may need an extra space for last box to avoid putting
3444 * a character in the lower right hand cell of display.
3445 * We also have a minimum label width (if screen is really narrow)
3446 * of 3, so at least "Hel" and "Can" shows and the rest gets
3447 * truncated off right hand side.
3450 top_name_width
= (keytop
->name
&& bitnset(k_top
,bm
))
3451 ? (ufk
? (i
>= 5 ? 3 : 2)
3452 : utf8_width(keytop
->name
)) : 0;
3453 bot_name_width
= (keybot
->name
&& bitnset(k_bot
,bm
))
3454 ? (ufk
? (i
>= 4 ? 3 : 2)
3455 : utf8_width(keybot
->name
)) : 0;
3457 * Labels are complicated by the fact that we want to look
3458 * up their translation, but also by the fact that we surround
3459 * the word with brackets like [ViewMsg] when the command is
3460 * the default. We want to look up the translation of the
3461 * part inside the brackets, not the whole thing.
3463 if(keytop
->label
&& bitnset(k_top
,bm
)){
3464 char tmp_label
[6*MAX_LABEL
+1];
3467 if(keytop
->label
[0] == '[' && keytop
->label
[(l
=strlen(keytop
->label
))-1] == ']' && l
> 2){
3469 * Can't write in k->label, which might be a constant array.
3471 strncpy(tmp_label
, &keytop
->label
[1], MIN(sizeof(tmp_label
),l
-2));
3472 tmp_label
[MIN(sizeof(tmp_label
)-1,l
-2)] = '\0';
3474 top_label_width
= 2 + utf8_width(_(tmp_label
));
3477 top_label_width
= utf8_width(_(keytop
->label
));
3480 top_label_width
= 0;
3482 if(keybot
->label
&& bitnset(k_bot
,bm
)){
3483 char tmp_label
[6*MAX_LABEL
+1];
3486 if(keybot
->label
[0] == '[' && keybot
->label
[(l
=strlen(keybot
->label
))-1] == ']' && l
> 2){
3487 strncpy(tmp_label
, &keybot
->label
[1], MIN(sizeof(tmp_label
),l
-2));
3488 tmp_label
[MIN(sizeof(tmp_label
)-1,l
-2)] = '\0';
3490 bot_label_width
= 2 + utf8_width(_(tmp_label
));
3493 bot_label_width
= utf8_width(_(keybot
->label
));
3496 bot_label_width
= 0;
3499 * The 1 for i < 5 is the space between adjacent boxes.
3500 * The last 1 or 0 when i == 5 is so that we won't try to put
3501 * a character in the lower right cell of the display, since that
3502 * causes a linefeed on some terminals.
3504 w
[i
] = MAX(top_name_width
, bot_name_width
) + 1 +
3505 MAX(top_label_width
, bot_label_width
) +
3507 : ((bot_label_width
>= top_label_width
) ? 1 : 0));
3510 * The smallest we'll squeeze a column.
3512 * X ABCDEF we'll squeeze to X ABC
3515 min_w
[i
] = MAX(top_name_width
, bot_name_width
) + 1 +
3516 MIN(MAX(top_label_width
, bot_label_width
), 3) +
3518 : ((bot_label_width
>= top_label_width
) ? 1 : 0));
3520 /* init trial width */
3521 tw
[i
] = spacing
[i
+1] - spacing
[i
];
3522 extra
[i
] = tw
[i
] - w
[i
]; /* negative if it doesn't fit */
3526 * See if we can fit everything on the screen.
3530 int smallest_extra
, how_small
;
3532 /* Find smallest extra */
3533 smallest_extra
= -1;
3535 for(i
= 0; i
< 6; i
++){
3536 if(extra
[i
] < how_small
){
3538 how_small
= extra
[i
];
3542 if(how_small
>= 0) /* everything fits */
3545 int take_from
, how_close
;
3548 * Find the one that is closest to the ideal width
3549 * that has some extra to spare.
3553 for(i
= 0; i
< 6; i
++){
3555 ((spacing
[i
+1]-spacing
[i
]) - tw
[i
]) < how_close
){
3557 how_close
= (spacing
[i
+1]-spacing
[i
]) - tw
[i
];
3563 * Found one. Take one from take_from and add it
3564 * to the smallest_extra.
3566 tw
[smallest_extra
]++;
3567 extra
[smallest_extra
]++;
3575 * Oops. Not enough space to fit everything in.
3576 * Some of the labels are truncated. Some may even be
3577 * truncated past the minimum. We make sure that each
3578 * field is at least its minimum size, and then we cut
3579 * back those over the minimum until we can fit all the
3580 * minimal names on the screen (if possible).
3582 for(i
= 0; i
< 6; i
++)
3583 tw
[i
] = MAX(tw
[i
], min_w
[i
]);
3586 for(i
= 0; i
< 6; i
++)
3587 used_width
+= tw
[i
];
3589 while(used_width
> width
&& !done
){
3590 int candidate
, excess
;
3593 * Find the one with the most width over it's
3598 for(i
= 0; i
< 6; i
++){
3599 if(tw
[i
] - min_w
[i
] > excess
){
3601 excess
= tw
[i
] - min_w
[i
];
3619 * Assign the format we came up with to the keymenu.
3622 for(i
= 0; i
< 6; i
++){
3623 k_top
= offset
+ i
*2;
3625 keytop
= &km
->keys
[k_top
];
3626 keybot
= &km
->keys
[k_bot
];
3627 top_name_width
= (keytop
->name
&& bitnset(k_top
,bm
))
3628 ? (ufk
? (i
>= 5 ? 3 : 2)
3629 : utf8_width(keytop
->name
)) : 0;
3630 bot_name_width
= (keybot
->name
&& bitnset(k_bot
,bm
))
3631 ? (ufk
? (i
>= 4 ? 3 : 2)
3632 : utf8_width(keybot
->name
)) : 0;
3634 if(top_name_width
>= bot_name_width
){
3635 keytop
->column
= next_one
;
3636 keybot
->column
= next_one
+ (top_name_width
- bot_name_width
);
3639 keytop
->column
= next_one
+ (bot_name_width
- top_name_width
);
3640 keybot
->column
= next_one
;
3650 * Draw the key menu at bottom of screen
3652 * Args: km -- key_menu structure
3653 * bitmap -- which fields are active
3654 * width -- the screen width to format it at
3655 * row -- where to put it
3656 * column -- where to put it
3657 * what -- this is an enum telling us whether to display the
3658 * first menu (first set of 12 keys), or to display the same
3659 * one we displayed last time, or to display a particular
3660 * one (which), or to display the next one.
3662 * Fields are inactive if *either* the corresponding bitmap entry is 0 *or*
3663 * the actual entry in the key_menu is NULL. Therefore, it is sometimes
3664 * useful to just turn on all the bits in a bitmap and let the NULLs take
3665 * care of it. On the other hand, the bitmap gives a convenient method
3666 * for turning some keys on or off dynamically or due to options.
3667 * Both methods are used about equally.
3669 * Also saves the state for a possible redraw later.
3671 * Row should usually be a negative number. If row is 0, the menu is not
3675 draw_keymenu(struct key_menu
*km
, unsigned char *bitmap
, int width
, int row
,
3676 int column
, OtherMenu what
)
3679 configure_menu_items (km
, bitmap
);
3681 format_keymenu(km
, bitmap
, width
);
3683 /*--- save state for a possible redraw ---*/
3686 km_state
.column
= column
;
3687 memcpy(km_state
.bitmap
, bitmap
, BM_SIZE
);
3692 if(km_state
.blanked
)
3693 keymenu_is_dirty
= 1;
3695 if(what
== FirstMenu
|| what
== SecondMenu
|| what
== ThirdMenu
||
3696 what
== FourthMenu
|| what
== MenuNotSet
){
3697 if(what
== FirstMenu
|| what
== MenuNotSet
)
3699 else if(what
== SecondMenu
)
3701 else if(what
== ThirdMenu
)
3703 else if(what
== FourthMenu
)
3706 if(km
->which
>= km
->how_many
)
3709 else if(what
== NextMenu
)
3710 km
->which
= (km
->which
+ 1) % km
->how_many
;
3711 /* else what must be SameMenu */
3713 output_keymenu(km
, bitmap
, row
, column
);
3715 km_state
.blanked
= 0;
3720 redraw_keymenu(void)
3722 if(km_state
.blanked
)
3723 blank_keymenu(km_state
.row
, km_state
.column
);
3725 draw_keymenu(km_state
.km
, km_state
.bitmap
, ps_global
->ttyo
->screen_cols
,
3726 km_state
.row
, km_state
.column
, SameMenu
);
3731 * end_keymenu - free resources associated with keymenu display cache
3738 for(i
= 0; i
< 12; i
++){
3739 if(last_time_buf
[i
].name
)
3740 fs_give((void **) &last_time_buf
[i
].name
);
3742 if(last_time_buf
[i
].label
)
3743 fs_give((void **) &last_time_buf
[i
].label
);
3748 /*----------------------------------------------------------------------
3749 Reveal Keymenu to Pine Command mappings
3755 menu_command(UCS keystroke
, struct key_menu
*menu
)
3759 if(keystroke
== KEY_UTF8
|| keystroke
== KEY_UNKNOWN
)
3765 if(F_ON(F_USE_FK
,ps_global
)){
3766 /* No alpha commands permitted in function key mode */
3767 if(keystroke
< 0x80 && isalpha((unsigned char) keystroke
))
3770 /* Tres simple: compute offset, and test */
3771 if(keystroke
>= F1
&& keystroke
<= F12
){
3772 n
= (menu
->which
* 12) + (keystroke
- F1
);
3773 if(bitnset(n
, menu
->bitmap
))
3774 return(menu
->keys
[n
].bind
.cmd
);
3777 else if(keystroke
>= F1
&& keystroke
<= F12
)
3780 /* if ascii, coerce lower case */
3781 if(keystroke
< 0x80 && isupper((unsigned char) keystroke
))
3782 keystroke
= tolower((unsigned char) keystroke
);
3784 /* keep this here for Windows port */
3785 if((keystroke
= validatekeys(keystroke
)) == KEY_JUNK
)
3788 /* Scan the list for any keystroke/command binding */
3789 if(keystroke
!= NO_OP_COMMAND
)
3790 for(i
= (menu
->how_many
* 12) - 1; i
>= 0; i
--)
3791 if(bitnset(i
, menu
->bitmap
))
3792 for(n
= menu
->keys
[i
].bind
.nch
- 1; n
>= 0; n
--)
3793 if(keystroke
== menu
->keys
[i
].bind
.ch
[n
])
3794 return(menu
->keys
[i
].bind
.cmd
);
3797 * If explicit mapping failed, check feature mappings and
3798 * hardwired defaults...
3800 if(F_ON(F_ENABLE_PRYNT
,ps_global
)
3801 && (keystroke
== 'y' || keystroke
== 'Y')){
3802 /* SPECIAL CASE: Scan the list for print bindings */
3803 for(i
= (menu
->how_many
* 12) - 1; i
>= 0; i
--)
3804 if(bitnset(i
, menu
->bitmap
))
3805 if(menu
->keys
[i
].bind
.cmd
== MC_PRINTMSG
3806 || menu
->keys
[i
].bind
.cmd
== MC_PRINTTXT
)
3807 return(menu
->keys
[i
].bind
.cmd
);
3810 if(F_ON(F_ENABLE_LESSTHAN_EXIT
,ps_global
)
3811 && (keystroke
== '<' || keystroke
== ','
3812 || (F_ON(F_ARROW_NAV
,ps_global
) && keystroke
== KEY_LEFT
))){
3813 /* SPECIAL CASE: Scan the list for MC_EXIT bindings */
3814 for(i
= (menu
->how_many
* 12) - 1; i
>= 0; i
--)
3815 if(bitnset(i
, menu
->bitmap
))
3816 if(menu
->keys
[i
].bind
.cmd
== MC_EXIT
)
3821 * If no match after scanning bindings, try universally
3822 * bound keystrokes...
3834 return(MC_CHARDOWN
);
3838 return(MC_CHARRIGHT
);
3842 return(MC_CHARLEFT
);
3858 if(USER_INPUT_TIMEOUT(ps_global
))
3859 user_input_timeout_exit(ps_global
->hours_to_timeout
); /* no return */
3867 return(MC_UNKNOWN
); /* utter failure */
3872 /*----------------------------------------------------------------------
3873 Set up a binding for cmd, with one key bound to it.
3874 Use menu_add_binding to add more keys to this binding.
3876 Args: menu -- the keymenu
3877 key -- the initial key to bind to
3878 cmd -- the command to initialize to
3879 name -- a pointer to the string to point name to
3880 label -- a pointer to the string to point label to
3881 keynum -- which key in the keys array to initialize
3883 For translation purposes, the label in the calling routine
3884 should be wrapped in an N_() macro.
3888 menu_init_binding(struct key_menu
*menu
, UCS key
, int cmd
, char *name
, char *label
, int keynum
)
3890 /* if ascii, coerce to lower case */
3891 if(key
< 0x80 && isupper((unsigned char)key
))
3892 key
= tolower((unsigned char)key
);
3894 /* remove binding from any other key */
3895 menu_clear_cmd_binding(menu
, cmd
);
3897 menu
->keys
[keynum
].name
= name
;
3898 menu
->keys
[keynum
].label
= label
;
3899 menu
->keys
[keynum
].bind
.cmd
= cmd
;
3900 menu
->keys
[keynum
].bind
.nch
= 0;
3901 menu
->keys
[keynum
].bind
.ch
[menu
->keys
[keynum
].bind
.nch
++] = key
;
3905 /*----------------------------------------------------------------------
3906 Add a key/command binding to the given keymenu structure
3912 menu_add_binding(struct key_menu
*menu
, UCS key
, int cmd
)
3916 /* NOTE: cmd *MUST* already have had a binding */
3917 for(i
= (menu
->how_many
* 12) - 1; i
>= 0; i
--)
3918 if(menu
->keys
[i
].bind
.cmd
== cmd
){
3919 for(n
= menu
->keys
[i
].bind
.nch
- 1;
3920 n
>= 0 && key
!= menu
->keys
[i
].bind
.ch
[n
];
3924 /* if ascii, coerce to lower case */
3925 if(key
< 0x80 && isupper((unsigned char)key
))
3926 key
= tolower((unsigned char)key
);
3928 if(n
< 0) /* not already bound, bind it */
3929 menu
->keys
[i
].bind
.ch
[menu
->keys
[i
].bind
.nch
++] = key
;
3936 /*----------------------------------------------------------------------
3937 REMOVE a key/command binding from the given keymenu structure
3943 menu_clear_binding(struct key_menu
*menu
, UCS key
)
3947 /* if ascii, coerce to lower case */
3948 if(key
< 0x80 && isupper((unsigned char)key
))
3949 key
= tolower((unsigned char)key
);
3951 for(i
= (menu
->how_many
* 12) - 1; i
>= 0; i
--)
3952 for(n
= menu
->keys
[i
].bind
.nch
- 1; n
>= 0; n
--)
3953 if(key
== menu
->keys
[i
].bind
.ch
[n
]){
3954 int cmd
= menu
->keys
[i
].bind
.cmd
;
3956 for(--menu
->keys
[i
].bind
.nch
; n
< menu
->keys
[i
].bind
.nch
; n
++)
3957 menu
->keys
[i
].bind
.ch
[n
] = menu
->keys
[i
].bind
.ch
[n
+1];
3967 menu_clear_cmd_binding(struct key_menu
*menu
, int cmd
)
3971 for(i
= (menu
->how_many
* 12) - 1; i
>= 0; i
--){
3972 if(cmd
== menu
->keys
[i
].bind
.cmd
){
3973 menu
->keys
[i
].name
= NULL
;
3974 menu
->keys
[i
].label
= NULL
;
3975 menu
->keys
[i
].bind
.cmd
= 0;
3976 menu
->keys
[i
].bind
.nch
= 0;
3977 menu
->keys
[i
].bind
.ch
[0] = 0;
3984 menu_binding_index(struct key_menu
*menu
, int cmd
)
3988 for(i
= 0; i
< menu
->how_many
* 12; i
++)
3989 if(cmd
== menu
->keys
[i
].bind
.cmd
)
3998 * print_inverted_label - highlight the label of the given menu item.
3999 * (callback from pico mouse routines)
4001 * So far, this is only
4002 * ever called with the top left row equal to the bottom right row.
4003 * If you change that you probably need to fix it.
4006 print_inverted_label(int state
, MENUITEM
*m
)
4009 int col_offsetwid
, col_offsetchars
, do_color
= 0, skipwid
= 0, skipchars
= 0, len
, c
;
4012 char labelpart
[100];
4014 COLOR_PAIR
*name_color
= NULL
, *label_color
= NULL
, *lastc
= NULL
;
4015 struct variable
*vars
= ps_global
->vars
;
4017 if(m
->label
&& (lp
=strchr(m
->label
, ' '))){
4022 col_offsetwid
= utf8_width(m
->label
);
4023 col_offsetchars
= lp
- m
->label
;
4027 col_offsetwid
= col_offsetchars
= 0;
4029 if(pico_usingcolor() && ((VAR_KEYLABEL_FORE_COLOR
&&
4030 VAR_KEYLABEL_BACK_COLOR
) ||
4031 (VAR_KEYNAME_FORE_COLOR
&&
4032 VAR_KEYNAME_BACK_COLOR
))){
4033 lastc
= pico_get_cur_color();
4035 if(VAR_KEYNAME_FORE_COLOR
&& VAR_KEYNAME_BACK_COLOR
){
4036 name_color
= state
? new_color_pair(VAR_KEYNAME_BACK_COLOR
,
4037 VAR_KEYNAME_FORE_COLOR
)
4038 : new_color_pair(VAR_KEYNAME_FORE_COLOR
,
4039 VAR_KEYNAME_BACK_COLOR
);
4041 else if(VAR_REV_FORE_COLOR
&& VAR_REV_BACK_COLOR
)
4042 name_color
= new_color_pair(VAR_REV_FORE_COLOR
, VAR_REV_BACK_COLOR
);
4044 if(VAR_KEYLABEL_FORE_COLOR
&& VAR_KEYLABEL_BACK_COLOR
){
4045 label_color
= state
? new_color_pair(VAR_KEYLABEL_BACK_COLOR
,
4046 VAR_KEYLABEL_FORE_COLOR
)
4047 : new_color_pair(VAR_KEYLABEL_FORE_COLOR
,
4048 VAR_KEYLABEL_BACK_COLOR
);
4050 else if(VAR_REV_FORE_COLOR
&& VAR_REV_BACK_COLOR
){
4051 label_color
= state
? new_color_pair(VAR_REV_FORE_COLOR
,
4053 : new_color_pair(VAR_NORM_FORE_COLOR
,
4054 VAR_NORM_BACK_COLOR
);
4058 * See if we can grok all these colors. If not, we're going to
4059 * punt and pretend there are no colors at all.
4061 if(!pico_is_good_colorpair(name_color
) ||
4062 !pico_is_good_colorpair(label_color
)){
4064 free_color_pair(&name_color
);
4066 free_color_pair(&label_color
);
4068 free_color_pair(&lastc
);
4072 (void)pico_set_colorp(label_color
, PSC_NONE
);
4073 if(!(VAR_KEYLABEL_FORE_COLOR
&& VAR_KEYLABEL_BACK_COLOR
)){
4084 * Command name's already inverted, leave it.
4086 skipwid
= state
? 0 : col_offsetwid
;
4087 skipchars
= state
? 0 : col_offsetchars
;
4094 MoveCursor((int)(m
->tl
.r
), (int)(m
->tl
.c
) + skipwid
);
4096 label
= m
->label
? m
->label
: "";
4097 len
= strlen(label
);
4100 * this is a bit complicated by the fact that we have to keep track of
4101 * the screenwidth as we print the label, because the screenwidth might
4102 * not be the same as the number of characters.
4103 * UNTESTED SINCE switching to UTF-8 *
4105 for(i
= m
->tl
.r
; i
<= m
->br
.r
; i
++){
4106 /* collect part before name */
4107 for(k
=0, j
= m
->tl
.c
+ skipchars
; j
< MIN(m
->lbl
.c
,m
->br
.c
); j
++){
4108 if(k
< sizeof(prename
))
4112 if(k
< sizeof(prename
))
4115 /* collect name part */
4116 for(k
=0; j
< MIN(m
->lbl
.c
+col_offsetchars
,m
->br
.c
); j
++){
4117 c
= (i
== m
->lbl
.r
&&
4118 j
- m
->lbl
.c
< len
) ? label
[j
- m
->lbl
.c
] : ' ';
4119 if(k
< sizeof(namepart
))
4123 if(k
< sizeof(namepart
))
4126 /* collect label part */
4127 for(k
=0; j
<= m
->br
.c
; j
++){
4128 c
= (i
== m
->lbl
.r
&&
4129 j
- m
->lbl
.c
< len
) ? label
[j
- m
->lbl
.c
] : ' ';
4130 if(k
< sizeof(labelpart
))
4134 if(k
< sizeof(labelpart
))
4135 labelpart
[k
] = '\0';
4139 Write_to_screen(prename
);
4142 if(name_color
&& col_offsetchars
)
4143 (void) pico_set_colorp(name_color
, PSC_NONE
);
4145 Write_to_screen(namepart
);
4149 if(name_color
&& col_offsetchars
){
4151 (void) pico_set_colorp(label_color
, PSC_NONE
);
4160 Write_to_screen(labelpart
);
4165 (void)pico_set_colorp(lastc
, PSC_NONE
);
4166 free_color_pair(&lastc
);
4171 pico_set_normal_color();
4174 free_color_pair(&name_color
);
4176 free_color_pair(&label_color
);
4188 * This function scans the key menu and calls mswin.c functions
4189 * to build a corresponding windows menu.
4192 configure_menu_items (struct key_menu
*km
, bitmap_t bitmap
)
4198 mswin_menuitemclear ();
4203 for (i
= 0, k
= km
->keys
; i
< km
->how_many
* 12; i
++, k
++) {
4204 if (k
->name
!= NULL
&& k
->label
!= NULL
&& bitnset (i
, bitmap
) &&
4205 k
->menuitem
!= KS_NONE
) {
4207 if (k
->name
[0] == '^')
4208 key
= ctrl(k
->name
[1]);
4209 else if (strcmp(k
->name
, "Ret") == 0)
4211 else if (strcmp(k
->name
, "Spc") == 0)
4216 mswin_menuitemadd (key
, k
->label
, k
->menuitem
, 0);