update to new kconfig version #2 (forgot to delete files)
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
9a14fb0f01
commit
ef01c76864
|
@ -1,21 +0,0 @@
|
|||
# Makefile to build lxdialog package
|
||||
#
|
||||
|
||||
check-lxdialog := $(srctree)/$(src)/check-lxdialog.sh
|
||||
|
||||
# Use reursively expanded variables so we do not call gcc unless
|
||||
# we really need to do so. (Do not call gcc as part of make mrproper)
|
||||
HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)
|
||||
HOST_LOADLIBES = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
|
||||
|
||||
HOST_EXTRACFLAGS += -DLOCALE
|
||||
|
||||
PHONY += dochecklxdialog
|
||||
$(obj)/dochecklxdialog:
|
||||
$(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_LOADLIBES)
|
||||
|
||||
hostprogs-y := lxdialog
|
||||
always := $(hostprogs-y) dochecklxdialog
|
||||
|
||||
lxdialog-objs := checklist.o menubox.o textbox.o yesno.o inputbox.o \
|
||||
util.o lxdialog.o msgbox.o
|
|
@ -1,154 +0,0 @@
|
|||
/*
|
||||
* colors.h -- color attribute definitions
|
||||
*
|
||||
* AUTHOR: Savio Lam (lam836@cs.cuhk.hk)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Default color definitions
|
||||
*
|
||||
* *_FG = foreground
|
||||
* *_BG = background
|
||||
* *_HL = highlight?
|
||||
*/
|
||||
#define SCREEN_FG COLOR_CYAN
|
||||
#define SCREEN_BG COLOR_BLUE
|
||||
#define SCREEN_HL TRUE
|
||||
|
||||
#define SHADOW_FG COLOR_BLACK
|
||||
#define SHADOW_BG COLOR_BLACK
|
||||
#define SHADOW_HL TRUE
|
||||
|
||||
#define DIALOG_FG COLOR_BLACK
|
||||
#define DIALOG_BG COLOR_WHITE
|
||||
#define DIALOG_HL FALSE
|
||||
|
||||
#define TITLE_FG COLOR_YELLOW
|
||||
#define TITLE_BG COLOR_WHITE
|
||||
#define TITLE_HL TRUE
|
||||
|
||||
#define BORDER_FG COLOR_WHITE
|
||||
#define BORDER_BG COLOR_WHITE
|
||||
#define BORDER_HL TRUE
|
||||
|
||||
#define BUTTON_ACTIVE_FG COLOR_WHITE
|
||||
#define BUTTON_ACTIVE_BG COLOR_BLUE
|
||||
#define BUTTON_ACTIVE_HL TRUE
|
||||
|
||||
#define BUTTON_INACTIVE_FG COLOR_BLACK
|
||||
#define BUTTON_INACTIVE_BG COLOR_WHITE
|
||||
#define BUTTON_INACTIVE_HL FALSE
|
||||
|
||||
#define BUTTON_KEY_ACTIVE_FG COLOR_WHITE
|
||||
#define BUTTON_KEY_ACTIVE_BG COLOR_BLUE
|
||||
#define BUTTON_KEY_ACTIVE_HL TRUE
|
||||
|
||||
#define BUTTON_KEY_INACTIVE_FG COLOR_RED
|
||||
#define BUTTON_KEY_INACTIVE_BG COLOR_WHITE
|
||||
#define BUTTON_KEY_INACTIVE_HL FALSE
|
||||
|
||||
#define BUTTON_LABEL_ACTIVE_FG COLOR_YELLOW
|
||||
#define BUTTON_LABEL_ACTIVE_BG COLOR_BLUE
|
||||
#define BUTTON_LABEL_ACTIVE_HL TRUE
|
||||
|
||||
#define BUTTON_LABEL_INACTIVE_FG COLOR_BLACK
|
||||
#define BUTTON_LABEL_INACTIVE_BG COLOR_WHITE
|
||||
#define BUTTON_LABEL_INACTIVE_HL TRUE
|
||||
|
||||
#define INPUTBOX_FG COLOR_BLACK
|
||||
#define INPUTBOX_BG COLOR_WHITE
|
||||
#define INPUTBOX_HL FALSE
|
||||
|
||||
#define INPUTBOX_BORDER_FG COLOR_BLACK
|
||||
#define INPUTBOX_BORDER_BG COLOR_WHITE
|
||||
#define INPUTBOX_BORDER_HL FALSE
|
||||
|
||||
#define SEARCHBOX_FG COLOR_BLACK
|
||||
#define SEARCHBOX_BG COLOR_WHITE
|
||||
#define SEARCHBOX_HL FALSE
|
||||
|
||||
#define SEARCHBOX_TITLE_FG COLOR_YELLOW
|
||||
#define SEARCHBOX_TITLE_BG COLOR_WHITE
|
||||
#define SEARCHBOX_TITLE_HL TRUE
|
||||
|
||||
#define SEARCHBOX_BORDER_FG COLOR_WHITE
|
||||
#define SEARCHBOX_BORDER_BG COLOR_WHITE
|
||||
#define SEARCHBOX_BORDER_HL TRUE
|
||||
|
||||
#define POSITION_INDICATOR_FG COLOR_YELLOW
|
||||
#define POSITION_INDICATOR_BG COLOR_WHITE
|
||||
#define POSITION_INDICATOR_HL TRUE
|
||||
|
||||
#define MENUBOX_FG COLOR_BLACK
|
||||
#define MENUBOX_BG COLOR_WHITE
|
||||
#define MENUBOX_HL FALSE
|
||||
|
||||
#define MENUBOX_BORDER_FG COLOR_WHITE
|
||||
#define MENUBOX_BORDER_BG COLOR_WHITE
|
||||
#define MENUBOX_BORDER_HL TRUE
|
||||
|
||||
#define ITEM_FG COLOR_BLACK
|
||||
#define ITEM_BG COLOR_WHITE
|
||||
#define ITEM_HL FALSE
|
||||
|
||||
#define ITEM_SELECTED_FG COLOR_WHITE
|
||||
#define ITEM_SELECTED_BG COLOR_BLUE
|
||||
#define ITEM_SELECTED_HL TRUE
|
||||
|
||||
#define TAG_FG COLOR_YELLOW
|
||||
#define TAG_BG COLOR_WHITE
|
||||
#define TAG_HL TRUE
|
||||
|
||||
#define TAG_SELECTED_FG COLOR_YELLOW
|
||||
#define TAG_SELECTED_BG COLOR_BLUE
|
||||
#define TAG_SELECTED_HL TRUE
|
||||
|
||||
#define TAG_KEY_FG COLOR_YELLOW
|
||||
#define TAG_KEY_BG COLOR_WHITE
|
||||
#define TAG_KEY_HL TRUE
|
||||
|
||||
#define TAG_KEY_SELECTED_FG COLOR_YELLOW
|
||||
#define TAG_KEY_SELECTED_BG COLOR_BLUE
|
||||
#define TAG_KEY_SELECTED_HL TRUE
|
||||
|
||||
#define CHECK_FG COLOR_BLACK
|
||||
#define CHECK_BG COLOR_WHITE
|
||||
#define CHECK_HL FALSE
|
||||
|
||||
#define CHECK_SELECTED_FG COLOR_WHITE
|
||||
#define CHECK_SELECTED_BG COLOR_BLUE
|
||||
#define CHECK_SELECTED_HL TRUE
|
||||
|
||||
#define UARROW_FG COLOR_GREEN
|
||||
#define UARROW_BG COLOR_WHITE
|
||||
#define UARROW_HL TRUE
|
||||
|
||||
#define DARROW_FG COLOR_GREEN
|
||||
#define DARROW_BG COLOR_WHITE
|
||||
#define DARROW_HL TRUE
|
||||
|
||||
/* End of default color definitions */
|
||||
|
||||
#define C_ATTR(x,y) ((x ? A_BOLD : 0) | COLOR_PAIR((y)))
|
||||
#define COLOR_NAME_LEN 10
|
||||
#define COLOR_COUNT 8
|
||||
|
||||
/*
|
||||
* Global variables
|
||||
*/
|
||||
|
||||
extern int color_table[][3];
|
|
@ -1,204 +0,0 @@
|
|||
/*
|
||||
* dialog - Display simple dialog boxes from shell scripts
|
||||
*
|
||||
* ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk)
|
||||
* MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap@cfw.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include "dialog.h"
|
||||
|
||||
static void Usage(const char *name);
|
||||
|
||||
typedef int (jumperFn) (const char *title, int argc, const char *const *argv);
|
||||
|
||||
struct Mode {
|
||||
char *name;
|
||||
int argmin, argmax, argmod;
|
||||
jumperFn *jumper;
|
||||
};
|
||||
|
||||
jumperFn j_menu, j_radiolist, j_yesno, j_textbox, j_inputbox;
|
||||
jumperFn j_msgbox, j_infobox;
|
||||
|
||||
static struct Mode modes[] = {
|
||||
{"--menu", 9, 0, 3, j_menu},
|
||||
{"--radiolist", 9, 0, 3, j_radiolist},
|
||||
{"--yesno", 5, 5, 1, j_yesno},
|
||||
{"--textbox", 5, 5, 1, j_textbox},
|
||||
{"--inputbox", 5, 6, 1, j_inputbox},
|
||||
{"--msgbox", 5, 5, 1, j_msgbox},
|
||||
{"--infobox", 5, 5, 1, j_infobox},
|
||||
{NULL, 0, 0, 0, NULL}
|
||||
};
|
||||
|
||||
static struct Mode *modePtr;
|
||||
|
||||
#ifdef LOCALE
|
||||
#include <locale.h>
|
||||
#endif
|
||||
|
||||
int main(int argc, const char *const *argv)
|
||||
{
|
||||
int offset = 0, opt_clear = 0, end_common_opts = 0, retval;
|
||||
const char *title = NULL;
|
||||
|
||||
#ifdef LOCALE
|
||||
(void)setlocale(LC_ALL, "");
|
||||
#endif
|
||||
|
||||
#ifdef TRACE
|
||||
trace(TRACE_CALLS | TRACE_UPDATE);
|
||||
#endif
|
||||
if (argc < 2) {
|
||||
Usage(argv[0]);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
while (offset < argc - 1 && !end_common_opts) { /* Common options */
|
||||
if (!strcmp(argv[offset + 1], "--title")) {
|
||||
if (argc - offset < 3 || title != NULL) {
|
||||
Usage(argv[0]);
|
||||
exit(-1);
|
||||
} else {
|
||||
title = argv[offset + 2];
|
||||
offset += 2;
|
||||
}
|
||||
} else if (!strcmp(argv[offset + 1], "--backtitle")) {
|
||||
if (backtitle != NULL) {
|
||||
Usage(argv[0]);
|
||||
exit(-1);
|
||||
} else {
|
||||
backtitle = argv[offset + 2];
|
||||
offset += 2;
|
||||
}
|
||||
} else if (!strcmp(argv[offset + 1], "--clear")) {
|
||||
if (opt_clear) { /* Hey, "--clear" can't appear twice! */
|
||||
Usage(argv[0]);
|
||||
exit(-1);
|
||||
} else if (argc == 2) { /* we only want to clear the screen */
|
||||
init_dialog();
|
||||
refresh(); /* init_dialog() will clear the screen for us */
|
||||
end_dialog();
|
||||
return 0;
|
||||
} else {
|
||||
opt_clear = 1;
|
||||
offset++;
|
||||
}
|
||||
} else /* no more common options */
|
||||
end_common_opts = 1;
|
||||
}
|
||||
|
||||
if (argc - 1 == offset) { /* no more options */
|
||||
Usage(argv[0]);
|
||||
exit(-1);
|
||||
}
|
||||
/* use a table to look for the requested mode, to avoid code duplication */
|
||||
|
||||
for (modePtr = modes; modePtr->name; modePtr++) /* look for the mode */
|
||||
if (!strcmp(argv[offset + 1], modePtr->name))
|
||||
break;
|
||||
|
||||
if (!modePtr->name)
|
||||
Usage(argv[0]);
|
||||
if (argc - offset < modePtr->argmin)
|
||||
Usage(argv[0]);
|
||||
if (modePtr->argmax && argc - offset > modePtr->argmax)
|
||||
Usage(argv[0]);
|
||||
|
||||
init_dialog();
|
||||
retval = (*(modePtr->jumper)) (title, argc - offset, argv + offset);
|
||||
|
||||
if (opt_clear) { /* clear screen before exit */
|
||||
attr_clear(stdscr, LINES, COLS, screen_attr);
|
||||
refresh();
|
||||
}
|
||||
end_dialog();
|
||||
|
||||
exit(retval);
|
||||
}
|
||||
|
||||
/*
|
||||
* Print program usage
|
||||
*/
|
||||
static void Usage(const char *name)
|
||||
{
|
||||
fprintf(stderr, "\
|
||||
\ndialog, by Savio Lam (lam836@cs.cuhk.hk).\
|
||||
\n patched by Stuart Herbert (S.Herbert@shef.ac.uk)\
|
||||
\n modified/gutted for use as a uboot config tool by \
|
||||
\n William Roadcap (roadcapw@cfw.com)\
|
||||
\n\
|
||||
\n* Display dialog boxes from shell scripts *\
|
||||
\n\
|
||||
\nUsage: %s --clear\
|
||||
\n %s [--title <title>] [--backtitle <backtitle>] --clear <Box options>\
|
||||
\n\
|
||||
\nBox options:\
|
||||
\n\
|
||||
\n --menu <text> <height> <width> <menu height> <tag1> <item1>...\
|
||||
\n --radiolist <text> <height> <width> <list height> <tag1> <item1> <status1>...\
|
||||
\n --textbox <file> <height> <width>\
|
||||
\n --inputbox <text> <height> <width> [<init>]\
|
||||
\n --yesno <text> <height> <width>\
|
||||
\n", name, name);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* These are the program jumpers
|
||||
*/
|
||||
|
||||
int j_menu(const char *t, int ac, const char *const *av)
|
||||
{
|
||||
return dialog_menu(t, av[2], atoi(av[3]), atoi(av[4]),
|
||||
atoi(av[5]), av[6], (ac - 6) / 2, av + 7);
|
||||
}
|
||||
|
||||
int j_radiolist(const char *t, int ac, const char *const *av)
|
||||
{
|
||||
return dialog_checklist(t, av[2], atoi(av[3]), atoi(av[4]),
|
||||
atoi(av[5]), (ac - 6) / 3, av + 6);
|
||||
}
|
||||
|
||||
int j_textbox(const char *t, int ac, const char *const *av)
|
||||
{
|
||||
return dialog_textbox(t, av[2], atoi(av[3]), atoi(av[4]));
|
||||
}
|
||||
|
||||
int j_yesno(const char *t, int ac, const char *const *av)
|
||||
{
|
||||
return dialog_yesno(t, av[2], atoi(av[3]), atoi(av[4]));
|
||||
}
|
||||
|
||||
int j_inputbox(const char *t, int ac, const char *const *av)
|
||||
{
|
||||
int ret = dialog_inputbox(t, av[2], atoi(av[3]), atoi(av[4]),
|
||||
ac == 6 ? av[5] : (char *)NULL);
|
||||
if (ret == 0)
|
||||
fprintf(stderr, dialog_input_result);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int j_msgbox(const char *t, int ac, const char *const *av)
|
||||
{
|
||||
return dialog_msgbox(t, av[2], atoi(av[3]), atoi(av[4]), 1);
|
||||
}
|
||||
|
||||
int j_infobox(const char *t, int ac, const char *const *av)
|
||||
{
|
||||
return dialog_msgbox(t, av[2], atoi(av[3]), atoi(av[4]), 0);
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
/*
|
||||
* msgbox.c -- implements the message box and info box
|
||||
*
|
||||
* ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk)
|
||||
* MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcapw@cfw.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include "dialog.h"
|
||||
|
||||
/*
|
||||
* Display a message box. Program will pause and display an "OK" button
|
||||
* if the parameter 'pause' is non-zero.
|
||||
*/
|
||||
int dialog_msgbox(const char *title, const char *prompt, int height, int width,
|
||||
int pause)
|
||||
{
|
||||
int i, x, y, key = 0;
|
||||
WINDOW *dialog;
|
||||
|
||||
/* center dialog box on screen */
|
||||
x = (COLS - width) / 2;
|
||||
y = (LINES - height) / 2;
|
||||
|
||||
draw_shadow(stdscr, y, x, height, width);
|
||||
|
||||
dialog = newwin(height, width, y, x);
|
||||
keypad(dialog, TRUE);
|
||||
|
||||
draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr);
|
||||
|
||||
print_title(dialog, title, width);
|
||||
|
||||
wattrset(dialog, dialog_attr);
|
||||
print_autowrap(dialog, prompt, width - 2, 1, 2);
|
||||
|
||||
if (pause) {
|
||||
wattrset(dialog, border_attr);
|
||||
mvwaddch(dialog, height - 3, 0, ACS_LTEE);
|
||||
for (i = 0; i < width - 2; i++)
|
||||
waddch(dialog, ACS_HLINE);
|
||||
wattrset(dialog, dialog_attr);
|
||||
waddch(dialog, ACS_RTEE);
|
||||
|
||||
print_button(dialog, " Ok ", height - 2, width / 2 - 4, TRUE);
|
||||
|
||||
wrefresh(dialog);
|
||||
while (key != ESC && key != '\n' && key != ' ' &&
|
||||
key != 'O' && key != 'o' && key != 'X' && key != 'x')
|
||||
key = wgetch(dialog);
|
||||
} else {
|
||||
key = '\n';
|
||||
wrefresh(dialog);
|
||||
}
|
||||
|
||||
delwin(dialog);
|
||||
return key == ESC ? -1 : 0;
|
||||
}
|
Loading…
Reference in New Issue