Merge ubiquity:sil2100/screen-reader-target-system into ubiquity:master

Proposed by Łukasz Zemczak
Status: Merged
Merged at revision: ce9b0bf7c905a11bedd4de3a3ab78017118ddfe8
Proposed branch: ubiquity:sil2100/screen-reader-target-system
Merge into: ubiquity:master
Diff against target: 24 lines (+10/-3)
1 file modified
ubiquity/frontend/gtk_ui.py (+10/-3)
Reviewer Review Type Date Requested Status
Mathieu Trudel-Lapierre Approve
Michael Hudson-Doyle Approve
Review via email: mp+376144@code.launchpad.net

Commit message

Make sure the screen-reader-enabled setting gets passed to the target system - by setting UBIQUITY_A11Y_PROFILE so that the casper accessibility hook can pick it up

Description of the change

Make sure the screen-reader-enabled setting gets passed to the target system - by setting UBIQUITY_A11Y_PROFILE so that he casper accessibility hook can pick it up.

Previously, when we had unity and lightdm, there was a listener taking care of setting UBIQUITY_A11Y_PROFILE on screen-reader switch-on. Since long this is no longer valid, so it never worked. Setting of the env variable then gets forwarded to the
30accessibility hook from casper.

To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

This seems fine, I guess. There's a typo in the commit message (he->the).

Revision history for this message
Michael Hudson-Doyle (mwhudson) :
review: Approve
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) :
review: Approve
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Fixed the commit message, thanks! As for your inline comment: the environment variable is only used for this very purpose (only for the screen reader), it's an env that's only shared between ubiquity and the casper hook. So I guessed that if orca is not installed, it anyway makes no sense to make the hook do anything. There is no risk of us disabling something that was supposed to be enabled.
Let me merge it then!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/ubiquity/frontend/gtk_ui.py b/ubiquity/frontend/gtk_ui.py
2index 61df505..a04e3a5 100644
3--- a/ubiquity/frontend/gtk_ui.py
4+++ b/ubiquity/frontend/gtk_ui.py
5@@ -162,9 +162,16 @@ class Controller(ubiquity.frontend.base.Controller):
6
7 def on_screen_reader_enabled_changed(gsettings, key):
8 # handle starting orca only, it exits itself when the key is false
9- if (key == "screen-reader-enabled" and gsettings.get_boolean(key) and
10- osextras.find_on_path('orca')):
11- subprocess.Popen(['orca'], preexec_fn=misc.drop_all_privileges)
12+ if key == "screen-reader-enabled":
13+ # Besides starting orca, also make sure the screen-reader-enabled
14+ # setting gets passed to the target system.
15+ if (gsettings.get_boolean(key) and osextras.find_on_path('orca')):
16+ # Enable
17+ subprocess.Popen(['orca'], preexec_fn=misc.drop_all_privileges)
18+ os.environ['UBIQUITY_A11Y_PROFILE'] = 'screen-reader'
19+ elif 'UBIQUITY_A11Y_PROFILE' in os.environ:
20+ # Disable
21+ del os.environ['UBIQUITY_A11Y_PROFILE']
22
23
24 class Wizard(BaseFrontend):

Subscribers

People subscribed via source and target branches