Skip to content

Commit b8b0b3f

Browse files
committed
kdialog bugfixes
1 parent ee7a32c commit b8b0b3f

7 files changed

Lines changed: 105 additions & 29 deletions

File tree

docs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ Those variables are filled when the action its completed:
757757
* `${file_tmp}` a random file name where is content has the path of the chosen dir
758758

759759
``` bash
760-
fselect "[/path/to/directory/]"
760+
dselect "[/path/to/directory/]"
761761
```
762762

763763
#### input
@@ -897,7 +897,7 @@ Those variables are filled when the action its completed:
897897
* `${file_tmp}` random file name where is content has the values selected in order
898898

899899
``` bash
900-
ajust "[text]" "[min]" "[init]" "[max]"
900+
adjust "[text]" "[min]" "[init]" "[max]"
901901
```
902902

903903

docs/install.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Simplified way to code bash made GUI frontend dialogs! - Installation document!
1818
* `kdialog` 1.0+ https://invent.kde.org/utilities/kdialog (was part of kdebin)
1919
* `zenity` 2.30+ https://wiki.gnome.org/Projects/Zenity (may work with 2.X)
2020
* `xdialog` 1.0+ http://xdialog.free.fr/ (new support for https://wdlkmpx.github.io/Xdialog/ comming)
21+
* `qarma` 1.0+ https://github.com/luebking/qarma (limited support)
2122
* Interpreter runtime programs:
2223
* `coreutils` 8.0+ https://www.gnu.org/software/coreutils/
2324
* `bash` 3.0+ https://tiswww.case.edu/php/chet/bash/bashtop.html

lib/easybashgui.lib

