updated displaydialog with title, closes #38

This commit is contained in:
Armin Briegel
2020-07-23 11:17:44 +02:00
parent 39d3dfceac
commit 246ce74f4e

View File

@@ -1002,9 +1002,10 @@ runAsUser() {
fi fi
} }
displaydialog() { # $1: message displaydialog() { # $1: message $2: title
message=${1:-"Message"} message=${1:-"Message"}
runAsUser /usr/bin/osascript -e "button returned of (display dialog \"$message\" buttons {\"Not Now\", \"Quit and Update\"} default button \"Quit and Update\")" title=${2:-"Installomator"}
runAsUser /usr/bin/osascript -e "button returned of (display dialog \"$message\" with title \"$title\" buttons {\"Not Now\", \"Quit and Update\"} default button \"Quit and Update\")"
} }
displaynotification() { # $1: message $2: title displaynotification() { # $1: message $2: title
@@ -1066,11 +1067,11 @@ checkRunningProcesses() {
pkill $x pkill $x
;; ;;
prompt_user) prompt_user)
button=$(displaydialog "The application $x needs to be updated. Quit $x to continue updating?") button=$(displaydialog "Quit “$x” to continue updating? (Leave this dialogue if you want to activate this update later)." "The application “$x” needs to be updated.")
if [[ $button = "Not Now" ]]; then if [[ $button = "Not Now" ]]; then
cleanupAndExit 10 "user aborted update" cleanupAndExit 10 "user aborted update"
else else
runAsUser osascript -e "tell app \"$x\" to quit" runAsUser osascript -e "tell app $x to quit"
fi fi
;; ;;
silent_fail) silent_fail)