top: the bottom 'window' headings are now translatable <=== port of newlib 20859f6f
______________________________ original newlib message --------------------------------------------- ( none ) Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
16
top/top.c
16
top/top.c
@ -132,7 +132,7 @@ static int Bot_task,
|
|||||||
Bot_rsvd,
|
Bot_rsvd,
|
||||||
Bot_indx = BOT_UNFOCUS;
|
Bot_indx = BOT_UNFOCUS;
|
||||||
static char Bot_sep,
|
static char Bot_sep,
|
||||||
*Bot_name,
|
*Bot_head,
|
||||||
Bot_buf[BOTBUFSIZ]; // the 'environ' can be huge
|
Bot_buf[BOTBUFSIZ]; // the 'environ' can be huge
|
||||||
typedef int(*BOT_f)(const void *, const void *);
|
typedef int(*BOT_f)(const void *, const void *);
|
||||||
static BOT_f Bot_focus_func;
|
static BOT_f Bot_focus_func;
|
||||||
@ -5253,7 +5253,7 @@ static void *bot_item_hlp (proc_t *p) {
|
|||||||
* This guy manages the bottom margin window, |
|
* This guy manages the bottom margin window, |
|
||||||
* showing miscellaneous variable width data. | */
|
* showing miscellaneous variable width data. | */
|
||||||
static void bot_item_show (void) {
|
static void bot_item_show (void) {
|
||||||
#define mkHDR fmtmk("%s for pid %d, %s", Bot_name, Bot_task, p->cmd)
|
#define mkHDR fmtmk(Bot_head, Bot_task, p->cmd)
|
||||||
proc_t *p;
|
proc_t *p;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -5278,7 +5278,7 @@ static void bot_item_show (void) {
|
|||||||
/*
|
/*
|
||||||
* This guy toggles between displaying a Ctrl |
|
* This guy toggles between displaying a Ctrl |
|
||||||
* bottom window or arranging to turn it off. | */
|
* bottom window or arranging to turn it off. | */
|
||||||
static void bot_item_toggle (int what, const char *name, char sep) {
|
static void bot_item_toggle (int what, const char *head, char sep) {
|
||||||
// if already targeted, assume user wants to turn it off ...
|
// if already targeted, assume user wants to turn it off ...
|
||||||
if (Bot_what == what) {
|
if (Bot_what == what) {
|
||||||
BOT_TOSS;
|
BOT_TOSS;
|
||||||
@ -5296,7 +5296,7 @@ static void bot_item_toggle (int what, const char *name, char sep) {
|
|||||||
Bot_sep = sep;
|
Bot_sep = sep;
|
||||||
Bot_what = what;
|
Bot_what = what;
|
||||||
Bot_indx = BOT_UNFOCUS;
|
Bot_indx = BOT_UNFOCUS;
|
||||||
Bot_name = (char *)name;
|
Bot_head = (char *)head;
|
||||||
Bot_show_func = bot_item_show;
|
Bot_show_func = bot_item_show;
|
||||||
Bot_task = Curwin->ppt[Curwin->begtask]->tid;
|
Bot_task = Curwin->ppt[Curwin->begtask]->tid;
|
||||||
}
|
}
|
||||||
@ -5685,17 +5685,17 @@ static void keys_global (int ch) {
|
|||||||
break;
|
break;
|
||||||
case kbd_CtrlK:
|
case kbd_CtrlK:
|
||||||
// with string vectors, the 'separator' may serve a different purpose
|
// with string vectors, the 'separator' may serve a different purpose
|
||||||
bot_item_toggle(PROC_FILLARG, "command line", BOT_SEP_SPC);
|
bot_item_toggle(PROC_FILLARG, N_fmt(X_BOT_cmdlin_fmt), BOT_SEP_SPC);
|
||||||
break;
|
break;
|
||||||
case kbd_CtrlN:
|
case kbd_CtrlN:
|
||||||
// with string vectors, the 'separator' may serve a different purpose
|
// with string vectors, the 'separator' may serve a different purpose
|
||||||
bot_item_toggle(PROC_FILLENV, "environment", BOT_SEP_SPC);
|
bot_item_toggle(PROC_FILLENV, N_fmt(X_BOT_envirn_fmt), BOT_SEP_SPC);
|
||||||
break;
|
break;
|
||||||
case kbd_CtrlP:
|
case kbd_CtrlP:
|
||||||
bot_item_toggle((L_NS), "namespaces", BOT_SEP_CMA);
|
bot_item_toggle((L_NS), N_fmt(X_BOT_namesp_fmt), BOT_SEP_CMA);
|
||||||
break;
|
break;
|
||||||
case kbd_CtrlU:
|
case kbd_CtrlU:
|
||||||
bot_item_toggle((L_SUPGRP), "supplementary groups", BOT_SEP_CMA);
|
bot_item_toggle((L_SUPGRP), N_fmt(X_BOT_supgrp_fmt), BOT_SEP_CMA);
|
||||||
break;
|
break;
|
||||||
case kbd_BTAB:
|
case kbd_BTAB:
|
||||||
if (Bot_what) {
|
if (Bot_what) {
|
||||||
|
@ -832,7 +832,7 @@ typedef struct WIN_t {
|
|||||||
//atic int bot_focus_strv (const char *hdr, const char **strv);
|
//atic int bot_focus_strv (const char *hdr, const char **strv);
|
||||||
//atic void *bot_item_hlp (proc_t *p);
|
//atic void *bot_item_hlp (proc_t *p);
|
||||||
//atic void bot_item_show (void);
|
//atic void bot_item_show (void);
|
||||||
//atic void bot_item_toggle (int what, const char *name, char sep);
|
//atic void bot_item_toggle (int what, const char *head, char sep);
|
||||||
/*------ Interactive Input Tertiary support ----------------------------*/
|
/*------ Interactive Input Tertiary support ----------------------------*/
|
||||||
//atic inline int find_ofs (const WIN_t *q, const char *buf);
|
//atic inline int find_ofs (const WIN_t *q, const char *buf);
|
||||||
//atic void find_string (int ch);
|
//atic void find_string (int ch);
|
||||||
|
@ -524,6 +524,11 @@ static void build_norm_nlstab (void) {
|
|||||||
Norm_nlstab[XTRA_size2up_txt] = _("terminal is not wide enough");
|
Norm_nlstab[XTRA_size2up_txt] = _("terminal is not wide enough");
|
||||||
Norm_nlstab[XTRA_modebad_txt] = _("wrong mode, command inactive");
|
Norm_nlstab[XTRA_modebad_txt] = _("wrong mode, command inactive");
|
||||||
Norm_nlstab[XTRA_warnold_txt] = _("saving prevents older top from reading, save anyway?");
|
Norm_nlstab[XTRA_warnold_txt] = _("saving prevents older top from reading, save anyway?");
|
||||||
|
Norm_nlstab[X_BOT_cmdlin_fmt] = _("command line for pid %d, %s");
|
||||||
|
Norm_nlstab[X_BOT_ctlgrp_fmt] = _("control groups for pid %d, %s");
|
||||||
|
Norm_nlstab[X_BOT_envirn_fmt] = _("environment for pid %d, %s");
|
||||||
|
Norm_nlstab[X_BOT_namesp_fmt] = _("namespaces for pid %d, %s");
|
||||||
|
Norm_nlstab[X_BOT_supgrp_fmt] = _("supplementary groups for pid %d, %s");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -84,6 +84,8 @@ enum norm_nls {
|
|||||||
WORD_process_txt, WORD_threads_txt, WRITE_rcfile_fmt, WRONG_switch_fmt,
|
WORD_process_txt, WORD_threads_txt, WRITE_rcfile_fmt, WRONG_switch_fmt,
|
||||||
XTRA_badflds_fmt, XTRA_fixwide_fmt, XTRA_modebad_txt, XTRA_size2up_txt,
|
XTRA_badflds_fmt, XTRA_fixwide_fmt, XTRA_modebad_txt, XTRA_size2up_txt,
|
||||||
XTRA_vforest_fmt, XTRA_warncfg_txt, XTRA_warnold_txt, XTRA_winsize_txt,
|
XTRA_vforest_fmt, XTRA_warncfg_txt, XTRA_warnold_txt, XTRA_winsize_txt,
|
||||||
|
X_BOT_cmdlin_fmt, X_BOT_ctlgrp_fmt, X_BOT_envirn_fmt, X_BOT_namesp_fmt,
|
||||||
|
X_BOT_supgrp_fmt,
|
||||||
YINSP_demo01_txt, YINSP_demo02_txt, YINSP_demo03_txt, YINSP_deqfmt_txt,
|
YINSP_demo01_txt, YINSP_demo02_txt, YINSP_demo03_txt, YINSP_deqfmt_txt,
|
||||||
YINSP_deqtyp_txt, YINSP_dstory_txt,
|
YINSP_deqtyp_txt, YINSP_dstory_txt,
|
||||||
YINSP_failed_fmt, YINSP_noent1_txt, YINSP_noent2_txt, YINSP_pidbad_fmt,
|
YINSP_failed_fmt, YINSP_noent1_txt, YINSP_noent2_txt, YINSP_pidbad_fmt,
|
||||||
|
Reference in New Issue
Block a user