aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/lxdialog
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kconfig/lxdialog')
-rw-r--r--scripts/kconfig/lxdialog/dialog.h5
-rw-r--r--scripts/kconfig/lxdialog/util.c32
2 files changed, 23 insertions, 14 deletions
diff --git a/scripts/kconfig/lxdialog/dialog.h b/scripts/kconfig/lxdialog/dialog.h
index 7e17eba75ae8..c4ad37fd922c 100644
--- a/scripts/kconfig/lxdialog/dialog.h
+++ b/scripts/kconfig/lxdialog/dialog.h
@@ -187,10 +187,9 @@ int item_is_tag(char tag);
187int on_key_esc(WINDOW *win); 187int on_key_esc(WINDOW *win);
188int on_key_resize(void); 188int on_key_resize(void);
189 189
190void init_dialog(const char *backtitle); 190int init_dialog(const char *backtitle);
191void set_dialog_backtitle(const char *backtitle); 191void set_dialog_backtitle(const char *backtitle);
192void reset_dialog(void); 192void end_dialog(int x, int y);
193void end_dialog(void);
194void attr_clear(WINDOW * win, int height, int width, chtype attr); 193void attr_clear(WINDOW * win, int height, int width, chtype attr);
195void dialog_clear(void); 194void dialog_clear(void);
196void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x); 195void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x);
diff --git a/scripts/kconfig/lxdialog/util.c b/scripts/kconfig/lxdialog/util.c
index a1bddefe73d0..86d95cca46a7 100644
--- a/scripts/kconfig/lxdialog/util.c
+++ b/scripts/kconfig/lxdialog/util.c
@@ -266,31 +266,41 @@ void dialog_clear(void)
266/* 266/*
267 * Do some initialization for dialog 267 * Do some initialization for dialog
268 */ 268 */
269void init_dialog(const char *backtitle) 269int init_dialog(const char *backtitle)
270{ 270{
271 dlg.backtitle = backtitle; 271 int height, width;
272 color_setup(getenv("MENUCONFIG_COLOR")); 272
273} 273 initscr(); /* Init curses */
274 getmaxyx(stdscr, height, width);
275 if (height < 19 || width < 80) {
276 endwin();
277 return -ERRDISPLAYTOOSMALL;
278 }
274 279
275void set_dialog_backtitle(const char *backtitle)
276{
277 dlg.backtitle = backtitle; 280 dlg.backtitle = backtitle;
278} 281 color_setup(getenv("MENUCONFIG_COLOR"));
279 282
280void reset_dialog(void)
281{
282 initscr(); /* Init curses */
283 keypad(stdscr, TRUE); 283 keypad(stdscr, TRUE);
284 cbreak(); 284 cbreak();
285 noecho(); 285 noecho();
286 dialog_clear(); 286 dialog_clear();
287
288 return 0;
289}
290
291void set_dialog_backtitle(const char *backtitle)
292{
293 dlg.backtitle = backtitle;
287} 294}
288 295
289/* 296/*
290 * End using dialog functions. 297 * End using dialog functions.
291 */ 298 */
292void end_dialog(void) 299void end_dialog(int x, int y)
293{ 300{
301 /* move cursor back to original position */
302 move(y, x);
303 refresh();
294 endwin(); 304 endwin();
295} 305}
296 306