From: havill Date: Wed, 7 Apr 2004 19:53:26 +0000 (+0000) Subject: added --notags to whiptail (#117468) X-Git-Tag: r0-52-0~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57cb49e79cfa9f7b00d342983f85ff90f8737ffa;p=thirdparty%2Fnewt.git added --notags to whiptail (#117468) --- diff --git a/dialogboxes.c b/dialogboxes.c index 5e58a1a..d2b2209 100644 --- a/dialogboxes.c +++ b/dialogboxes.c @@ -209,6 +209,10 @@ int listBox(const char * text, int height, int width, poptContext optCon, if (numItems == 0) return DLG_ERROR; + if (flags & FLAG_NOTAGS) { + maxTagWidth = 0; + } + form = newtForm(NULL, NULL, 0); tb = textbox(height - 4 - buttonHeight - listHeight, width - 2, @@ -303,6 +307,7 @@ int checkList(const char * text, int height, int width, poptContext optCon, numBoxes++; } + form = newtForm(NULL, NULL, 0); tb = textbox(height - 3 - buttonHeight - listHeight, width - 2, diff --git a/dialogboxes.h b/dialogboxes.h index 456ab63..27f072c 100644 --- a/dialogboxes.h +++ b/dialogboxes.h @@ -11,6 +11,7 @@ #define FLAG_NOCANCEL (1 << 1) #define FLAG_SCROLL_TEXT (1 << 2) #define FLAG_DEFAULT_NO (1 << 3) +#define FLAG_NOTAGS (1 << 5) #define DLG_ERROR -1 #define DLG_OKAY 0 diff --git a/whiptail.c b/whiptail.c index f658a7b..368a605 100644 --- a/whiptail.c +++ b/whiptail.c @@ -42,6 +42,7 @@ int main(int argc, const char ** argv) { int fd = -1; int needSpace = 0; int noCancel = 0; + int noTags = 0; int noItem = 0; int clear = 0; int scrollText = 0; @@ -67,6 +68,7 @@ int main(int argc, const char ** argv) { { "msgbox", '\0', 0, 0, OPT_MSGBOX }, { "nocancel", '\0', 0, &noCancel, 0 }, { "noitem", '\0', 0, &noItem, 0 }, + { "notags", '\0', 0, &noTags, 0 }, { "radiolist", '\0', 0, 0, OPT_RADIOLIST }, { "scrolltext", '\0', 0, &scrollText, 0 }, { "separate-output", '\0', 0, &separateOutput, 0 }, @@ -163,6 +165,7 @@ int main(int argc, const char ** argv) { if (noCancel) flags |= FLAG_NOCANCEL; if (noItem) flags |= FLAG_NOITEM; + if (noTags) flags |= FLAG_NOTAGS; if (scrollText) flags |= FLAG_SCROLL_TEXT; if (defaultNo) flags |= FLAG_DEFAULT_NO;