summaryrefslogtreecommitdiffstats
path: root/config/chroot_local-includes
diff options
context:
space:
mode:
authoranonym <anonym@riseup.net>2016-03-14 16:50:11 +0100
committeranonym <anonym@riseup.net>2016-03-14 16:50:11 +0100
commita09727cb5430d65c16704615478ec0d05d42384f (patch)
tree6a97e21bfded615dc392e821ad81645ddb67441b /config/chroot_local-includes
parentec69ba3cbcfe3310b9e2a1e19041052ecbe22b21 (diff)
Drop zenity hacks to "focus" the negative answer.
Jessie's zenity introduced the --default-cancel option, finally! Will-fix: #11229
Diffstat (limited to 'config/chroot_local-includes')
-rwxr-xr-xconfig/chroot_local-includes/usr/local/bin/electrum6
-rwxr-xr-xconfig/chroot_local-includes/usr/local/bin/icedove6
-rwxr-xr-xconfig/chroot_local-includes/usr/local/bin/tor-browser7
-rwxr-xr-xconfig/chroot_local-includes/usr/local/sbin/i2p-browser7
-rwxr-xr-xconfig/chroot_local-includes/usr/local/sbin/unsafe-browser7
5 files changed, 12 insertions, 21 deletions
diff --git a/config/chroot_local-includes/usr/local/bin/electrum b/config/chroot_local-includes/usr/local/bin/electrum
index 7941df1..8cd54d8 100755
--- a/config/chroot_local-includes/usr/local/bin/electrum
+++ b/config/chroot_local-includes/usr/local/bin/electrum
@@ -22,10 +22,8 @@ verify_start () {
"
local launch="`gettext \"_Launch\"`"
local exit="`gettext \"_Exit\"`"
- # Since zenity can't set the default button to cancel, we switch the
- # labels and interpret the return value as its negation.
- if zenity --question --title "" --ok-label "${exit}" \
- --cancel-label "${launch}" --text "${dialog_msg}"; then
+ if ! zenity --question --title "" --text "${dialog_msg}" --default-cancel \
+ --ok-label "${launch}" --cancel-label "${exit}"; then
return 1
fi
}
diff --git a/config/chroot_local-includes/usr/local/bin/icedove b/config/chroot_local-includes/usr/local/bin/icedove
index 53ca70f..e879e5e 100755
--- a/config/chroot_local-includes/usr/local/bin/icedove
+++ b/config/chroot_local-includes/usr/local/bin/icedove
@@ -22,10 +22,8 @@ warn_about_claws_mail_persistence() {
local launch="`gettext \"_Launch\"`"
local exit="`gettext \"_Exit\"`"
- # Since zenity can't set the default button to cancel, we switch the
- # labels and interpret the return value as its negation.
- if zenity --question --title "" --ok-label "${exit}" \
- --cancel-label "${launch}" --text "${dialog_msg}"; then
+ if ! zenity --question --title "" --text "${dialog_msg}" --default-cancel \
+ --ok-label "${launch}" --cancel-label "${exit}"; then
return 1
fi
}
diff --git a/config/chroot_local-includes/usr/local/bin/tor-browser b/config/chroot_local-includes/usr/local/bin/tor-browser
index 0e18b79..ac3905f 100755
--- a/config/chroot_local-includes/usr/local/bin/tor-browser
+++ b/config/chroot_local-includes/usr/local/bin/tor-browser
@@ -41,11 +41,8 @@ ask_for_confirmation() {
local dialog_text="`gettext \"Tor is not ready. Start Tor Browser anyway?\"`"
local dialog_start="`gettext \"Start Tor Browser\"`"
local dialog_cancel="`gettext \"Cancel\"`"
- # zenity can't set the default button to cancel, so we switch the
- # labels and interpret the return value as its negation.
- ! zenity --question \
- --title "$dialog_title" --text="$dialog_text" \
- --cancel-label "$dialog_start" --ok-label "$dialog_cancel"
+ zenity --question --title "$dialog_title" --text="$dialog_text" \
+ --default-cancel --ok-label "$dialog_start" --cancel-label "$dialog_cancel"
}
start_browser() {
diff --git a/config/chroot_local-includes/usr/local/sbin/i2p-browser b/config/chroot_local-includes/usr/local/sbin/i2p-browser
index e72b759..32f0b7d 100755
--- a/config/chroot_local-includes/usr/local/sbin/i2p-browser
+++ b/config/chroot_local-includes/usr/local/sbin/i2p-browser
@@ -37,10 +37,9 @@ verify_start () {
`gettext \"The I2P router console is not ready.\"`"
local launch="`gettext \"_Launch\"`"
local exit="`gettext \"_Exit\"`"
- # Since zenity can't set the default button to cancel, we switch the
- # labels and interpret the return value as its negation.
- if sudo -u "${SUDO_USER}" zenity --question --title "" --ok-label "${exit}" \
- --cancel-label "${launch}" --text "${dialog_msg}"; then
+ if ! sudo -u "${SUDO_USER}" \
+ zenity --question --title "" --text "${dialog_msg}" --default-cancel \
+ --cancel-label "${exit}" --ok-label "${launch}" ; then
exit 0
fi
}
diff --git a/config/chroot_local-includes/usr/local/sbin/unsafe-browser b/config/chroot_local-includes/usr/local/sbin/unsafe-browser
index ed439c9..81211f2 100755
--- a/config/chroot_local-includes/usr/local/sbin/unsafe-browser
+++ b/config/chroot_local-includes/usr/local/sbin/unsafe-browser
@@ -40,10 +40,9 @@ verify_start () {
`gettext \"Network activity within the Unsafe Browser is <b>not anonymous</b>.\\nOnly use the Unsafe Browser if necessary, for example\\nif you have to login or register to activate your Internet connection.\"`"
local launch="`gettext \"_Launch\"`"
local exit="`gettext \"_Exit\"`"
- # Since zenity can't set the default button to cancel, we switch the
- # labels and interpret the return value as its negation.
- if sudo -u "${SUDO_USER}" zenity --question --title "" --ok-label "${exit}" \
- --cancel-label "${launch}" --text "${dialog_msg}"; then
+ if ! sudo -u "${SUDO_USER}" \
+ zenity --question --title "" --text "${dialog_msg}" --default-cancel \
+ --ok-label "${launch}" --cancel-label "${exit}"; then
exit 0
fi
}