summaryrefslogtreecommitdiff
path: root/kconfig/lxdialog
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2008-10-17 12:47:53 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2008-10-17 12:47:53 (GMT)
commitf31bcd0026c2a3d5a38d3f16418876efcf7cd031 (patch)
treecd294553e433dde5ecceee767fcbf002f531aef1 /kconfig/lxdialog
parentc54f4302cdd3f4b5e5fde5ab63001f263e0664a3 (diff)
Update the kconfig stuff to match the one in the linux-2.6.27 version.
/trunk/kconfig/zconf.hash.c | 225 110 115 0 +++---- /trunk/kconfig/lkc_proto.h | 4 3 1 0 + /trunk/kconfig/mconf.c | 217 110 107 0 +++--- /trunk/kconfig/menu.c | 86 60 26 0 ++- /trunk/kconfig/symbol.c | 212 156 56 0 ++++-- /trunk/kconfig/kconfig.mk | 24 9 15 0 - /trunk/kconfig/lex.zconf.c | 97 80 17 0 ++- /trunk/kconfig/util.c | 38 30 8 0 + /trunk/kconfig/lkc.h | 22 18 4 0 + /trunk/kconfig/expr.c | 32 19 13 0 + /trunk/kconfig/confdata.c | 254 172 82 0 +++++--- /trunk/kconfig/lxdialog/dialog.h | 12 9 3 0 + /trunk/kconfig/lxdialog/inputbox.c | 6 3 3 0 /trunk/kconfig/lxdialog/checklist.c | 4 2 2 0 /trunk/kconfig/lxdialog/menubox.c | 6 3 3 0 /trunk/kconfig/lxdialog/textbox.c | 2 1 1 0 /trunk/kconfig/lxdialog/util.c | 47 30 17 0 + /trunk/kconfig/lxdialog/yesno.c | 4 2 2 0 /trunk/kconfig/expr.h | 20 10 10 0 /trunk/kconfig/zconf.tab.c | 1441 793 648 0 ++++++++++++++++++++++++------------------- /trunk/kconfig/conf.c | 276 124 152 0 ++++---- /trunk/kconfig/check-gettext.sh | 14 14 0 0 + /trunk/ct-ng.in | 2 1 1 0 23 files changed, 1759 insertions(+), 1286 deletions(-)
Diffstat (limited to 'kconfig/lxdialog')
-rw-r--r--[-rwxr-xr-x]kconfig/lxdialog/check-lxdialog.sh0
-rw-r--r--kconfig/lxdialog/checklist.c4
-rw-r--r--kconfig/lxdialog/dialog.h12
-rw-r--r--kconfig/lxdialog/inputbox.c6
-rw-r--r--kconfig/lxdialog/menubox.c6
-rw-r--r--kconfig/lxdialog/textbox.c2
-rw-r--r--kconfig/lxdialog/util.c47
-rw-r--r--kconfig/lxdialog/yesno.c4
8 files changed, 50 insertions, 31 deletions
diff --git a/kconfig/lxdialog/check-lxdialog.sh b/kconfig/lxdialog/check-lxdialog.sh
index e4d8adc..e4d8adc 100755..100644
--- a/kconfig/lxdialog/check-lxdialog.sh
+++ b/kconfig/lxdialog/check-lxdialog.sh
diff --git a/kconfig/lxdialog/checklist.c b/kconfig/lxdialog/checklist.c
index cf69708..b2a878c 100644
--- a/kconfig/lxdialog/checklist.c
+++ b/kconfig/lxdialog/checklist.c
@@ -97,8 +97,8 @@ static void print_buttons(WINDOW * dialog, int height, int width, int selected)
int x = width / 2 - 11;
int y = height - 2;
- print_button(dialog, "Select", y, x, selected == 0);
- print_button(dialog, " Help ", y, x + 14, selected == 1);
+ print_button(dialog, gettext("Select"), y, x, selected == 0);
+ print_button(dialog, gettext(" Help "), y, x + 14, selected == 1);
wmove(dialog, y, x + 1 + 14 * selected);
wrefresh(dialog);
diff --git a/kconfig/lxdialog/dialog.h b/kconfig/lxdialog/dialog.h
index fd695e1..b5211fc 100644
--- a/kconfig/lxdialog/dialog.h
+++ b/kconfig/lxdialog/dialog.h
@@ -26,6 +26,12 @@
#include <string.h>
#include <stdbool.h>
+#ifndef KBUILD_NO_NLS
+# include <libintl.h>
+#else
+# define gettext(Msgid) ((const char *) (Msgid))
+#endif
+
#ifdef __sun__
#define CURS_MACROS
#endif
@@ -187,9 +193,9 @@ int item_is_tag(char tag);
int on_key_esc(WINDOW *win);
int on_key_resize(void);
-void init_dialog(const char *backtitle);
-void reset_dialog(void);
-void end_dialog(void);
+int init_dialog(const char *backtitle);
+void set_dialog_backtitle(const char *backtitle);
+void end_dialog(int x, int y);
void attr_clear(WINDOW * win, int height, int width, chtype attr);
void dialog_clear(void);
void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x);
diff --git a/kconfig/lxdialog/inputbox.c b/kconfig/lxdialog/inputbox.c
index 05e7206..616c601 100644
--- a/kconfig/lxdialog/inputbox.c
+++ b/kconfig/lxdialog/inputbox.c
@@ -31,8 +31,8 @@ static void print_buttons(WINDOW * dialog, int height, int width, int selected)
int x = width / 2 - 11;
int y = height - 2;
- print_button(dialog, " Ok ", y, x, selected == 0);
- print_button(dialog, " Help ", y, x + 14, selected == 1);
+ print_button(dialog, gettext(" Ok "), y, x, selected == 0);
+ print_button(dialog, gettext(" Help "), y, x + 14, selected == 1);
wmove(dialog, y, x + 1 + 14 * selected);
wrefresh(dialog);
@@ -89,7 +89,7 @@ do_resize:
box_y = y + 2;
box_x = (width - box_width) / 2;
draw_box(dialog, y + 1, box_x - 1, 3, box_width + 2,
- dlg.border.atr, dlg.dialog.atr);
+ dlg.dialog.atr, dlg.border.atr);
print_buttons(dialog, height, width, 0);
diff --git a/kconfig/lxdialog/menubox.c b/kconfig/lxdialog/menubox.c
index 0d83159..fa9d633 100644
--- a/kconfig/lxdialog/menubox.c
+++ b/kconfig/lxdialog/menubox.c
@@ -157,9 +157,9 @@ static void print_buttons(WINDOW * win, int height, int width, int selected)
int x = width / 2 - 16;
int y = height - 2;
- print_button(win, "Select", y, x, selected == 0);
- print_button(win, " Exit ", y, x + 12, selected == 1);
- print_button(win, " Help ", y, x + 24, selected == 2);
+ print_button(win, gettext("Select"), y, x, selected == 0);
+ print_button(win, gettext(" Exit "), y, x + 12, selected == 1);
+ print_button(win, gettext(" Help "), y, x + 24, selected == 2);
wmove(win, y, x + 1 + 12 * selected);
wrefresh(win);
diff --git a/kconfig/lxdialog/textbox.c b/kconfig/lxdialog/textbox.c
index fabfc1a..c704712 100644
--- a/kconfig/lxdialog/textbox.c
+++ b/kconfig/lxdialog/textbox.c
@@ -114,7 +114,7 @@ do_resize:
print_title(dialog, title, width);
- print_button(dialog, " Exit ", height - 2, width / 2 - 4, TRUE);
+ print_button(dialog, gettext(" Exit "), height - 2, width / 2 - 4, TRUE);
wnoutrefresh(dialog);
getyx(dialog, cur_y, cur_x); /* Save cursor position */
diff --git a/kconfig/lxdialog/util.c b/kconfig/lxdialog/util.c
index ebc781b..86d95cc 100644
--- a/kconfig/lxdialog/util.c
+++ b/kconfig/lxdialog/util.c
@@ -221,16 +221,14 @@ static void init_dialog_colors(void)
*/
static void color_setup(const char *theme)
{
- if (set_theme(theme)) {
- if (has_colors()) { /* Terminal supports color? */
- start_color();
- init_dialog_colors();
- }
- }
- else
- {
+ int use_color;
+
+ use_color = set_theme(theme);
+ if (use_color && has_colors()) {
+ start_color();
+ init_dialog_colors();
+ } else
set_mono_theme();
- }
}
/*
@@ -268,26 +266,41 @@ void dialog_clear(void)
/*
* Do some initialization for dialog
*/
-void init_dialog(const char *backtitle)
+int init_dialog(const char *backtitle)
{
+ int height, width;
+
+ initscr(); /* Init curses */
+ getmaxyx(stdscr, height, width);
+ if (height < 19 || width < 80) {
+ endwin();
+ return -ERRDISPLAYTOOSMALL;
+ }
+
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();
}
@@ -338,7 +351,7 @@ void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x)
newl = 1;
word = tempstr;
while (word && *word) {
- sp = index(word, ' ');
+ sp = strchr(word, ' ');
if (sp)
*sp++ = 0;
@@ -350,7 +363,7 @@ void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x)
if (wlen > room ||
(newl && wlen < 4 && sp
&& wlen + 1 + strlen(sp) > room
- && (!(sp2 = index(sp, ' '))
+ && (!(sp2 = strchr(sp, ' '))
|| wlen + 1 + (sp2 - sp) > room))) {
cur_y++;
cur_x = x;
diff --git a/kconfig/lxdialog/yesno.c b/kconfig/lxdialog/yesno.c
index ee0a04e..4e6e809 100644
--- a/kconfig/lxdialog/yesno.c
+++ b/kconfig/lxdialog/yesno.c
@@ -29,8 +29,8 @@ static void print_buttons(WINDOW * dialog, int height, int width, int selected)
int x = width / 2 - 10;
int y = height - 2;
- print_button(dialog, " Yes ", y, x, selected == 0);
- print_button(dialog, " No ", y, x + 13, selected == 1);
+ print_button(dialog, gettext(" Yes "), y, x, selected == 0);
+ print_button(dialog, gettext(" No "), y, x + 13, selected == 1);
wmove(dialog, y, x + 1 + 13 * selected);
wrefresh(dialog);