From c7c6c7c1013c006feeb67ef820805d2d5029ef3e Mon Sep 17 00:00:00 2001 From: vaisarger Date: Tue, 8 Jan 2019 12:43:15 +0100 Subject: [PATCH] Micro bug fixes on 11.X.X version. --- README | 6 +++--- lib/easybashgui.lib | 17 +++++++++++++---- lib/easybashlib | 9 ++++++--- makefile | 2 +- src/easybashgui | 2 +- src/easybashgui-debug | 2 +- 6 files changed, 25 insertions(+), 13 deletions(-) diff --git a/README b/README index 0e1c421..b65804d 100644 --- a/README +++ b/README @@ -3,12 +3,12 @@ Project EasyBashGUI. Intro. -EasyBashGUI is a bash function library that aims to give simple GUI functions using yad, gtkdialog, kdialog, zenity, Xdialog, dialog, or whiptail depending on KDE or GNOME running or not, Yad, Gtkdialog or Xdialog installed or not and X server running or not ( (c)dialog or whiptail is the minimum ). So, if bash programmer writes: "message 'Thanks for using this program' ", he has not to worry in which environment his program runs: it's enough there is at least (c)dialog or whiptail installed, and program will work as expected. Obviously, if user has KDE, GNOME, or gtkdialog/Xdialog also installed ( and he's in a X session ), program will have "an other look", but logical flow is exactly the same. +EasyBashGUI is a Posix compliant Bash functions library that aims to give simple GUI functions using yad, gtkdialog, kdialog, zenity, Xdialog, dialog, or whiptail depending on KDE or GNOME running or not, Yad, Gtkdialog or Xdialog installed or not and X server running or not ( (c)dialog or whiptail is the minimum ). So, if bash programmer writes: "message 'Thanks for using this program' ", he has not to worry in which environment his program runs: it's enough there is at least (c)dialog or whiptail installed, and program will work as expected. Obviously, if user has KDE, GNOME, or gtkdialog/Xdialog also installed ( and he's in a X session ), program will have "an other look", but logical flow remains exactly the same. You can force widget usage through "supermode" variable ( possible values: "yad", "gtkdialog", "kdialog", "zenity", "Xdialog", "dialog", "none" ; e.g.: >export supermode="kdialog" && source easybashgui && message Hello ). NOTE on "none" mode: you have to make sure STDERR *is not* redirected, in order to see shell boxes in your terminal. -In EasyBashGUI "suite" there are a launcher ( "easybashgui" ), a launcher that toggles some debug options ( "easybashgui-debug" ), a widget library ( "easybashgui_X.X.X.lib" ), a script to quick test it ( "easybashgui_test.sh" ), and a stand-alone script to create dialog boxes externally ( "easydialog.sh" ). Moreover there is an other library too ( "easybashlib" ) for optional ancillary functions ( thanks to it you don't need anymore to use "clean_temp" function at the end of your scripts ). +In EasyBashGUI "suite" there are a launcher ( "easybashgui" ), a launcher that toggles some debug options ( "easybashgui-debug" ), a widget library ( "easybashgui_X.X.X.lib" ), and a stand-alone script to create dialog boxes externally ( "easydialog.sh" ). Moreover there is an other library too ( "easybashlib" ) for optional ancillary functions ( thanks to it you don't need anymore to use "clean_temp()" function at the end of your EBG scripts ). @@ -231,7 +231,7 @@ Thanks to Lucio Messina for "Debian policy" tips and support. -Please let me know if my work was useful for you. +Please let me know if my work has been useful for you. Vittorio Cagnetta vaisarger@gmail.com https://github.com/BashGui/easybashgui diff --git a/lib/easybashgui.lib b/lib/easybashgui.lib index ba8c803..3aaca88 100755 --- a/lib/easybashgui.lib +++ b/lib/easybashgui.lib @@ -35,7 +35,7 @@ ##################################### ##################################### # -LIB_VERSION="11.0.0" +LIB_VERSION="11.0.1" LIB_NAME="easybashgui.lib" LIB_URL="https://github.com/BashGui/easybashgui" LIB_AUTHOR="Vittorio Cagnetta" @@ -204,7 +204,7 @@ if [ ${#esistenza_gtkdialog} -gt 0 ] required_gtkdialog_second_field=7 required_gtkdialog_third_field=20 # - vers_gtkdialog="$(gtkdialog --version | cut -d ' ' -f 3 )" + vers_gtkdialog="$(gtkdialog --version | cut -d ' ' -f 3 | head -n 1 )" if [ $(echo -n "${vers_gtkdialog}" | tr -dc '[[:digit:]]' | wc -c ) -gt 0 ] then vers_gtkdialog_primo_campo=$(echo "${vers_gtkdialog}" | cut -d '.' -f 1 ) @@ -2121,9 +2121,17 @@ elif [ "${mode}" = "gtkdialog" ] #echo "${exit_code}" 1>&2 if [ "${exit_code}" = "0" ] then - echo "${TEXT}" 1> "${dir_tmp}/${file_tmp}" && echo "${TEXT}" 1>&2 + echo "${TEXT}" 1> "${dir_tmp}/${file_tmp}" + # + if [ "${window_title}" = "editing text" ] + then + echo "${TEXT}" 1>&2 + else + echo 1>&2 + fi # fi + # return "${exit_code}" # } @@ -2395,7 +2403,7 @@ elif [ "${mode}" = "dialog" ] cat - 1> "${dir_tmp}/${file_tmp}" if [ "${dialogo}" = "whiptail --fb" ] then - ${dialogo} --title "${supertitle:-EasyBashGUI}: ${window_title}" ${icona_Ok} --textbox "${file}" --scrolltext "${dimensione_finestra_1}" "${dimensione_finestra_2}" 2> /dev/null + ${dialogo} --title "${supertitle:-EasyBashGUI}: ${window_title} (select OK by arrows)" ${icona_Ok} --textbox "${file}" --scrolltext "${dimensione_finestra_1}" "${dimensione_finestra_2}" 2> /dev/null else ${dialogo} --title "${supertitle:-EasyBashGUI}: ${window_title}" ${icona_Ok} --textbox "${file}" "${dimensione_finestra_1}" "${dimensione_finestra_2}" 2> /dev/null fi @@ -7691,3 +7699,4 @@ fi ## # [ "${easybashgui_debug_mode}" = "YES" ] && echo "[lib SOURCED]" +[ "${easybashgui_debug_mode}" = "NO" ] && : #This is user for getting exit code = 0 :-) diff --git a/lib/easybashlib b/lib/easybashlib index 45b34b6..0697fb7 100644 --- a/lib/easybashlib +++ b/lib/easybashlib @@ -242,9 +242,10 @@ function eb_kill_process_tree_of_pid() { # Define a mechanism for automatic clean up on exit, based upon the idea # http://www.linuxjournal.com/content/use-bash-trap-statement-cleanup-temporary-files +# #declare -a eb_on_exit_commands #UNUSEFUL since causes "unbound variable" because array is set ONLY if at least element exists... -ebg_on_exit_commands=( "echo \"EBG exiting...\"" ) -#echo "1) How many elements in array \${ebg_on_exit_commands[*]}: ${#ebg_on_exit_commands[*]} .........DEBUG" 1>&2 +ebg_on_exit_commands=( "echo -en \"\nEBG v.${MODULE_VERSION} exiting... \" 1>&2" ) +#echo "1) How many elements in array \${ebg_on_exit_commands[@]}: ${#ebg_on_exit_commands[@]} .........DEBUG" 1>&2 ebg_on_exit() { @@ -252,12 +253,14 @@ ebg_on_exit() # #echo "3) How many elements in array \${ebg_on_exit_commands[@]}: ${#ebg_on_exit_commands[*]} .........DEBUG" 1>&2 for (( i = $(( ${#ebg_on_exit_commands[@]} - 1 )) ; i > -1; i-- )) - do + do #echo "ebg_on_exit $i: ${ebg_on_exit_commands[${i}]} .........DEBUG" 1>&2 eb_debug_output "ebg_on_exit ${i}: ${ebg_on_exit_commands[${i}]}" eval "${ebg_on_exit_commands[${i}]}" done # + echo -e "Bye!" 1>&2 + # # Hint: Scripts that fork should start with "ebg_on_exit $0 killtree $BASHPID", to clean up child # processes. (Also remember to kill all disowned proceses if appropriate.) # diff --git a/makefile b/makefile index 74b3e2d..3965442 100755 --- a/makefile +++ b/makefile @@ -1,5 +1,5 @@ #EBGlib=$(wildcard easybashgui_[0-9].[0-9].[0-9]) -VERSION=11.0.0 +VERSION=11.0.1 #cartelle di destinazione DESTDIR ?= "" diff --git a/src/easybashgui b/src/easybashgui index 161372e..65d4884 100755 --- a/src/easybashgui +++ b/src/easybashgui @@ -80,7 +80,7 @@ # something like if [ -e $(eb_incl__absolute_path)/$module_*.*.* ] ? # ################################################################### -MODULE_VERSION="11.0.0" +MODULE_VERSION="11.0.1" MODULE_NAME="easybashgui" libexec_dir="/usr/lib/easybashgui" ################################################################### diff --git a/src/easybashgui-debug b/src/easybashgui-debug index 1bc8d0e..f49c6e5 100755 --- a/src/easybashgui-debug +++ b/src/easybashgui-debug @@ -80,7 +80,7 @@ # something like if [ -e $(eb_incl__absolute_path)/$module_*.*.* ] ? # ################################################################### -MODULE_VERSION="11.0.0" +MODULE_VERSION="11.0.1" MODULE_NAME="easybashgui-debug" ################################################################### #