Debian Bug report logs - #46076
dialog: needs --defaultno flag

version graph

Package: dialog; Maintainer for dialog is Santiago Vila <sanvila@debian.org>; Source for dialog is src:dialog.

Reported by: Joey Hess <joey@kitenet.net>

Date: Mon, 27 Sep 1999 00:48:03 UTC

Severity: wishlist

Found in version 0.9a-16

Done: Santiago Vila <sanvila@unex.es>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Santiago Vila <sanvila@ctv.es>:
Bug#46076; Package dialog. Full text and rfc822 format available.

Acknowledgement sent to Joey Hess <joey@kitenet.net>:
New Bug report received and forwarded. Copy sent to Santiago Vila <sanvila@ctv.es>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Joey Hess <joey@kitenet.net>
To: submit@bugs.debian.org
Subject: dialog: needs --defaultno flag
Date: 27 Sep 1999 00:46:42 -0000
Package: dialog
Version: 0.9a-16
Severity: wishlist

Whiptail has this:

       --defaultno
                   The dialog box will open with the cursor  over  the
                   No button.

Since dialog doesn't, that makes it impossible for me to use it for debconf.
To keep compatability with whiptail, the flag should be added. A patch
follows.

Only in dialog-0.9a: checklist.o
Common subdirectories: old/dialog-0.9a/debian and dialog-0.9a/debian
Only in dialog-0.9a: dialog
diff -u old/dialog-0.9a/dialog.1 dialog-0.9a/dialog.1
--- old/dialog-0.9a/dialog.1	Mon Jan 15 14:53:00 1996
+++ dialog-0.9a/dialog.1	Sun Sep 26 17:43:00 1999
@@ -19,6 +19,9 @@
 .B \-\-clear
 ]
 [
+.B \-\-defaultno
+]
+[
 .B \-\-separate\-output
 ]
 .B box-options
@@ -36,6 +39,10 @@
 .B \-\-clear
 The screen will be cleared to the
 .BR "screen attribute" " on exit."
+.TP
+.B \-\-defaultno
+The dialog box will open with the cursor over the No button when displaying
+the yes/no box.
 .TP
 .BI \-\-create-rc " file"
 .RB "Since " dialog " supports run-time configuration,"
Only in dialog-0.9a: dialog.1~
diff -u old/dialog-0.9a/dialog.c dialog-0.9a/dialog.c
--- old/dialog-0.9a/dialog.c	Sat Sep 25 00:55:10 1999
+++ dialog-0.9a/dialog.c	Sun Sep 26 17:41:58 1999
@@ -29,7 +29,7 @@
 char *backtitle, *lock_refresh, *lock_tailbg_refreshed,
 	*lock_tailbg_exit;
 int beep_signal, is_tailbg = 0, print_siz, cr_wrap, size_err,
-	tab_len, tab_correct;
+	tab_len, tab_correct, defaultno = FALSE;
 int begin_x, begin_y, begin_set, aspect_ratio, screen_initialized = 0;
 pid_t tailbg_pids[MAX_TAILBG], tailbg_lastpid = 0, tailbg_nokill_pids[MAX_TAILBG], tailbg_nokill_lastpid = 0;
 int cant_kill;
@@ -198,6 +198,11 @@
         use_shadow = TRUE;
         offset++;
     }
