error in example for zenity progress dialog
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
zenity (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
'cancel' button does not work
in /usr/share/
the return code tested is -1 "An unexpected error has occurred." rather than 1 "The user has either pressed Cancel, or used the window functions to close the dialog."
change
if [ "$?" = -1 ] ; then
to
if [ "$?" = 1 ] ; then
or maybe
case $? in
1)
zenity --error \
;;
-1)
zenity --error \
;;
esac
from /usr/share/
...
<code>
#!/bin/sh
(
echo "10" ; sleep 1
echo "# Updating mail logs" ; sleep 1
echo "20" ; sleep 1
echo "# Resetting cron jobs" ; sleep 1
echo "50" ; sleep 1
echo "This line will just be ignored" ; sleep 1
echo "75" ; sleep 1
echo "# Rebooting system" ; sleep 1
echo "100" ; sleep 1
) |
zenity --progress \
--title="Update System Logs" \
--text="Scanning mail logs..." \
--percentage=0
if [ "$?" = -1 ] ; then
zenity --error \
fi
</code>
...
ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: ubuntu-docs 12.10.2
ProcVersionSign
Uname: Linux 3.5.0-16-generic x86_64
ApportVersion: 2.5.3-0ubuntu1
Architecture: amd64
Date: Sun Sep 30 07:16:43 2012
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Alpha amd64 (20120905.2)
PackageArchitec
ProcEnviron:
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: ubuntu-docs
UpgradeStatus: No upgrade log present (probably fresh install)
affects: | ubuntu-docs (Ubuntu) → zenity (Ubuntu) |