Welcome
Welcome to refracta

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today!

zenity problems

Refracta Development, Scripts, etc.

zenity problems

Postby fsmithred » Sun Dec 15, 2013 1:24 pm

Zenity does not like button definitions in a file-selection window.
Code: Select all
zenity --file-selection --file-filter="*.[iI][sS][oO]" --file-filter="*" --width=640 --height=640 --title=$"Select Live ISO" --text="Select the CD image file." --filename="" --${BUTTON0}="OK"${BUTTON0NUM} -${BUTTON1}="Quit Task"${BUTTON1NUM}
This option is not available. Please see --help for all possible usages.
Remove the button options, and it works.

This partition selection window does not work with zenity. You can make a selection, but there's no output.
Code: Select all
find /dev -mindepth 1 -maxdepth 1  -name "*[sh]d[a-z][1-9]" \
> | grep $device | sort | awk '{print "\n" $0 }' \
> | $DIALOG --list --title="Persistent Partition" --text="Select the partition that holds the loopback file." \
> --multiple --column ' ' --column 'Partitions' --height=380 --width=150 \
> --${BUTTON0}="OK"${BUTTON0NUM} --${BUTTON1}="Quit Task"${BUTTON1NUM}


Adding --radiolist corrects it.
Code: Select all
find /dev -mindepth 1 -maxdepth 1  -name "*[sh]d[a-z][1-9]" | grep $device | sort | awk '{print "\n" $0 }' | $DIALOG --list --title="Persistent Partition" --text="Select the partition that holds the loopback file." --multiple --column ' ' --column 'Partitions' --height=380 --width=150 --${BUTTON0}="OK"${BUTTON0NUM} --${BUTTON1}="Quit Task"${BUTTON1NUM} --radiolist
/dev/sde1


These were taken from refracta2usb and select-loop-mount. I don't know if the problems exist in snapshot or installer, but they might. Most of the testing I do is with yad.

Adding --radiolist changes the output with yad:
Code: Select all
TRUE|/dev/sde1|
User avatar
fsmithred
 
Posts: 2101
Joined: Wed Mar 09, 2011 9:13 pm

Re: zenity problems

Postby fsmithred » Sun Dec 15, 2013 2:52 pm

Adding
Code: Select all
--separator ' '
gets rid of the pipes.
Adding ${RADIOLIST} gets rid of the TRUE. RADIOLIST is --radiolist for zenity and is null for yad. The dashes need to be part of the variable in this case, unless you put ${RADIOLIST} as the last option, then it doesn't seem to matter. (talking about what happens if you have just -- with no argument when using yad.)

Is there another way?
User avatar
fsmithred
 
Posts: 2101
Joined: Wed Mar 09, 2011 9:13 pm


Return to Discuss

Who is online

Users browsing this forum: No registered users and 0 guests

cron
suspicion-preferred