diff options
author | Peter Korsgaard <jacmet@sunsite.dk> | 2009-07-27 17:24:01 +0200 |
---|---|---|
committer | Peter Korsgaard <jacmet@sunsite.dk> | 2009-07-27 17:24:01 +0200 |
commit | 76dade1788965d0d31e57d080854dddb5e74783f (patch) | |
tree | e40baee34f71aa399937b864b77165e9fc628db2 /package/config/lxdialog/util.c | |
parent | 6fecd53e99591775a4117e9e1ba18043fda36b27 (diff) | |
parent | 6cd6353ff9c0ce93a63e43c4cb61188c6bc0b0f5 (diff) | |
download | buildroot-novena-76dade1788965d0d31e57d080854dddb5e74783f.tar.gz buildroot-novena-76dade1788965d0d31e57d080854dddb5e74783f.zip |
Merge branch 'kconfig-update' of git://git.busybox.net/~tpetazzoni/git/buildroot
Diffstat (limited to 'package/config/lxdialog/util.c')
-rw-r--r-- | package/config/lxdialog/util.c | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/package/config/lxdialog/util.c b/package/config/lxdialog/util.c index a1bddefe7..86d95cca4 100644 --- a/package/config/lxdialog/util.c +++ b/package/config/lxdialog/util.c @@ -266,31 +266,41 @@ void dialog_clear(void) /* * Do some initialization for dialog */ -void init_dialog(const char *backtitle) +int init_dialog(const char *backtitle) { - dlg.backtitle = backtitle; - color_setup(getenv("MENUCONFIG_COLOR")); -} + int height, width; + + initscr(); /* Init curses */ + getmaxyx(stdscr, height, width); + if (height < 19 || width < 80) { + endwin(); + return -ERRDISPLAYTOOSMALL; + } -void set_dialog_backtitle(const char *backtitle) -{ dlg.backtitle = backtitle; -} + color_setup(getenv("MENUCONFIG_COLOR")); -void reset_dialog(void) -{ - initscr(); /* Init curses */ keypad(stdscr, TRUE); cbreak(); noecho(); dialog_clear(); + + return 0; +} + +void set_dialog_backtitle(const char *backtitle) +{ + dlg.backtitle = backtitle; } /* * End using dialog functions. */ -void end_dialog(void) +void end_dialog(int x, int y) { + /* move cursor back to original position */ + move(y, x); + refresh(); endwin(); } |