Merge lp:~themuso/ubiquity/maybe-ubiquity-a11y-profiles into lp:ubiquity

Proposed by Luke Yelavich
Status: Merged
Merged at revision: 4807
Proposed branch: lp:~themuso/ubiquity/maybe-ubiquity-a11y-profiles
Merge into: lp:ubiquity
Diff against target: 182 lines (+105/-12)
5 files modified
bin/ubiquity-dm (+9/-11)
debian/changelog (+13/-0)
debian/control (+1/-1)
gui/gtk/ubiquity.ui (+36/-0)
ubiquity/frontend/gtk_ui.py (+46/-0)
To merge this branch: bzr merge lp:~themuso/ubiquity/maybe-ubiquity-a11y-profiles
Reviewer Review Type Date Requested Status
Evan Pending
Review via email: mp+70516@code.launchpad.net

Description of the change

This branch adds support for activating some accessibility profiles via an indicator and keyboard shortcuts when in maybe-ubiquity mode. The indicator and shortcuts will stay active for the entire install process.

To post a comment you must log in.
4795. By Luke Yelavich

Merge from trunk

4796. By Luke Yelavich

Merge from trunk

4797. By Luke Yelavich

Fix typo

4798. By Luke Yelavich

Fix up ubiquity.ui file

4799. By Luke Yelavich

Fix some calls to gdk now we are using all pygi

Revision history for this message
Luke Yelavich (themuso) wrote :