Lines changed: 98 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
##############################################################
2525
##############################################################
2626
#
27-
LIB_VERSION="15.0.1"
27+
LIB_VERSION="15.0.2"
2828
LIB_NAME="easybashgui.lib"
2929
LIB_URL="https://github.com/BashGui/easybashgui"
3030
LIB_AUTHOR="Vittorio Cagnetta"
@@ -151,7 +151,7 @@ string_to_clean=':1: error: unexpected .*, expected .* - e.g. .*'
151151
#
152152
#####################################
153153
#
154-
# ... yad, gtkdialog, kdialog, zenity, Xdialog, gum or dialog ??? (since its experimental support, "qarma" has to be forced through "supermode")
154+
# ... yad, gtkdialog, kdialog, zenity, Xdialog, gum or dialog ? (NOTE: since its experimental support, "qarma" has to be forced through "supermode")
155155
#
156156
################
157157
#
@@ -500,7 +500,7 @@ if [ "${yad}" = "SI" ]
500500
if [ "${mode}" != "dialog" -a "${mode}" != "kdialog" ] # ...whatever dialog but "dialog" and "kdialog", moreover...
501501
then
502502
# ...only if DISPLAY var is set...
503-
if [ ${#DISPLAY} -gt 0 ]
503+
if [ ${#WAYLAND_DISPLAY} -gt 0 -o ${#DISPLAY} -gt 0 ]
504504
then
505505
# ;)
506506
mode="yad"
@@ -903,16 +903,28 @@ elif [ "${mode}" = "gtkdialog" ]
903903
#
904904
elif [ "${mode}" = "kdialog" ]
905905
then
906-
x_root=$(xwininfo -root | gsed -n s\#'^.*-geometry[[:blank:]]\([[:digit:]]\+\)[[:alpha:]]\([[:digit:]]\+\).*$'#'\1'#p )
907-
y_root=$(xwininfo -root | gsed -n s\#'^.*-geometry[[:blank:]]\([[:digit:]]\+\)[[:alpha:]]\([[:digit:]]\+\).*$'#'\2'#p )
908-
if [ ${#x_root} -gt 0 -a ${#y_root} -gt 0 ]
906+
esistenza_xwininfo="$(type "xwininfo" 2> /dev/null )"
907+
if [ ${#esistenza_xwininfo} -gt 0 ]
909908
then
910-
x="+$(( $(( ${x_root} / 2 )) - $(( ${width} / 2 )) ))"
911-
y="+$(( $(( ${y_root} / 2 )) - $(( ${height} / 2 )) ))"
909+
#
910+
x_root=$(xwininfo -root | gsed -n s\#'^.*-geometry[[:blank:]]\([[:digit:]]\+\)[[:alpha:]]\([[:digit:]]\+\).*$'#'\1'#p )
911+
y_root=$(xwininfo -root | gsed -n s\#'^.*-geometry[[:blank:]]\([[:digit:]]\+\)[[:alpha:]]\([[:digit:]]\+\).*$'#'\2'#p )
912+
if [ ${#x_root} -gt 0 -a ${#y_root} -gt 0 ]
913+
then
914+
x="+$(( $(( ${x_root} / 2 )) - $(( ${width} / 2 )) ))"
915+
y="+$(( $(( ${y_root} / 2 )) - $(( ${height} / 2 )) ))"
916+
fi
917+
#
918+
# => then:
919+
dimensione_finestra="--geometry=${width}x${height}${x}${y}"
920+
dimensione_finestra_1="--geometry=${width}x${height}${x}${y}"
921+
#
922+
else
923+
#
924+
dimensione_finestra=""
925+
dimensione_finestra_1=""
926+
#
912927
fi
913-
#
914-
dimensione_finestra="--geometry=${width}x${height}${x}${y}"
915-
dimensione_finestra_1="--geometry=${width}x${height}${x}${y}"
916928
dimensione_finestra_2=""
917929
no_tags=""
918930
no_buttons=""
@@ -8284,22 +8296,81 @@ elif [ "${mode}" = "kdialog" ]
82848296
#
82858297
fi #if [ ${#} -ge 2 ]
82868298
#
8287-
qdbus_or_dcop="$(if [ $(echo -n "$(type qdbus 2>/dev/null)" | wc -c ) -gt 0 ]
8299+
qdbus_or_dcop="qdbus"
8300+
export qdbus_bin="$(for dir in $(echo $PATH | tr ':' '\n'); do find "$dir" -name "qdbus"; done | head -n 1 )"
8301+
if [ ${#qdbus_bin} -gt 0 ]
8302+
then
8303+
#
8304+
: qdbus_or_dcop
8305+
: qdbus_bin
8306+
qdbus_or_dcop_bin="${qdbus_bin}"
8307+
#
8308+
else
8309+
#
8310+
export qdbus_bin="$(for dir in $(echo $PATH | tr ':' '\n'); do find "$dir" -name "qdbus?"; done | head -n 1 )"
8311+
if [ ${#qdbus_bin} -gt 0 ]
8312+
then
8313+
#
8314+
: qdbus_or_dcop
8315+
: qdbus_bin
8316+
qdbus_or_dcop_bin="${qdbus_bin}"
8317+
#
8318+
else
8319+
#
8320+
export qdbus_bin="$(for dir in $(echo $PATH | tr ':' '\n'); do find "$dir" -name "qdbus*qt?"; done | head -n 1 )"
8321+
if [ ${#qdbus_bin} -gt 0 ]
82888322
then
8289-
echo "qdbus"
8323+
#
8324+
: qdbus_or_dcop
8325+
: qdbus_bin
8326+
qdbus_or_dcop_bin="${qdbus_bin}"
8327+
#
82908328
else
8291-
echo "dcop"
8292-
fi )"
8329+
#
8330+
qdbus_or_dcop="dcop"
8331+
qdbus_or_dcop_bin="dcop"
8332+
#
8333+
fi
8334+
#
8335+
fi
8336+
#
8337+
fi
82938338
#
8294-
# Creazione della finestra...
8295-
progress_var="$(${dialogo} --title "${supertitle:-EasyBashGUI}" ${progress} "$(echo -e "${testo}" )" ${steps} )" ; ${qdbus_or_dcop} ${progress_var} showCancelButton "true"
8339+
if [ "${qdbus_or_dcop}" = "dcop" ]
8340+
then
8341+
#
8342+
if [ $(echo -n "$(type "dcop" 2>/dev/null)" | wc -c ) -gt 0 ]
8343+
then
8344+
#
8345+
: qdbus_or_dcop
8346+
#
8347+
else
8348+
#
8349+
qdbus_or_dcop="notify_progress"
8350+
#
8351+
fi
8352+
#
8353+
fi
8354+
#
8355+
###
8356+
#
8357+
# qdbus_or_dcop is: qdbus|dcop|notify_progress ...
8358+
# =>
8359+
if [ "${qdbus_or_dcop}" != "notify_progress" ]
8360+
then
8361+
# Creazione della finestra...
8362+
progress_var="$(${dialogo} --title "${supertitle:-EasyBashGUI}" ${progress} "$(echo -e "${testo}" )" ${steps} )"
8363+
${qdbus_or_dcop_bin} ${progress_var} showCancelButton "true"
8364+
#
8365+
fi
82968366
#
82978367
# Loop dei valori...
82988368
conteggio=0
8299-
until [ "$(${qdbus_or_dcop} ${progress_var} wasCancelled )" = "true" ]
8369+
until [ "$(${qdbus_or_dcop_bin} ${progress_var} wasCancelled 2>/dev/null )" = "true" ]
83008370
do
83018371
# Leggi lo StdIn...
83028372
read standard_input
8373+
[ ${#standard_input} -eq 0 ] && break
83038374
if [ "${standard_input}" = "PROGRESS" ]
83048375
then
83058376
#
@@ -8314,20 +8385,24 @@ elif [ "${mode}" = "kdialog" ]
83148385
# Setta la barra...
83158386
if [ "${qdbus_or_dcop}" = "qdbus" ]
83168387
then
8317-
${qdbus_or_dcop} ${progress_var} Set "" "value" ${conteggio} 1> /dev/null
8388+
${qdbus_or_dcop_bin} ${progress_var} Set "" "value" ${conteggio} 1> /dev/null
83188389
#
83198390
elif [ "${qdbus_or_dcop}" = "dcop" ]
83208391
then
8321-
${qdbus_or_dcop} ${progress_var} setProgress ${conteggio}
8392+
${qdbus_or_dcop_bin} ${progress_var} setProgress ${conteggio}
8393+
#
8394+
elif [ "${qdbus_or_dcop}" = "notify_progress" ]
8395+
then
8396+
#
8397+
notify_message "${supertitle:-EasyBashGUI}: $(echo -e "${testo}" ) ${conteggio}"
83228398
#
83238399
fi
83248400
#
83258401
# Alla fine esci dal loop...
8326-
risultato=$(echo "scale=10; ${conteggio} == ${steps}" | bc -l )
8327-
[ ${risultato} -eq 1 ] && break
8402+
risultato=$(echo "scale=10; ${conteggio} == ${steps}" | bc -l ); [ ${risultato} -eq 1 ] && break
83288403
#
83298404
done
8330-
sleep 1 ; ${qdbus_or_dcop} ${progress_var} close
8405+
sleep 1 ; [ "${qdbus_or_dcop}" != "notify_progress" ] && ${qdbus_or_dcop_bin} ${progress_var} close
83318406
#exit_if_user_closes_window
83328407
#
83338408
}

makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#EBGlib=$(wildcard easybashgui_[0-9].[0-9].[0-9])
2-
VERSION=15.0.1
2+
VERSION=15.0.2
33

44
#cartelle di destinazione
55
DESTDIR ?= ""

src/easybashgui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
#
6565
#
6666
###################################################################
67-
MODULE_VERSION="15.0.0"
67+
MODULE_VERSION="15.0.2"
6868
MODULE_NAME="easybashgui"
6969
libexec_dir="/usr/lib/easybashgui"
7070
###################################################################

src/easybashgui-debug

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
#
6565
#
6666
###################################################################
67-
MODULE_VERSION="15.0.0"
67+
MODULE_VERSION="15.0.2"
6868
MODULE_NAME="easybashgui-debug"
6969
###################################################################
7070
#

src/easydialog-legacy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ case ${funct} in
142142
"wait_seconds"|"wait_for"|"terminate_wait_for"|\
143143
"fselect"|"dselect"|\
144144
"input"|\
145-
"menu"|"list"|\
145+
"menu"|"tagged_menu"|"list"|\
146146
"progress"|\
147147
"adjust" )
148148
:;;

0 commit comments

Comments
 (0)