Merge lp:~michael-sheldon/ubuntu-keyboard/fix-1448145 into lp:ubuntu-keyboard

Proposed by Michael Sheldon
Status: Merged
Approved by: Bill Filler
Approved revision: 477
Merged at revision: 478
Proposed branch: lp:~michael-sheldon/ubuntu-keyboard/fix-1448145
Merge into: lp:ubuntu-keyboard
Diff against target: 84 lines (+52/-5)
2 files modified
src/view/abstracttexteditor.cpp (+3/-5)
tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py (+49/-0)
To merge this branch: bzr merge lp:~michael-sheldon/ubuntu-keyboard/fix-1448145
Reviewer Review Type Date Requested Status
system-apps-ci-bot continuous-integration Approve
PS Jenkins bot continuous-integration Pending
Ubuntu Phablet Team Pending
Review via email: mp+297047@code.launchpad.net

Commit message

Don't send preedit events when preedit is disabled

Description of the change

Don't send preedit events when preedit is disabled

To post a comment you must log in.
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

PASSED: Continuous integration, rev:475
https://jenkins.canonical.com/system-apps/job/lp-ubuntu-keyboard-ci/7/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build/539
    SUCCESS: https://jenkins.canonical.com/system-apps/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=default/54
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/539
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=vivid+overlay/527
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=xenial/527
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/523
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/523/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial/523
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial/523/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/523
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/523/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial/523
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial/523/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/523
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/523/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial/523
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial/523/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-ubuntu-keyboard-ci/7/rebuild

review: Approve (continuous-integration)
476. By Michael Sheldon

Add test for double caps in oxide

477. By Michael Sheldon

Fix flake8

Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

PASSED: Continuous integration, rev:477
https://jenkins.canonical.com/system-apps/job/lp-ubuntu-keyboard-ci/18/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build/588
    SUCCESS: https://jenkins.canonical.com/system-apps/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=default/72
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/588
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=vivid+overlay/567
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=xenial/567
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/561
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/561/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial/561
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial/561/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/561
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/561/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial/561
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial/561/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/561
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/561/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial/561
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial/561/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-ubuntu-keyboard-ci/18/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/view/abstracttexteditor.cpp'
2--- src/view/abstracttexteditor.cpp 2016-04-27 23:37:27 +0000
3+++ src/view/abstracttexteditor.cpp 2016-06-14 15:13:53 +0000
4@@ -428,7 +428,7 @@
5 d->word_engine->computeCandidates(d->text.data());
6 }
7
8- if (!d->word_engine->languageFeature()->showPrimaryInPreedit()) {
9+ if (!d->word_engine->languageFeature()->showPrimaryInPreedit() && d->preedit_enabled) {
10 sendPreeditString(d->text->preedit(), d->text->preeditFace(),
11 Replacement(d->text->cursorPosition()));
12 }
13@@ -535,10 +535,8 @@
14
15 if (d->word_engine->languageFeature()->commitOnSpace() || full_stop_inserted) {
16 commitPreedit();
17- } else {
18- if (d->preedit_enabled) {
19- d->word_engine->computeCandidates(d->text.data());
20- }
21+ } else if (d->preedit_enabled) {
22+ d->word_engine->computeCandidates(d->text.data());
23
24 sendPreeditString(d->text->preedit(), d->text->preeditFace(),
25 Replacement(d->text->cursorPosition()));
26
27=== modified file 'tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py'
28--- tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py 2016-04-28 00:42:26 +0000
29+++ tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py 2016-06-14 15:13:53 +0000
30@@ -1359,6 +1359,55 @@
31 Eventually(Equals(False))
32 )
33
34+ def test_double_caps(self):
35+ """Ensure that we switch back to lowercase after typing a letter in
36+ Oxide.
37+
38+ """
39+ qml = dedent("""
40+ import QtQuick 2.4
41+ import Ubuntu.Components 1.3
42+ import Ubuntu.Web 0.2
43+
44+ Rectangle {
45+ id: window
46+ objectName: "windowRectangle"
47+ color: "lightgrey"
48+
49+ WebView {
50+ anchors.fill: parent
51+ objectName: "webview"
52+ Component.onCompleted: {
53+ loadHtml("
54+ <html><body><textarea id='textarea'
55+ style='width: 100%; height: 100%;'></textarea>
56+ </body></html>"
57+ );
58+ }
59+ }
60+ }
61+
62+ """)
63+ gsettings = Gio.Settings.new("com.canonical.keyboard.maliit")
64+ gsettings.set_boolean("auto-capitalization", True)
65+ gsettings.set_boolean("auto-completion", False)
66+ gsettings.set_boolean("predictive-text", False)
67+ gsettings.set_boolean("spell-checking", False)
68+
69+ app = self._start_qml_script(qml)
70+ webview = app.select_single(objectName='webview')
71+
72+ self.ensure_focus_on_input(webview)
73+ keyboard = Keyboard()
74+ self.addCleanup(keyboard.dismiss)
75+
76+ keyboard.type('H')
77+
78+ self.assertThat(
79+ keyboard.active_keypad_state,
80+ Eventually(Equals(KeyPadState.NORMAL))
81+ )
82+
83
84 class UbuntuKeyboardPluginPaths(UbuntuKeyboardTests):
85

Subscribers

People subscribed via source and target branches