One thing I forgot to add to merge comments. I added keypress events as well as keyboard shortcuts to menu items for the indicator menu items because 1) the keyboard shortcuts in the ui file alone don;t work naturally, so the keypress events are needed. 2) I couldn't work out how to show the shortcut keys in the menu any other way. If there is a better way, I'm happy to be pointed in the right direction.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/ubiquity-dm'
2--- bin/ubiquity-dm 2011-08-09 10:11:44 +0000
3+++ bin/ubiquity-dm 2011-08-10 06:14:31 +0000
4@@ -265,9 +265,6 @@
5 os.environ['SUDO_UID'] = str(self.uid)
6 os.environ['SUDO_GID'] = str(self.gid)
7 os.environ['GVFS_DISABLE_FUSE' ] = '1'
8- # Share Orbit between ubiquity (running as root) and the non-root GNOME
9- # applications. This lets ubiquity communicate with ATI-SPI.
10- os.environ['ORBIT_SOCKETDIR'] = '/tmp/orbit-%s' % self.username
11
12 ck_open_session(self.uid)
13
14@@ -320,14 +317,15 @@
15 preexec_fn=self.drop_privileges)
16 accessibility = subp.communicate()[0].rstrip('\n')
17 # Accessibility infrastructure
18- if accessibility == 'true':
19- if os.path.exists('/usr/lib/at-spi2-core/at-spi-bus-launcher'):
20- extras.append(subprocess.Popen(
21- ['/usr/lib/at-spi2-core/at-spi-bus-launcher',
22- '--launch-immediately'],
23- stdin=null, stdout=logfile, stderr=logfile,
24- preexec_fn=self.drop_privileges))
25- os.environ['GTK_MODULES'] = 'gail:atk-bridge'
26+ with open('/proc/cmdline', 'r') as fp:
27+ if (accessibility == 'true' or 'maybe-ubiquity' in fp.readline()):
28+ if os.path.exists('/usr/lib/at-spi2-core/at-spi-bus-launcher'):
29+ extras.append(subprocess.Popen(
30+ ['/usr/lib/at-spi2-core/at-spi-bus-launcher',
31+ '--launch-immediately'],
32+ stdin=null, stdout=logfile, stderr=logfile,
33+ preexec_fn=self.drop_privileges))
34+ os.environ['GTK_MODULES'] = 'gail:atk-bridge'
35
36 # Don't show the background image in v1 accessibility profile. It
37 # is not shown in the GNOME desktop after all.
38
39=== modified file 'debian/changelog'
40--- debian/changelog 2011-08-09 15:25:03 +0000
41+++ debian/changelog 2011-08-10 06:14:31 +0000
42@@ -11,6 +11,19 @@
43 [ Brian Murray ]
44 * Instead of sending people to +filebug recommend using apport
45
46+ [ Luke Yelavich ]
47+ * Add support for launching high contrast, screen reader, keyboard modifiers,
48+ and onscreen keyboard accessibility profiles in maybe-ubiquity mode, high
49+ contrast and screen reader profiles being launcheable either from an
50+ indicator, or via keyboard shortcut, the rest of the profiles available
51+ via the indicator only
52+ * bin/ubiquity-dm:
53+ - Start at-spi either when an appropriate accessibility profile is enabled,
54+ or when maybe-ubiquity mode is enabled
55+ - Remove references to orbit, as the a11y stack now uses dbus
56+ * debian/control: Add python-appindicator as a dependency of
57+ ubiquity-frontend-gtk
58+
59 -- Brian Murray <brian@ubuntu.com> Tue, 09 Aug 2011 08:04:40 -0700
60
61 ubiquity (2.7.14) oneiric; urgency=low
62
63=== modified file 'debian/control'
64--- debian/control 2011-08-09 08:35:24 +0000
65+++ debian/control 2011-08-10 06:14:31 +0000
66@@ -43,7 +43,7 @@
67
68 Package: ubiquity-frontend-gtk
69 Architecture: any
70-Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, ubiquity (= ${binary:Version}), python-dbus, gir1.2-gtk-3.0, gir1.2-gdkpixbuf-2.0, gir1.2-vte-2.90, gir1.2-webkit-3.0, iso-codes, x-window-manager, gksu, python-xklavier, gir1.2-timezonemap-1.0, python-libxml2
71+Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, ubiquity (= ${binary:Version}), python-dbus, gir1.2-gtk-3.0, gir1.2-gdkpixbuf-2.0, gir1.2-vte-2.90, gir1.2-webkit-3.0, iso-codes, x-window-manager, gksu, python-xklavier, gir1.2-timezonemap-1.0, python-libxml2, python-appindicator
72 Suggests: gnome-control-center
73 Conflicts: ubuntu-express-frontend-gtk, espresso-frontend-gtk, ubiquity (<< 2.4.3)
74 Replaces: ubuntu-express-frontend-gtk, espresso-frontend-gtk, ubiquity (<< 2.4.3)
75
76=== modified file 'gui/gtk/ubiquity.ui'
77--- gui/gtk/ubiquity.ui 2011-08-09 15:25:03 +0000
78+++ gui/gtk/ubiquity.ui 2011-08-10 06:14:31 +0000
79@@ -1023,4 +1023,40 @@
80 <action-widget response="-7">exitbutton</action-widget>
81 </action-widgets>
82 </object>
83+ <object class="GtkMenu" id="a11y_indicator_menu">
84+ <child>
85+ <object class="GtkMenuItem" id="a11y_high_contrast">
86+ <property name="visible">True</property>
87+ <property name="label" translatable="yes">_High Contrast</property>
88+ <property name="use_underline">True</property>
89+ <accelerator key="H" signal="activate" modifiers="GDK_CONTROL_MASK"/>
90+ <signal name="activate" handler="a11y_profile_high_contrast_activate"/>
91+ </object>
92+ </child>
93+ <child>
94+ <object class="GtkMenuItem" id="a11y_screen_reader">
95+ <property name="visible">True</property>
96+ <property name="label" translatable="yes">_Screen Reader</property>
97+ <property name="use_underline">True</property>
98+ <accelerator key="S" signal="activate" modifiers="GDK_CONTROL_MASK"/>
99+ <signal name="activate" handler="a11y_profile_screen_reader_activate"/>
100+ </object>
101+ </child>
102+ <child>
103+ <object class="GtkMenuItem" id="a11y_keyboard_modifiers">
104+ <property name="visible">True</property>
105+ <property name="label" translatable="yes">_Keyboard Modifiers</property>
106+ <property name="use_underline">True</property>
107+ <signal name="activate" handler="a11y_profile_keyboard_modifiers_activate"/>
108+ </object>
109+ </child>
110+ <child>
111+ <object class="GtkMenuItem" id="a11y_onscreen_keyboard">
112+ <property name="visible">True</property>
113+ <property name="label" translatable="yes">_On-screen Keyboard</property>
114+ <property name="use_underline">True</property>
115+ <signal name="activate" handler="a11y_profile_onscreen_keyboard_activate"/>
116+ </object>
117+ </child>
118+ </object>
119 </interface>
120
121=== modified file 'ubiquity/frontend/gtk_ui.py'
122--- ubiquity/frontend/gtk_ui.py 2011-08-09 10:18:40 +0000
123+++ ubiquity/frontend/gtk_ui.py 2011-08-10 06:14:31 +0000
124@@ -295,6 +295,18 @@
125
126 self.customize_installer()
127
128+ # Put up the a11y indicator in maybe-ubiquity mode
129+ if ('UBIQUITY_GREETER' in os.environ and os.path.exists('/usr/bin/casper-a11y-enable')):
130+ try:
131+ import appindicator
132+ self.indicator = appindicator.Indicator('ubiquity', 'accessibility-directory',
133+ appindicator.CATEGORY_OTHER)
134+ self.indicator.set_status(appindicator.STATUS_ACTIVE)
135+ self.indicator.set_menu(self.builder.get_object('a11y_indicator_menu'))
136+ self.live_installer.connect('key-press-event', self.a11y_profile_keys)
137+ except:
138+ print >>sys.stderr, "Unable to set up accessibility profile support."
139+
140 def all_children(self, parent):
141 if isinstance(parent, Gtk.Container):
142 def recurse(x, y):
143@@ -489,6 +501,40 @@
144 if self.thunar_previous:
145 self.thunar_set_volmanrc(self.thunar_previous)
146
147+ def a11y_profile_keys(self, window, event):
148+ if event.state & Gdk.CONTROL_MASK and event.keyval == Gdk.keyval_from_name('h'):
149+ self.a11y_profile_high_contrast_activate()
150+ elif event.state & Gdk.CONTROL_MASK and event.keyval == Gdk.keyval_from_name('s'):
151+ self.a11y_profile_screen_reader_activate()
152+
153+ def a11y_profile_high_contrast_activate(self, widget=None):
154+ subprocess.call(['log-output', '-t', 'ubiquity',
155+ '--pass-stdout', '/usr/bin/casper-a11y-enable',
156+ 'high-contrast'], preexec_fn=misc.drop_all_privileges)
157+ os.environ['UBIQUITY_A11Y_PROFILE'] = 'high-contrast'
158+
159+ def a11y_profile_screen_reader_activate(self, widget=None):
160+ subprocess.call(['log-output', '-t', 'ubiquity',
161+ '--pass-stdout', '/usr/bin/casper-a11y-enable',
162+ 'blindness'], preexec_fn=misc.drop_all_privileges)
163+ os.environ['UBIQUITY_A11Y_PROFILE'] = 'screen-reader'
164+ if os.path.exists('/usr/bin/orca'):
165+ subprocess.Popen(['/usr/bin/orca', '-n'], preexec_fn=misc.drop_all_privileges)
166+
167+ def a11y_profile_keyboard_modifiers_activate(self, widget=None):
168+ subprocess.call(['log-output', '-t', 'ubiquity',
169+ '--pass-stdout', '/usr/bin/casper-a11y-enable',
170+ 'keyboard-modifiers'], preexec_fn=misc.drop_all_privileges)
171+ os.environ['UBIQUITY_A11Y_PROFILE'] = 'keyboard-modifiers'
172+
173+ def a11y_profile_onscreen_keyboard_activate(self, widget=None):
174+ subprocess.call(['log-output', '-t', 'ubiquity',
175+ '--pass-stdout', '/usr/bin/casper-a11y-enable',
176+ 'onscreen-keyboard'], preexec_fn=misc.drop_all_privileges)
177+ os.environ['UBIQUITY_A11Y_PROFILE'] = 'onscreen-keyboard'
178+ if os.path.exists('/usr/bin/onboard'):
179+ subprocess.Popen(['/usr/bin/onboard'], preexec_fn=misc.drop_all_privileges)
180+
181 def run(self):
182 """run the interface."""
183

Subscribers

People subscribed via source and target branches

to status/vote changes: