diff --git a/lib/easybashgui.lib b/lib/easybashgui.lib index 5a1da8f..d527b41 100644 --- a/lib/easybashgui.lib +++ b/lib/easybashgui.lib @@ -35,7 +35,7 @@ ##################################### ##################################### # -LIB_VERSION="13.0.1" +LIB_VERSION="13.0.2" LIB_NAME="easybashgui.lib" LIB_URL="https://github.com/BashGui/easybashgui" LIB_AUTHOR="Vittorio Cagnetta" @@ -6889,21 +6889,31 @@ if [ "${mode}" = "yad" ] ############# scelta="$(eval $(local IFS=$'\t' && echo -e "${dialogo}\t--title\t\"${supertitle:-EasyBashGUI}: data input\"\t--form\t${stringa_yad}\t--separator\t\"\\\n\"\t${dimensione_finestra}\t2>\t/dev/null" ) )" unset stringa_yad - printf -v scelta "%q" "${scelta}" - echo -e "${scelta}" 1> "${dir_tmp}/${file_tmp}" - ############# - # - if [ $(fgrep "$(echo -e "${scelta}" | head -n 1 )" 0< "${dir_tmp}/${file_tmp}" | wc -c ) -eq 0 ] - then - question "Warning: could not write \"\${scelta}\" variable in: \"${dir_tmp}/${file_tmp}\" ...\nShould I continue the same ?" ; conferma="${?}" - if [ "${conferma}" -eq 0 ] #"Confermato" - then - : - elif [ "${conferma}" -eq 1 ] #"Non confermato" + #printf -v scelta "%q" "${scelta}" + #echo -e "${scelta}" 1> "${dir_tmp}/${file_tmp}" + : 1> "${dir_tmp}/${file_tmp}" + for (( volta=1 ; volta <= ${quanti_campi} ; volta++ )) + do + # + scelta_line="$(echo -e "${scelta}" | head -n ${volta} | tail -n 1 )" + # + [ ${#scelta_line} -gt 0 ] && printf -v scelta_line "%q" "${scelta_line}" + # + echo -e "${scelta_line}" 1>> "${dir_tmp}/${file_tmp}" + if [ $(fgrep "$(echo -e "${scelta_line}" | head -n 1 )" 0< "${dir_tmp}/${file_tmp}" | wc -c ) -eq 0 ] then - exit + question "Warning: could not write \"\${scelta_line}\" variable in: \"${dir_tmp}/${file_tmp}\" ...\nShould I continue the same ?" ; conferma="${?}" + if [ "${conferma}" -eq 0 ] #"Confermato" + then + : + elif [ "${conferma}" -eq 1 ] #"Non confermato" + then + exit + fi fi - fi + # + done + ############# # exit_if_user_closes_window # @@ -7232,6 +7242,7 @@ elif [ "${mode}" = "Xdialog" ] echo -ne "${args[${index}]}\t" done)" # + ############# if [ ${quanti_campi} -eq 1 ] then inputbox="--inputbox" @@ -7249,6 +7260,19 @@ elif [ "${mode}" = "Xdialog" ] # local IFS=$' \t\n' # + if [ $(fgrep "$(echo -e "${scelta}" | head -n 1 )" 0< "${dir_tmp}/${file_tmp}" | wc -c ) -eq 0 ] + then + question "Warning: could not write \"\${scelta}\" variable in: \"${dir_tmp}/${file_tmp}\" ...\n Continue ?" ; conferma="${?}" + if [ "${conferma}" -eq 0 ] #"Confermato" + then + : + elif [ "${conferma}" -eq 1 ] #"Non confermato" + then + exit + fi + # + fi #if [ "${scelta}" = "$(0< "${dir_tmp}/${file_tmp}" )" ] + # elif [ ${quanti_campi} -gt 1 ] then inputbox="--${quanti_campi}inputsbox" @@ -7257,25 +7281,37 @@ elif [ "${mode}" = "Xdialog" ] # ############# scelta=$( ${dialogo} --stdout --separator "\\n" --title "${supertitle:-EasyBashGUI}: data input" ${inputbox} "Please, write data ..." ${dimensione_finestra} ${parametri} 2> /dev/null | grep -v "${string_to_clean}" ) - printf -v scelta "%q" "${scelta}" - echo -e "${scelta}" 1> "${dir_tmp}/${file_tmp}" + #printf -v scelta "%q" "${scelta}" + #echo -e "${scelta}" 1> "${dir_tmp}/${file_tmp}" ############# # local IFS=$' \t\n' # + : 1> "${dir_tmp}/${file_tmp}" + for (( volta=1 ; volta <= ${quanti_campi} ; volta++ )) + do + # + scelta_line="$(echo -e "${scelta}" | head -n ${volta} | tail -n 1 )" + # + [ ${#scelta_line} -gt 0 ] && printf -v scelta_line "%q" "${scelta_line}" + # + echo -e "${scelta_line}" 1>> "${dir_tmp}/${file_tmp}" + if [ $(fgrep "$(echo -e "${scelta_line}" | head -n 1 )" 0< "${dir_tmp}/${file_tmp}" | wc -c ) -eq 0 ] + then + question "Warning: could not write \"\${scelta_line}\" variable in: \"${dir_tmp}/${file_tmp}\" ...\nShould I continue the same ?" ; conferma="${?}" + if [ "${conferma}" -eq 0 ] #"Confermato" + then + : + elif [ "${conferma}" -eq 1 ] #"Non confermato" + then + exit + fi + fi + # + done + # fi #if [ ${quanti_campi} -eq 1 ] - # - if [ $(fgrep "$(echo -e "${scelta}" | head -n 1 )" 0< "${dir_tmp}/${file_tmp}" | wc -c ) -eq 0 ] - then - question "Warning: could not write \"\${scelta}\" variable in: \"${dir_tmp}/${file_tmp}\" ...\n Continue ?" ; conferma="${?}" - if [ "${conferma}" -eq 0 ] #"Confermato" - then - : - elif [ "${conferma}" -eq 1 ] #"Non confermato" - then - exit - fi - fi #if [ "${scelta}" = "$(0< "${dir_tmp}/${file_tmp}" )" ] + ############# # exit_if_user_closes_window # diff --git a/makefile b/makefile index 8cd40d2..521fd3a 100755 --- a/makefile +++ b/makefile @@ -1,5 +1,5 @@ #EBGlib=$(wildcard easybashgui_[0-9].[0-9].[0-9]) -VERSION=13.0.1 +VERSION=13.0.2 #cartelle di destinazione DESTDIR ?= "" diff --git a/src/easybashgui b/src/easybashgui index 49d69fc..a9b65c6 100755 --- a/src/easybashgui +++ b/src/easybashgui @@ -76,7 +76,7 @@ # # ################################################################### -MODULE_VERSION="13.0.1" +MODULE_VERSION="13.0.2" MODULE_NAME="easybashgui" libexec_dir="/usr/lib/easybashgui" ################################################################### diff --git a/src/easybashgui-debug b/src/easybashgui-debug index bb07a5a..e85634a 100755 --- a/src/easybashgui-debug +++ b/src/easybashgui-debug @@ -76,7 +76,7 @@ # # ################################################################### -MODULE_VERSION="13.0.1" +MODULE_VERSION="13.0.2" MODULE_NAME="easybashgui-debug" ################################################################### # diff --git a/src/easydialog-legacy b/src/easydialog-legacy index bee0e7a..0e6407f 100755 --- a/src/easydialog-legacy +++ b/src/easydialog-legacy @@ -114,6 +114,7 @@ while getopts ":hvm:" option elif [ "${OPTARG}" = "k" ]; then export supermode="kdialog" && break ; \ elif [ "${OPTARG}" = "z" ]; then export supermode="zenity" && break ; \ elif [ "${OPTARG}" = "x" ]; then export supermode="Xdialog" && break ; \ + elif [ "${OPTARG}" = "x" ]; then export supermode="gum" && break ; \ elif [ "${OPTARG}" = "d" ]; then export supermode="dialog" && break ; \ elif [ "${OPTARG}" = "n" ]; then export supermode="none" && break ; \ else usage ; \