Commit a09727cb authored by anonym's avatar anonym

Drop zenity hacks to "focus" the negative answer.

Jessie's zenity introduced the --default-cancel option, finally!

Will-fix: #11229
parent ec69ba3c
...@@ -22,10 +22,8 @@ verify_start () { ...@@ -22,10 +22,8 @@ verify_start () {
" "
local launch="`gettext \"_Launch\"`" local launch="`gettext \"_Launch\"`"
local exit="`gettext \"_Exit\"`" local exit="`gettext \"_Exit\"`"
# Since zenity can't set the default button to cancel, we switch the if ! zenity --question --title "" --text "${dialog_msg}" --default-cancel \
# labels and interpret the return value as its negation. --ok-label "${launch}" --cancel-label "${exit}"; then
if zenity --question --title "" --ok-label "${exit}" \
--cancel-label "${launch}" --text "${dialog_msg}"; then
return 1 return 1
fi fi
} }
......
...@@ -22,10 +22,8 @@ warn_about_claws_mail_persistence() { ...@@ -22,10 +22,8 @@ warn_about_claws_mail_persistence() {
local launch="`gettext \"_Launch\"`" local launch="`gettext \"_Launch\"`"
local exit="`gettext \"_Exit\"`" local exit="`gettext \"_Exit\"`"
# Since zenity can't set the default button to cancel, we switch the if ! zenity --question --title "" --text "${dialog_msg}" --default-cancel \
# labels and interpret the return value as its negation. --ok-label "${launch}" --cancel-label "${exit}"; then
if zenity --question --title "" --ok-label "${exit}" \
--cancel-label "${launch}" --text "${dialog_msg}"; then
return 1 return 1
fi fi
} }
......
...@@ -41,11 +41,8 @@ ask_for_confirmation() { ...@@ -41,11 +41,8 @@ ask_for_confirmation() {
local dialog_text="`gettext \"Tor is not ready. Start Tor Browser anyway?\"`" local dialog_text="`gettext \"Tor is not ready. Start Tor Browser anyway?\"`"
local dialog_start="`gettext \"Start Tor Browser\"`" local dialog_start="`gettext \"Start Tor Browser\"`"
local dialog_cancel="`gettext \"Cancel\"`" local dialog_cancel="`gettext \"Cancel\"`"
# zenity can't set the default button to cancel, so we switch the zenity --question --title "$dialog_title" --text="$dialog_text" \
# labels and interpret the return value as its negation. --default-cancel --ok-label "$dialog_start" --cancel-label "$dialog_cancel"
! zenity --question \
--title "$dialog_title" --text="$dialog_text" \
--cancel-label "$dialog_start" --ok-label "$dialog_cancel"
} }
start_browser() { start_browser() {
......
...@@ -37,10 +37,9 @@ verify_start () { ...@@ -37,10 +37,9 @@ verify_start () {
`gettext \"The I2P router console is not ready.\"`" `gettext \"The I2P router console is not ready.\"`"
local launch="`gettext \"_Launch\"`" local launch="`gettext \"_Launch\"`"
local exit="`gettext \"_Exit\"`" local exit="`gettext \"_Exit\"`"
# Since zenity can't set the default button to cancel, we switch the if ! sudo -u "${SUDO_USER}" \
# labels and interpret the return value as its negation. zenity --question --title "" --text "${dialog_msg}" --default-cancel \
if sudo -u "${SUDO_USER}" zenity --question --title "" --ok-label "${exit}" \ --cancel-label "${exit}" --ok-label "${launch}" ; then
--cancel-label "${launch}" --text "${dialog_msg}"; then
exit 0 exit 0
fi fi
} }
......
...@@ -40,10 +40,9 @@ verify_start () { ...@@ -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.\"`" `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 launch="`gettext \"_Launch\"`"
local exit="`gettext \"_Exit\"`" local exit="`gettext \"_Exit\"`"
# Since zenity can't set the default button to cancel, we switch the if ! sudo -u "${SUDO_USER}" \
# labels and interpret the return value as its negation. zenity --question --title "" --text "${dialog_msg}" --default-cancel \
if sudo -u "${SUDO_USER}" zenity --question --title "" --ok-label "${exit}" \ --ok-label "${launch}" --cancel-label "${exit}"; then
--cancel-label "${launch}" --text "${dialog_msg}"; then
exit 0 exit 0
fi fi
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment