Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue 47 - cenity: cancelling does not work #48

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions usr/lib/tik/lib/cenity
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ cenity() {
cancel=true
autoclose=false
pulsate=false
ctrlc=false
retvalue=0
columns=()
content=()
Expand Down Expand Up @@ -81,9 +82,9 @@ cenity() {
if ! $cancel; then
echo "No Cancel"
else
echo "Cancelled"
retvalue=1
return $retvalue
echo "Cancelled, press Enter to continue"
ctrlc=true
return 1
fi
}

Expand Down Expand Up @@ -119,6 +120,11 @@ cenity() {
fi

eval $1='$result'

if $ctrlc; then
retvalue=1
fi

return $retvalue
}

Expand Down Expand Up @@ -233,8 +239,8 @@ c_list() {
echo -e "\nPlease select a item number"
read

retval=$(printf "%s" "${lines[$REPLY]}" | cut -d $'\t' -f1)
eval $1='$retval'
local selected=$(printf "%s" "${lines[$REPLY]}" | cut -d $'\t' -f1)
eval $1='$selected'
}


Expand Down
3 changes: 2 additions & 1 deletion usr/lib/tik/lib/tik-functions
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ d(){
retval=0
if $gui; then
result="$(zenity "$@")" || retval=$?
log "[zenity][${retval}][${result}] $@"
else
cenity result "$@" || retval=$?
log "[cenity][${retval}][${result}] $@"
fi
log "[zenity][${retval}][${result}] $@"
case $retval in
0)
return 0
Expand Down