Merge lp:~brandontschaefer/unity/get-real-ibus-activate-shortcut into lp:unity

Proposed by Brandon Schaefer
Status: Merged
Approved by: Christopher Townsend
Approved revision: no longer in the source branch.
Merged at revision: 3517
Proposed branch: lp:~brandontschaefer/unity/get-real-ibus-activate-shortcut
Merge into: lp:unity
Diff against target: 35 lines (+24/-2)
1 file modified
tests/autopilot/unity/tests/test_ibus.py (+24/-2)
To merge this branch: bzr merge lp:~brandontschaefer/unity/get-real-ibus-activate-shortcut
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Christopher Townsend Approve
Review via email: mp+186406@code.launchpad.net

Commit message

Get the real shortcut to activate ibus.

Description of the change

Use ibus config to get the list of shortcuts to activate ibus. Use the first one, we have to do some simple string manipulation. As IBus uses <mod><mod><mod>key for its string, and autopilot uses mod+mod+mod+key, so just replace all '>' with a +, and ignore all '<'.

To post a comment you must log in.
Revision history for this message
Christopher Townsend (townsend) wrote :

LGTM +1

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/autopilot/unity/tests/test_ibus.py'
--- tests/autopilot/unity/tests/test_ibus.py 2013-08-12 22:59:42 +0000
+++ tests/autopilot/unity/tests/test_ibus.py 2013-09-18 17:58:34 +0000
@@ -118,8 +118,30 @@
118 This method adds a cleanUp to reset the old keys once the test is done.118 This method adds a cleanUp to reset the old keys once the test is done.
119119
120 """120 """
121 # FIXME Need to set this using gsettings...removed old gconf code for now121 bus = get_ibus_bus()
122 self.activate_binding = 'Control+space'122 config = bus.get_config()
123
124 variant = config.get_value('general/hotkey', 'triggers')
125 shortcuts = []
126
127 # If none, assume default
128 if variant != None:
129 shortcuts = variant.unpack()
130 else:
131 shortcuts = ['<Super>space']
132
133 # IBus uses the format '<mod><mod><mod>key'
134 # Autopilot uses the format 'mod+mod+mod+key'
135 # replace all > with a +, and ignore the < char
136
137 shortcut = ""
138 for c in shortcuts[0]:
139 if c == '>':
140 shortcut += '+'
141 elif c != '<':
142 shortcut += c
143
144 self.activate_binding = shortcut
123 activate_release_binding_option = 'Alt+Release+Control_L'145 activate_release_binding_option = 'Alt+Release+Control_L'
124 self.activate_release_binding = 'Alt+Control_L'146 self.activate_release_binding = 'Alt+Control_L'
125147