[Bug 451602] [NEW] UI::Dialog::Backend::Zenity checklist return data is not a list

Schplurtz le déboulonné schplurtz at laposte.net
Wed Oct 14 20:23:52 UTC 2009


Public bug reported:

Binary package hint: libui-dialog-perl

	Because of '' instead of "" in
	/usr/share/perl5/UI/Dialog/Backend/Zenity.pm , a \n is interpreted
	literally. The responses from Zenity are separated by the
	**string** '\n', not by a newline. So, perl fails to split the
	answer into an array.

	perl -x this message to see the problem.
	A Patch is provided below.


	sudo apt-get install zenity dialog
#! /usr/bin/perl
	print "please, do the same choice for each backend.\n" .
	      "Select at least 2 item\n\tPress RETURN to start";
	my $dum=<STDIN>;
	my( $d, %results, @checkSelect );
	for my $backend (qw/Zenity XOSD XDialog GDialog KDialog
	                 CDialog Whiptail ASCII/) {
		eval "use UI::Dialog::Backend::$backend;
		      \$d=new UI::Dialog::Backend::$backend (
		      	backtitle => 'Zenity checklist bug demo',
		      	title => $backend );";
		if( $@ ) {
			print STDERR "skipping backend $backend\n", $@, "\n\n";
			next;
		}
		@checkSelect = $d->checklist(
			list => [ 'test', [ 'testing', 1 ],
				  'b', [ 'beeing', '1' ],
				  'c', [ 'seeing', '0' ]
				]
		);
		if ($d->state() eq "OK") {
			$results{$backend}="# elem ".
				@checkSelect .
				" : '".join("' '", at checkSelect)."'";
		}
	}
	for my $r (keys %results) {
		printf "%10s : %s\n", $r, $results{$r};
	}
__END__

patch for Zenity.pm

--- /usr/share/perl5/UI/Dialog/Backend/Zenity.pm	2004-10-04 05:19:29.000000000 +0200
+++ UI/Dialog/Backend/Zenity.pm	2009-01-13 00:30:11.000000000 +0100
@@ -364,7 +364,7 @@
 
     my $command = $self->_mk_cmnd(" --list",$args);
     $command .= ($args->{'checklist'}) ? ' --checklist' : ($args->{'radiolist'}) ? ' --radiolist' : "";
-    $command .= ' --separator "\n"';
+    $command .= " --separator '\n'";
     #: not quite sure how to implement the editability...
     #    $command .= ' --editable' unless not $args->{'editable'};
     #: --text is not implemented for list widgets, yet...

ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 9.04
NonfreeKernelModules: nvidia wl
Package: libui-dialog-perl 1.08-1.1
PackageArchitecture: all
ProcEnviron:
 LANG=fr_FR.UTF-8
 SHELL=/bin/bash
SourcePackage: libui-dialog-perl
Uname: Linux 2.6.28-15-generic i686

** Affects: libui-dialog-perl (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: apport-bug i386

-- 
UI::Dialog::Backend::Zenity checklist return data is not a list
https://bugs.launchpad.net/bugs/451602
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs at lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs




More information about the universe-bugs mailing list