+    else if (!strcmp(argv[offset+1], "--defaultno" ))
+    {
+      	defaultno = TRUE;
+      	offset++;
+    }
     else if (!strcmp(argv[offset+1], "--no-shadow" ))
     {
         use_shadow = FALSE;
@@ -358,7 +363,7 @@
 \n       [--clear] [--begin <y> <x>] [--aspect <ratio>] [--print-size]\
 \n       [--print-maxsize] [--size-err] [--separate-output] [--cr-wrap]\
 \n       [--tab-len <n>] [--tab-correct] [--print-version] [--no-kill]\
-\n       [--title <title>]\
+\n       [--title <title>] [--defaultno]\
 \n\
 \nGlobal options: [--shadow] [--no-shadow] [--separate-widget \"<str>\"]\
 \n\
@@ -424,7 +429,7 @@
 j_yesno (const char *t, int ac, const char * const * av, int offset, int *offset_add)
 {
     *offset_add=4;
-    return dialog_yesno (t, av[offset+2], atoi (av[offset+3]), atoi (av[offset+4]));
+    return dialog_yesno (t, av[offset+2], atoi (av[offset+3]), atoi (av[offset+4]), defaultno);
 }
 
 int
Only in dialog-0.9a: dialog.c~
diff -u old/dialog-0.9a/dialog.h dialog-0.9a/dialog.h
--- old/dialog-0.9a/dialog.h	Sat Sep 25 00:55:10 1999
+++ dialog-0.9a/dialog.h	Sun Sep 26 17:29:45 1999
@@ -198,7 +198,7 @@
 void draw_shadow (WINDOW * win, int y, int x, int height, int width);
 #endif
 
-int dialog_yesno (const char *title, const char *cprompt, int height, int width);
+int dialog_yesno (const char *title, const char *cprompt, int height, int width, int defaultno);
 int dialog_msgbox (const char *title, const char *cprompt, int height,
 		int width, int pause);
 int dialog_textbox (const char *title, const char *file, int height, int width);
Only in dialog-0.9a: dialog.o
Only in dialog-0.9a: guage.o
Only in dialog-0.9a: inputbox.o
Only in dialog-0.9a: libdialog.a
Only in dialog-0.9a: menubox.o
Only in dialog-0.9a: mousewget.o
Only in dialog-0.9a: msgbox.o
Common subdirectories: old/dialog-0.9a/samples and dialog-0.9a/samples
Only in dialog-0.9a: tailbox.o
Only in dialog-0.9a: textbox.o
Only in dialog-0.9a: util.o
diff -u old/dialog-0.9a/yesno.c dialog-0.9a/yesno.c
--- old/dialog-0.9a/yesno.c	Sat Sep 25 00:55:10 1999
+++ dialog-0.9a/yesno.c	Sun Sep 26 17:32:52 1999
@@ -24,7 +24,7 @@
  * Display a dialog box with two buttons - Yes and No
  */
 int
-dialog_yesno (const char *title, const char *cprompt, int height, int width)
+dialog_yesno (const char *title, const char *cprompt, int height, int width, int defaultno)
 {
     int i, x, y, key = 0, button = 0;
     WINDOW *dialog;
@@ -80,8 +80,8 @@
 
     x = width / 2 - 10;
     y = height - 2;
-    print_button (dialog, "  No  ", y, x + 13, FALSE);
-    print_button (dialog, " Yes ", y, x, TRUE);
+    print_button (dialog, "  No  ", y, x + 13, defaultno);
+    print_button (dialog, " Yes ", y, x, defaultno ? FALSE: TRUE);
     wrefresh_lock (dialog);
     wtimeout(dialog, WTIMEOUT_VAL);
 
Only in dialog-0.9a: yesno.o


Information forwarded to debian-bugs-dist@lists.debian.org, Santiago Vila <sanvila@ctv.es>:
Bug#46076; Package dialog. Full text and rfc822 format available.

Acknowledgement sent to Santiago Vila <sanvila@unex.es>:
Extra info received and forwarded to list. Copy sent to Santiago Vila <sanvila@ctv.es>. Full text and rfc822 format available.

Message #10 received at 46076@bugs.debian.org (full text, mbox):

From: Santiago Vila <sanvila@unex.es>
To: Joey Hess <joey@kitenet.net>, 46076@bugs.debian.org
Subject: Re: Bug#46076: dialog: needs --defaultno flag
Date: Wed, 29 Sep 1999 13:43:36 +0200 (CET)
On 27 Sep 1999, Joey Hess wrote:

> Package: dialog
> Version: 0.9a-16
> Severity: wishlist
> 
> Whiptail has this:
> 
>        --defaultno
>                    The dialog box will open with the cursor  over  the
>                    No button.
> 
> Since dialog doesn't, that makes it impossible for me to use it for debconf.
> To keep compatability with whiptail, the flag should be added. A patch
> follows.
> [...]

Great!

However: I have tried it with this:

#!/bin/sh
DIALOG=${DIALOG=dialog}

$DIALOG --title "YES/NO BOX" --clear --defaultno \
        --yesno "Hi, this is a yes/no dialog box." 7 61

case $? in
  0)
    echo "Yes chosen.";;
  1)
    echo "No chosen.";;
  255)
    echo "ESC pressed.";;
esac

and the result is that "No" is highlighted
but the cursor still remains on the "Yes" word.

Are you sure the patch is correct?

Thanks.

-- 
 "48268393df32516711d2b408e1138ee9" (a truly random sig)



Information forwarded to debian-bugs-dist@lists.debian.org, Santiago Vila <sanvila@ctv.es>:
Bug#46076; Package dialog. Full text and rfc822 format available.

Acknowledgement sent to Joey Hess <joey@kitenet.net>:
Extra info received and forwarded to list. Copy sent to Santiago Vila <sanvila@ctv.es>. Full text and rfc822 format available.

Message #15 received at 46076@bugs.debian.org (full text, mbox):

From: Joey Hess <joey@kitenet.net>
To: Santiago Vila <sanvila@unex.es>
Cc: 46076@bugs.debian.org
Subject: Re: Bug#46076: dialog: needs --defaultno flag
Date: Wed, 29 Sep 1999 11:50:40 -0700
[Message part 1 (text/plain, inline)]
Santiago Vila wrote:
> Are you sure the patch is correct?

You're right, the patch was incomplete. The attached one has been tested a
lot more.

-- 
see shy jo
[diff (text/plain, attachment)]

Reply sent to Santiago Vila <sanvila@unex.es>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to Joey Hess <joey@kitenet.net>:
Bug acknowledged by developer. Full text and rfc822 format available.

Message #20 received at 46076-done@bugs.debian.org (full text, mbox):

From: Santiago Vila <sanvila@unex.es>
To: Joey Hess <joey@kitenet.net>
Cc: 46076-done@bugs.debian.org
Subject: Re: Bug#46076: dialog: needs --defaultno flag
Date: Mon, 11 Oct 1999 16:26:45 +0200 (CET)
On Wed, 29 Sep 1999, Joey Hess wrote:

> Santiago Vila wrote:
> > Are you sure the patch is correct?
> 
> You're right, the patch was incomplete. The attached one has been tested a
> lot more.
> [...]

dialog_0.9a-17, now installed in potato, contains your patch (only
slightly modified).

Thanks a lot.

-- 
 "0a43b00a996c9eaa3e2ecb49ddc10c90" (a truly random sig)



Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Apr 23 07:12:11 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.