git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
scripts
/
kconfig
/
lxdialog
/
yesno.c
diff --git
a/scripts/kconfig/lxdialog/yesno.c
b/scripts/kconfig/lxdialog/yesno.c
index
cb2568a
..
ee0a04e
100644
(file)
--- a/
scripts/kconfig/lxdialog/yesno.c
+++ b/
scripts/kconfig/lxdialog/yesno.c
@@
-44,6
+44,12
@@
int dialog_yesno(const char *title, const char *prompt, int height, int width)
int i, x, y, key = 0, button = 0;
WINDOW *dialog;
int i, x, y, key = 0, button = 0;
WINDOW *dialog;
+do_resize:
+ if (getmaxy(stdscr) < (height + 4))
+ return -ERRDISPLAYTOOSMALL;
+ if (getmaxx(stdscr) < (width + 4))
+ return -ERRDISPLAYTOOSMALL;
+
/* center dialog box on screen */
x = (COLS - width) / 2;
y = (LINES - height) / 2;
/* center dialog box on screen */
x = (COLS - width) / 2;
y = (LINES - height) / 2;
@@
-53,22
+59,23
@@
int dialog_yesno(const char *title, const char *prompt, int height, int width)
dialog = newwin(height, width, y, x);
keypad(dialog, TRUE);
dialog = newwin(height, width, y, x);
keypad(dialog, TRUE);
- draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr);
- wattrset(dialog, border_attr);
+ draw_box(dialog, 0, 0, height, width,
+ dlg.dialog.atr, dlg.border.atr);
+ wattrset(dialog, dlg.border.atr);
mvwaddch(dialog, height - 3, 0, ACS_LTEE);
for (i = 0; i < width - 2; i++)
waddch(dialog, ACS_HLINE);
mvwaddch(dialog, height - 3, 0, ACS_LTEE);
for (i = 0; i < width - 2; i++)
waddch(dialog, ACS_HLINE);
- wattrset(dialog, d
ialog_at
tr);
+ wattrset(dialog, d
lg.dialog.a
tr);
waddch(dialog, ACS_RTEE);
print_title(dialog, title, width);
waddch(dialog, ACS_RTEE);
print_title(dialog, title, width);
- wattrset(dialog, d
ialog_at
tr);
+ wattrset(dialog, d
lg.dialog.a
tr);
print_autowrap(dialog, prompt, width - 2, 1, 3);
print_buttons(dialog, height, width, 0);
print_autowrap(dialog, prompt, width - 2, 1, 3);
print_buttons(dialog, height, width, 0);
- while (key != ESC) {
+ while (key !=
KEY_
ESC) {
key = wgetch(dialog);
switch (key) {
case 'Y':
key = wgetch(dialog);
switch (key) {
case 'Y':
@@
-92,11
+99,16
@@
int dialog_yesno(const char *title, const char *prompt, int height, int width)
case '\n':
delwin(dialog);
return button;
case '\n':
delwin(dialog);
return button;
- case ESC:
+ case KEY_ESC:
+ key = on_key_esc(dialog);
break;
break;
+ case KEY_RESIZE:
+ delwin(dialog);
+ on_key_resize();
+ goto do_resize;
}
}
delwin(dialog);
}
}
delwin(dialog);
- return
-1;
/* ESC pressed */
+ return
key;
/* ESC pressed */
}
}