You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
whiptail/newt-0.51.5.patch.2006100300

76 lines
3.1 KiB
Plaintext

Only in newt-0.51.5: config.h
Only in newt-0.51.5: config.log
Only in newt-0.51.5: config.status
diff -ru newt-0.51.5.orig/dialogboxes.c newt-0.51.5/dialogboxes.c
--- newt-0.51.5.orig/dialogboxes.c 2006-10-03 14:26:48.052081000 -0400
+++ newt-0.51.5/dialogboxes.c 2006-10-03 14:55:05.083400000 -0400
@@ -161,7 +161,7 @@
}
int listBox(const char * text, int height, int width, poptContext optCon,
- char * left, char * right, int flags, const char ** result) {
+ char * left, char * right, int flags, const char ** result, char * def) {
newtComponent form, okay, tb, answer, listBox;
newtComponent cancel = NULL;
const char * arg;
@@ -228,6 +228,10 @@
for (i = 0; i < numItems; i++) {
sprintf(buf, format, itemInfo[i].tag, itemInfo[i].text);
newtListboxAddEntry(listBox, buf, (void *) i);
+ if (!strcmp(def, itemInfo[i].tag))
+ {
+ newtListboxSetCurrent(listBox, i);
+ }
}
newtFormAddComponents(form, tb, listBox, NULL);
diff -ru newt-0.51.5.orig/dialogboxes.h newt-0.51.5/dialogboxes.h
--- newt-0.51.5.orig/dialogboxes.h 2006-10-03 14:26:48.062082000 -0400
+++ newt-0.51.5/dialogboxes.h 2006-10-03 14:54:35.302668000 -0400
@@ -22,7 +22,7 @@
int useRadio, char * left, char * right,
int flags, const char *** selections);
int listBox(const char * text, int height, int width, poptContext optCon,
- char * left, char * right, int flags, const char ** result);
+ char * left, char * right, int flags, const char ** result, char * def);
int inputBox(const char * text, int height, int width, poptContext optCon,
char * left, char * right, int flags, const char ** result);
int gauge(const char * text, int height, int width, poptContext optCon, int fd,
Only in newt-0.51.5: Makefile
Only in newt-0.51.5: shared
diff -ru newt-0.51.5.orig/whiptail.c newt-0.51.5/whiptail.c
--- newt-0.51.5.orig/whiptail.c 2006-10-03 14:26:48.082081000 -0400
+++ newt-0.51.5/whiptail.c 2006-10-03 14:59:14.911307000 -0400
@@ -56,8 +56,10 @@
char * backtitle = NULL;
char * left = "Cancel";
char * right = "Ok";
+ char * def_item = "";
struct poptOption optionsTable[] = {
{ "backtitle", '\0', POPT_ARG_STRING, &backtitle, 0 },
+ { "default-item", '\0', POPT_ARG_STRING, &def_item, 0 },
{ "checklist", '\0', 0, 0, OPT_CHECKLIST },
{ "clear", '\0', 0, &clear, 0 },
{ "defaultno", '\0', 0, &defaultNo, 0 },
@@ -194,7 +196,7 @@
break;
case MODE_MENU:
- rc = listBox(text, height, width, optCon, left, right, flags, &result);
+ rc = listBox(text, height, width, optCon, left, right, flags, &result, def_item);
if (!rc) fprintf(stderr, "%s", result);
break;
diff -ru newt-0.51.5.orig/whiptcl.c newt-0.51.5/whiptcl.c
--- newt-0.51.5.orig/whiptcl.c 2006-10-03 14:26:48.092082000 -0400
+++ newt-0.51.5/whiptcl.c 2006-10-03 14:53:44.961340000 -0400
@@ -205,7 +205,7 @@
break;
case MODE_MENU:
- rc = listBox(text, height, width, optCon, left, right, flags, &result);
+ rc = listBox(text, height, width, optCon, left, right, flags, &result, "");
if (!rc) {
interp->result = strdup(result);
interp->freeProc = TCL_DYNAMIC;