summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-12-13 10:09:06 +0800
committerJeremy Kerr <jk@ozlabs.org>2014-01-31 08:46:34 +0800
commit7f7e3688f3285ea803a5579b240cff54958e16e2 (patch)
treef8a6e156b086509c8ee0ffe93a2e09a7090971f5
parent485680a5bfeb952fd652a59efcce35636d6aec00 (diff)
downloadpetitboot-7f7e3688f3285ea803a5579b240cff54958e16e2.zip
petitboot-7f7e3688f3285ea803a5579b240cff54958e16e2.tar.gz
ui/ncurses: do all config screen updates in config_screen_post
We call _post when the config screen is to be displayed, so do all drawing here. This means we get the same drawing code on both init and update. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-rw-r--r--ui/ncurses/nc-config.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/ui/ncurses/nc-config.c b/ui/ncurses/nc-config.c
index 74105f1..9cc6a29 100644
--- a/ui/ncurses/nc-config.c
+++ b/ui/ncurses/nc-config.c
@@ -131,6 +131,8 @@ static int config_screen_post(struct nc_scr *scr)
struct config_screen *screen = config_screen_from_scr(scr);
widgetset_post(screen->widgetset);
nc_scr_frame_draw(scr);
+ redrawwin(scr->main_ncw);
+ wrefresh(screen->scr.main_ncw);
pad_refresh(screen);
return 0;
}
@@ -580,8 +582,7 @@ static void config_screen_widget_focus(struct nc_widget *widget, void *arg)
pad_refresh(screen);
}
-
-void config_screen_update(struct config_screen *screen,
+static void config_screen_draw(struct config_screen *screen,
const struct config *config,
const struct system_info *sysinfo)
{
@@ -626,7 +627,13 @@ void config_screen_update(struct config_screen *screen,
if (repost)
widgetset_post(screen->widgetset);
+}
+void config_screen_update(struct config_screen *screen,
+ const struct config *config,
+ const struct system_info *sysinfo)
+{
+ config_screen_draw(screen, config, sysinfo);
pad_refresh(screen);
}
@@ -666,9 +673,7 @@ struct config_screen *config_screen_init(struct cui *cui,
scrollok(screen->scr.sub_ncw, true);
- config_screen_update(screen, config, sysinfo);
-
- wrefresh(screen->scr.main_ncw);
+ config_screen_draw(screen, config, sysinfo);
return screen;
}
OpenPOWER on IntegriCloud