summaryrefslogtreecommitdiffstats
path: root/ui/ncurses/nc-textscreen.c
Commit message (Collapse)AuthorAgeFilesLines
* ui/ncurses: Display multibyte strings correctly in textscreensSamuel Mendoza-Jonas2017-10-111-8/+13
| | | | | | | | | | | | | | In nc-textscreen each line of text is capped at a certain length to avoid running off the side of the viewable screen. However it appears the ncurses function mvwaddnstr() counts by byte instead of actual character, causing strings which contain multibyte characters to be cut short. To avoid this check the displayed length of each string against the screen width, and if under instruct mvwaddnstr() to print the whole string. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses/text-screen: trim long linesJeremy Kerr2016-12-201-7/+10
| | | | | | | | | | | | | | | When a text_screen is given a long line, it'll wrap to the next, overstepping the left margin. We already have folded text for flowed text screens, so just trim long lines at the correct column. This exposes an off-by-one with the automatic wrapping in text_screen_set_text(), where we may overrun the last char, so fix that too. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: Improve update handling in nested screensSamuel Mendoza-Jonas2015-09-071-0/+8
| | | | | | | | | | | | | | | | Several screens in petitboot-nc require an update if a config or sysinfo update is received. However if those screens exist but are not the current screen they will incorrectly try to draw to the screen. Where the currently active screen is a textscreen (eg. a help screen) the update is delayed until after the screen is exited. In the particular case of nc-config where the current screen can be an nc-subset screen, the nc-subset screen is exited immediately so the update can be performed, since the nc-subset screen depends on the information in the previous screen. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Use a separate type for help textJeremy Kerr2014-07-281-1/+1
| | | | | | | | | | | | Because it's initialised statically, help text won't be directly gettext()-ed. Instead, we need to perform the gettext translation at runtime, and pass untranslated strings into the help_screen code. Instead of trusting callers to pass the untranslated strings though, we encapsulate the help text data into struct help_text, so we know we have an unstranslated string. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* i18n: Mark translatable strings for ncurses UIJeremy Kerr2014-07-281-2/+3
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Unify key bindings & key help textJeremy Kerr2014-01-311-1/+2
| | | | | | | | | | This change is a small cleanup of the key bindings; we ensure that the general key bindings are available (and documented) on all screens. In order to keep things consistent, this change adds an initial UI guidelines text file, which documents the general key bindings. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add help facility to text screensJeremy Kerr2014-01-311-0/+13
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add text_screen_set_text()Jeremy Kerr2014-01-311-8/+36
| | | | | | When we have a large chunk of text, we'll want to add it all in one go. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Abstract text-screen code from sysinfo screenJeremy Kerr2014-01-311-0/+167
We want to implement help screens, which are very similar to the sysinfo screen - show a set of lines, and allow scrolling. This change splits the text-screen rendering code into a new nc-textinfo module. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
OpenPOWER on IntegriCloud