Commit Graph

21 Commits

Author SHA1 Message Date
Isak Ellmer 89e5462bb5 kconfig: Fix typo HEIGTH to HEIGHT
Fixed a typo in some variables where height was misspelled as heigth.

Signed-off-by: Isak Ellmer <isak01@gmail.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2024-03-31 21:09:50 +09:00
Masahiro Yamada e14f1242a8 kconfig: menuconfig: simplify global jump key assignment
Commit 95ac9b3b58 ("menuconfig: Assign jump keys per-page instead
of globally") injected a lot of hacks to the bottom of the textbox
infrastructure.

I reverted many of them without changing the behavior. (almost)
Now, the key markers are inserted when constructing the search result
instead of updating the text buffer on-the-fly.

The buffer passed to the textbox got back to a constant string.
The ugly casts from (const char *) to (char *) went away.

A disadvantage is that the same key numbers might be displayed multiple
times in the dialog if you use a huge window (but I believe it is
unlikely to happen).

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Jesse Taube <Mr.Bossman075@gmail.com>
2023-07-25 00:59:32 +09:00
Masahiro Yamada fb318e54fe kconfig: menuconfig: reorder functions to remove forward declarations
Define helper functions before the callers so that forward
declarations can go away.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-04-17 11:03:56 +09:00
Masahiro Yamada 90fe4c506c kconfig: menuconfig: remove OLD_NCURSES macro
This code has been here for more than 20 years. The bug in the old days
no longer matters.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-04-17 11:03:56 +09:00
Masahiro Yamada 0c87410010 kconfig: convert to SPDX License Identifier
All files in lxdialog/ are licensed under GPL-2.0+, and the rest are
under GPL-2.0. I added GPL-2.0 tags to test scripts in tests/.

Documentation/process/license-rules.rst does not suggest anything
about the flex/bison files. Because flex does not accept the C++
comment style at the very top of a file, I used the C style for
zconf.l, and so for zconf.y for consistency.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-12-28 22:22:28 +09:00
Sam Ravnborg 694c49a7c0 kconfig: drop localization support
The localization support is broken and appears unused.
There is no google hits on the update-po-config target.
And there is no recent (5 years) activity related to the localization.

So lets just drop this as it is no longer used.

Suggested-by: Ulf Magnusson <ulfalizer@gmail.com>
Suggested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-05-28 18:25:21 +09:00
Dirk Gouders 4f2de3e199 mconf: use function calls instead of ncurses' variables LINES and COLS
According to the documentation [1], LINES and COLS are initialized by
initscr(); it does not say anything about the behavior when windows are
resized.

Do not rely on the current implementation of ncurses that updates
these variables on resize, but use the propper function calls to get
window dimensions.

init_dialog() could make use of the variables, but for the sake of
consistency we do not change it's current use of the macro getmaxyx().

[1] ncurses(3X)

Signed-off-by: Dirk Gouders <dirk@gouders.net>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2013-06-18 23:58:58 +02:00
Sedat Dilek 851f665725 kconfig/lxdialog: Add definitions for mininimum (re)size values
Commit c8dc68ad0f ("kconfig/lxdialog: support resize") added support
for resizing, but forgot to collect all hardcoded values at one single
place.

Also add a definition for the check for a minimum screen/window size
of 80x19.

[ ChangeLog v3:
  * Rename MENU_{HEIGTH,WIDTH}_MIN -> MENUBOX_{HEIGTH,WIDTH}_MIN
  ChangeLog v2:
  * Rename WIN_{HEIGTH,WIDTH}_MIN -> WINDOW_{HEIGTH,WIDTH}_MIN
  * Mention the check for a minimum screen/window size in the changelog
  * Add a comment above the block of new definitions ]

Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
Acked-by: Wang YanQing <udknight@gmail.com>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-06-16 11:09:56 +02:00
Benjamin Poirier 95ac9b3b58 menuconfig: Assign jump keys per-page instead of globally
At the moment, keys 1-9 are assigned to the first 9 search results. This patch
makes them assigned to the first 9 results per-page instead. We are much less
likely to run out of keys that way.

Signed-off-by: Benjamin Poirier <bpoirier@suse.de>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2012-09-27 18:09:24 +02:00
Benjamin Poirier 1a374ae619 menuconfig: Do not open code textbox scroll up/down
We don't need to explicitely use ncurses' scroll(). ncurses performs
vertical-motion optimization at wrefresh() time.

Using strace I confirmed that with the following patch curses still sends only
the new line of text to the terminal when scrolling up/down one line at a
time.

Signed-off-by: Benjamin Poirier <bpoirier@suse.de>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2012-09-27 18:09:24 +02:00
Benjamin Poirier 1d1e2caebb menuconfig: Extend dialog_textbox so that it can return to a scrolled position
We can now display other UI elements (menus) "on top" of a textbox and then
seemingly come back to it in the same state it was left.

Signed-off-by: Benjamin Poirier <bpoirier@suse.de>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2012-09-27 18:08:14 +02:00
Benjamin Poirier 537ddae75c menuconfig: Extend dialog_textbox so that it can exit on arbitrary keypresses
The caller will be able to perform actions based on hotkeys in the displayed
text.

Signed-off-by: Benjamin Poirier <bpoirier@suse.de>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2012-09-27 18:08:14 +02:00
Benjamin Poirier b9d29abd98 menuconfig: Remove superfluous conditionnal
Because end_reached is set to 0 before the loop, the test "!end_reached" is
always true and can be removed. This structure was perhaps copied from the
similar one in back_lines().

Signed-off-by: Benjamin Poirier <bpoirier@suse.de>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2012-09-27 18:08:13 +02:00
Benjamin Poirier 9d4792c9b4 menuconfig: add u, d, q command keys in text boxes
They function just like they do in less(1).

Signed-off-by: Benjamin Poirier <bpoirier@suse.de>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2012-07-26 12:20:43 +02:00
Lucas De Marchi 702a945028 kconfig: fix set but not used variables
Some variables were being set but never used, which was triggering
warnings in GCC >= 4.6.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
2011-08-29 20:22:26 -04:00
EGRY Gabor 75c0a8a55c kconfig: gettext support for lxdialog
Gettext support for lxdialog.

Signed-off-by: Egry Gabor <gaboregry1@t-online.hu>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
2008-01-28 23:14:39 +01:00
Sam Ravnborg c8dc68ad0f kconfig/lxdialog: support resize
In all dialogs now properly catch KEY_RESIZE and take proper action.
In mconf try to behave sensibly when a dialog routine returns
-ERRDISPLAYTOOSMALL.

The original check for a screnn size of 80x19 is kept for now.
It may make sense to remove it later, but thats anyway what
much text is adjusted for.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-09-30 11:19:20 +02:00
Sam Ravnborg f3cbcdc955 kconfig/lxdialog: let <ESC><ESC> behave as expected
<ESC><ESC> is used to step one back in the dialogs.
When lxdialog became built-in pressing <ESC> once would cause one step back
and pressing <ESC><ESC> would cause two steps back.
This patch - based on concept from Roman Zippel <zippel@linux-m68k.org> -
makes one <ESC> a noop and pressing <ESC><ESC> will cause one step backward.

In addition the final yes/no dialog now has the option to go back to the
the kernel configuration. So if you get too far out you can now go back
to configuring the kernel without saving and starting all over again.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-09-30 11:19:20 +02:00
Sam Ravnborg 2982de6993 kconfig/menuconfig: lxdialog is now built-in
lxdialog was previously called as an external program causing screen
to flicker when used. With this patch lxdialog is now built-in.
It is loosly based om previous work by:  Petr Baudis <pasky@ucw.cz>

Following is a list of changes:
o Moved build of dialog routings to kconfig Makefile
o menubox + checklist uses a new item list to hold all menu items
o in util.c implmented helper function to deal with item list
o menubox now uses parameters to save scroll state (avoids temp file)
o textbox now get text to be displayed as parameter and not a file
o make sure to properly delete subwin's before main windows
o killed unused files: lxdialog.c msgbox.c
o modified return value for ESC to match direct calling
o in a few places the code has been adjusted to 80 char wide
o in textbox a small refactoring was made to make code remotely readable
o in mconf removed all unused stuff (functions/variables)

Following is a list of know short comings:
a) pressing ESC twice will be interpreted as two ESC presses
b) resize does not work. menuconfig needs to be restarted to be adjusted

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-09-30 11:19:19 +02:00
Sam Ravnborg 98e5a1579e kconfig/lxdialog: refactor color support
Clean up and refactor color support. All color support are now
in util.c including color definitions.
In the process introduced a global variable named 'dlg' which is
used all over to set color - thats the reason why all files are changed.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2006-09-30 11:19:19 +02:00
Sam Ravnborg 6f6046cff2 kconfig: move lxdialog to scripts/kconfig/lxdialog
The only lxdialog user i kconfig - for menuconfig.
So move it to reflect this.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2005-12-16 21:35:19 +01:00