summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sade/misc.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1997-01-29 21:16:07 +0000
committerjkh <jkh@FreeBSD.org>1997-01-29 21:16:07 +0000
commitac85456797b8074dad5c1af1bb141abb9206d6ec (patch)
tree83e9095e674d2b5b7677942ffdfd7332a9da62a1 /usr.sbin/sade/misc.c
parent0b1072afc897dc6d26f0ca8ff58a0e989a760229 (diff)
downloadFreeBSD-src-ac85456797b8074dad5c1af1bb141abb9206d6ec.zip
FreeBSD-src-ac85456797b8074dad5c1af1bb141abb9206d6ec.tar.gz
Fix broken layout help (this is what broke the TCP help screen).
Allow DITEM_NO_ECHO to be encoded in layout field types and make user.c use it for the password item.
Diffstat (limited to 'usr.sbin/sade/misc.c')
-rw-r--r--usr.sbin/sade/misc.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/usr.sbin/sade/misc.c b/usr.sbin/sade/misc.c
index 19fd9de..e7d4063 100644
--- a/usr.sbin/sade/misc.c
+++ b/usr.sbin/sade/misc.c
@@ -347,18 +347,17 @@ Mount(char *mountp, void *dev)
WINDOW *
openLayoutDialog(char *helpfile, char *title, int x, int y, int width, int height)
{
- WINDOW *win;
- char help[FILENAME_MAX];
-
+ WINDOW *win;
+ static char help[FILENAME_MAX];
+
/* We need a curses window */
win = newwin(LINES, COLS, 0, 0);
if (win) {
/* Say where our help comes from */
if (helpfile) {
- systemHelpFile(helpfile, help);
- use_helpfile(help);
+ use_helpline("Press F1 for more information on this screen.");
+ use_helpfile(systemHelpFile(helpfile, help));
}
-
/* Setup a nice screen for us to splat stuff onto */
draw_box(win, y, x, height, width, dialog_attr, border_attr);
wattrset(win, dialog_attr);
@@ -378,10 +377,13 @@ initLayoutDialog(WINDOW *win, Layout *layout, int x, int y, int *max)
n = 0;
while (layout[n].help != NULL) {
- switch (layout[n].type) {
+ int t = TYPE_OF_OBJ(layout[n].type);
+
+ switch (t) {
case STRINGOBJ:
layout[n].obj = NewStringObj(win, layout[n].prompt, layout[n].var,
layout[n].y + y, layout[n].x + x, layout[n].len, layout[n].maxlen);
+ ((StringObj *)layout[n].obj)->attr_mask = ATTR_OF_OBJ(layout[n].type);
break;
case BUTTONOBJ:
@@ -391,7 +393,7 @@ initLayoutDialog(WINDOW *win, Layout *layout, int x, int y, int *max)
default:
msgFatal("Don't support this object yet!");
}
- AddObj(&obj, layout[n].type, (void *) layout[n].obj);
+ AddObj(&obj, t, (void *) layout[n].obj);
n++;
}
*max = n - 1;
@@ -412,6 +414,7 @@ layoutDialogLoop(WINDOW *win, Layout *layout, ComposeObj **obj, int *n, int max,
help_line[i] = '\0';
use_helpline(help_line);
display_helpline(win, LINES - 1, COLS - 1);
+ wrefresh(win);
/* Ask for libdialog to do its stuff */
ret = PollObj(obj);
OpenPOWER on IntegriCloud