Merge lp:~seb128/ubiquity/start-screen-reader into lp:ubiquity

Proposed by Sebastien Bacher
Status: Merged
Merged at revision: 6627
Proposed branch: lp:~seb128/ubiquity/start-screen-reader
Merge into: lp:ubiquity
Diff against target: 102 lines (+26/-28)
2 files modified
debian/changelog (+8/-1)
ubiquity/frontend/gtk_ui.py (+18/-27)
To merge this branch: bzr merge lp:~seb128/ubiquity/start-screen-reader
Reviewer Review Type Date Requested Status
Iain Lane Approve
Jean-Baptiste Lallement Needs Fixing
Review via email: mp+343975@code.launchpad.net

Commit message

Don't desactivate the screen-reader desktop keybinding, that was
needed when ubiquity was handling the key press events but now
gsd-media-keys is doing that. Listen to the corresponding key to
start orca under ubiquity-dm since gnome-session isn't there to do it.

Description of the change

Don't desactivate the screen-reader desktop keybinding, that was
needed when ubiquity was handling the key press events but now
gsd-media-keys is doing that. Listen to the corresponding key to
start orca under ubiquity-dm since gnome-session isn't there to do it.

To post a comment you must log in.
Revision history for this message
Iain Lane (laney) wrote :

Two nitpicks and one other change requested, but looks mostly good - thanks!

review: Needs Fixing
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

I have nothing more to add that the remarks Laney already had. Reading the value calling directly the callback is the best way btw. :)

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

package fails to build due to pep8 tests

./tests/run-pep8
ubiquity/frontend/gtk_ui.py:161:1: E302 expected 2 blank lines, found 1
ubiquity/frontend/gtk_ui.py:167:1: E302 expected 2 blank lines, found 1
ubiquity/frontend/gtk_ui.py:724:80: E501 line too long (88 > 79 characters)
ubiquity/frontend/gtk_ui.py:725:80: E501 line too long (106 > 79 characters)
ubiquity/frontend/gtk_ui.py:726:1: W293 blank line contains whitespace

review: Needs Fixing
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

+1 for me, I trust you testing it, but it looks syntactically good, as long as pep8 passes :)

6628. By Sebastien Bacher

Tweaks to address the first review comments

6629. By Sebastien Bacher

Identation, whitespace and new lines tweaks

Revision history for this message
Iain Lane (laney) wrote :

thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2018-04-24 10:13:17 +0000
3+++ debian/changelog 2018-04-24 13:29:15 +0000
4@@ -1,4 +1,11 @@
5-ubiquity (18.04.10ubuntu1) UNRELEASED; urgency=medium
6+ubiquity (18.04.11) UNRELEASED; urgency=medium
7+
8+ [ Sebastien Bacher]
9+ * Don't desactivate the screen-reader desktop keybinding, that was
10+ needed when ubiquity was handling the key press events but now
11+ gsd-media-keys is doing that. Listen to the corresponding key to
12+ start orca under ubiquity-dm since gnome-session isn't there to do it.
13+ (lp: #1741690)
14
15 [ Didier Roche ]
16 * Record OEM installation mode in telemetry data. (LP: #1765693)
17
18=== modified file 'ubiquity/frontend/gtk_ui.py'
19--- ubiquity/frontend/gtk_ui.py 2018-03-26 08:11:13 +0000
20+++ ubiquity/frontend/gtk_ui.py 2018-04-24 13:29:15 +0000
21@@ -50,7 +50,7 @@
22
23 # in query mode we won't be in X, but import needs to pass
24 if 'DISPLAY' in os.environ:
25- from gi.repository import Gtk, Gdk, GObject, GLib, Atk
26+ from gi.repository import Gtk, Gdk, GObject, GLib, Atk, Gio
27 from ubiquity import gtkwidgets
28
29 from ubiquity import (
30@@ -159,6 +159,13 @@
31 self._wizard.switch_to_install_interface()
32
33
34+def on_screen_reader_enabled_changed(gsettings, key):
35+ # handle starting orca only, it exits itself when the key is false
36+ if (key == "screen-reader-enabled" and gsettings.get_boolean(key) and
37+ osextras.find_on_path('orca')):
38+ subprocess.Popen(['orca'], preexec_fn=misc.drop_all_privileges)
39+
40+
41 class Wizard(BaseFrontend):
42 def __init__(self, distro):
43 def add_subpage(self, steps, name):
44@@ -234,6 +241,7 @@
45 self.timeout_id = None
46 self.screen_reader = False
47 self.orca_process = None
48+ self.a11y_settings = None
49
50 # To get a "busy mouse":
51 self.watch = Gdk.Cursor.new(Gdk.CursorType.WATCH)
52@@ -537,31 +545,6 @@
53
54 gsettings.set(gs_schema, gs_key, gs_value)
55
56- def disable_screen_reader(self):
57- gs_key = 'screenreader'
58- for gs_schema in 'org.gnome.settings-daemon.plugins.media-keys', \
59- 'org.mate.SettingsDaemon.plugins.media-keys':
60- gs_previous = '%s/%s' % (gs_schema, gs_key)
61- if gs_previous in self.gsettings_previous:
62- return
63-
64- gs_value = gsettings.get(gs_schema, gs_key)
65- self.gsettings_previous[gs_previous] = gs_value
66-
67- if gs_value:
68- gsettings.set(gs_schema, gs_key, '')
69-
70- atexit.register(self.enable_screen_reader)
71-
72- def enable_screen_reader(self):
73- gs_key = 'screenreader'
74- for gs_schema in 'org.gnome.settings-daemon.plugins.media-keys', \
75- 'org.mate.SettingsDaemon.plugins.media-keys':
76- gs_previous = '%s/%s' % (gs_schema, gs_key)
77- gs_value = self.gsettings_previous[gs_previous]
78-
79- gsettings.set(gs_schema, gs_key, gs_value)
80-
81 def disable_screensaver(self):
82 gs_schema = 'org.gnome.desktop.screensaver'
83 gs_key = 'idle-activation-enabled'
84@@ -737,9 +720,17 @@
85 self.disable_volume_manager()
86 self.disable_screensaver()
87 self.disable_powermgr()
88- self.disable_screen_reader()
89
90 if 'UBIQUITY_ONLY' in os.environ:
91+ # handle orca only in ubiquity-dm where there is no gnome-session
92+ self.a11y_settings = Gio.Settings.new(
93+ "org.gnome.desktop.a11y.applications")
94+ self.a11y_settings.connect("changed::screen-reader-enabled",
95+ on_screen_reader_enabled_changed)
96+ # enable if needed and a key read is needed to connect the signal
97+ on_screen_reader_enabled_changed(self.a11y_settings,
98+ "screen-reader-enabled")
99+
100 self.disable_logout_indicator()
101 if 'UBIQUITY_DEBUG' not in os.environ:
102 self.disable_terminal()

Subscribers

People subscribed via source and target branches

to status/vote changes: