Article 6J60Z [yad] Unable to set default for very last of several check-boxes

[yad] Unable to set default for very last of several check-boxes

by
Michael Uplawski
from LinuxQuestions.org on (#6J60Z)
Good morning

I have a yad script, creating a dialog with several check-boxes, all set to true initially. The very last one cannot adopt that value.

Is this a bug in your opinion or something I have to know? Having split the field definitions to 1 line per field, I notice that the position of the closing parenthesis ( "))" ) is of importance, else the return value from the dialog is unusable.

Such sensibility is awkward but maybe I am overlooking something. (That was due to a typo)
The screen shot of the current dialog, authentic, from the below script: https://www.linuxquestions.org/quest...1&d=1706346853

I still have to verify its usability in the context of a little project.

Code:#!/bin/bash
#/***************************************************************************
# * i2024-2024, Michael Uplawski <michael.uplawski@uplawski.eu> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms of the WTFPL 2.0 or later. *
# * *
# * This program is distributed in the hope that it will be useful, *
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
# * *
# ***************************************************************************/

# A dialog to override configuration options

TITLE="Override post-processor configuration"
# Apart from PP, these are the configuration variables which can be
# manipulated or rather unset.
PP=1
GROUP_SIGS=2
CUSTOM_HEADERS=3
XNAY_GROUPS=4
DEBUG_LOG=5
CONF=($(yad --item-separator=" " --title "$TITLE" --image="" --window-icon="" --form \
--field="Uncheck to disable options":LBL\
--field="Post Processor (disable all)":CHK 'true'\
--field="Signature":CHK 'true' \
--field="Custom-headers":CHK 'true' \
--field="XNAY":CHK 'true' \
--field="Log":CHK 'true'))

IFS="|"
read -ra C_ARR <<< $CONF
CONF=''
# TODO : comment or remove
# ------------->
echo ${C_ARR[@]}
# <-------------

for i in PP GROUP_SIGS CUSTOM_HEADERS XNAY_GROUPS DEBUG_LOG
do
if [ 'FALSE' = ${C_ARR[$i]} ]
then
CONF="$i $CONF"
fi
done
# signal the fields
echo $CONF
Attached Thumbnailsattachment.php?attachmentid=42476&stc=1&
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments