I have a set of Service Menus for Dolphin that use Kdialog for pop-up actions and user input. I noticed when I have a Yes-No dialog box open, if I close it rather than responding Yes or No, the script does not exit - it continues to the next part of the script, which is a password prompt. If I close the password dialog, the script exits.
Obviously, the desired action would be for the script to quit/exit when any Kdailog window is closed.
Anyone know how to make this happen?
Sample from a script:
So if I launch the command from the service menu and get the "kdailog --yesno..." window as above and close it by clicking on the "X" on the window titlebar, I still get the "kdialog --password..." window. But if I then close the password window, the script exits.
It seems like I should be able to correct the behavior by re-writing this part and reversing the action:
Obviously, the desired action would be for the script to quit/exit when any Kdailog window is closed.
Anyone know how to make this happen?
Sample from a script:
Code:
if [[ $isreadonly = "true" ]]; then
kdialog --title "READ-ONLY btrfs Subvolume."\
--yesno "This folder is a READ-ONLY btrfs Subvolume.\n Would you like to change this Read-Only subvolume to Read-Write?"\
--no-label "Yes, make it Read-Write"\
--yes-label "No, leave it Read-Only"
#close dialog silently
if [[ "$?" = 0 ]]; then
exit 0
fi
PASSWD="$(kdialog --password "This task requires SUDO access. Enter your password: ")"
#allow cancel to exit cleanly
if [[ -z "$PASSWD" ]]; then
kdialog --passivepopup "Info action cancelled" 6
exit 0
fi
It seems like I should be able to correct the behavior by re-writing this part and reversing the action:
Code:
#close dialog silently
if [[ "$?" = 0 ]]; then
exit 0
fi






Comment