Skip to content

Commit

Permalink
Update button labels on the Beta dialog
Browse files Browse the repository at this point in the history
The terminating dots were removed from the labels on the buttons on the Beta dialog.
  • Loading branch information
jstodola committed Jun 27, 2023
1 parent 8bb38dc commit 0e1a734
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions anabot/runtime/installation/welcome/beta_dialog.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from anabot.conditions import is_distro, is_anaconda_version_lt
from anabot.runtime.decorators import handle_action, handle_check
from anabot.runtime.functions import get_attr, getnode
from anabot.runtime.translate import tr
Expand All @@ -7,15 +8,25 @@
handle_act = lambda x: handle_action(_local_path + x)
handle_chck = lambda x: handle_check(_local_path + x)

def _is_button_with_dot():
# The terminating dots were removed from the labels on the buttons on the Beta dialog.
# RHEL: https://github.com/rhinstaller/anaconda/pull/4771/commits/3a28c203cccc572db498669d76e57ceb8bbd772d
if is_distro('rhel') and is_anaconda_version_lt('34.25.3.4'):
return True
# Fedora: https://github.com/rhinstaller/anaconda/commit/64219c599759bfec1e538fe30d4a6f6819a3c65d
if is_distro('fedora') and is_anaconda_version_lt('39.4'):
return True
return False

@handle_act('')
def beta_dialog_handler(element, app_node, local_node):
dialog_action = get_attr(element, "dialog", "accept") == "accept"
try:
beta_dialog = getnode(app_node, "dialog", "Beta Warn")
if dialog_action:
button_text = "I want to _proceed."
button_text = "I want to _proceed." if _is_button_with_dot() else "I want to _proceed"
else:
button_text = "I want to _exit."
button_text = "I want to _exit." if _is_button_with_dot() else "I want to _exit"
button_text = tr(button_text, context="GUI|Welcome|Beta Warn Dialog")
button = getnode(beta_dialog, "push button", button_text)
button.click()
Expand Down

0 comments on commit 0e1a734

Please sign in to comment.