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

Proposed by Michael Sheldon
Status: Merged
Approved by: Bill Filler
Approved revision: 184
Merged at revision: 222
Proposed branch: lp:~michael-sheldon/ubuntu-keyboard/fix-1366779
Merge into: lp:ubuntu-keyboard
Diff against target: 114 lines (+28/-11)
5 files modified
qml/Keyboard.qml (+6/-0)
src/plugin/inputmethod.cpp (+8/-7)
src/plugin/inputmethod.h (+1/-0)
src/view/abstracttexteditor.cpp (+12/-4)
src/view/abstracttexteditor.h (+1/-0)
To merge this branch: bzr merge lp:~michael-sheldon/ubuntu-keyboard/fix-1366779
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Bill Filler (community) Approve
Review via email: mp+234112@code.launchpad.net

Commit message

Deactivate autocaps if re-entering a field that already has text in it.

Description of the change

Deactivate autocaps if re-entering a field that already has text in it.

To post a comment you must log in.
Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Are there any related MPs required for this MP to build/function as expected? Please list.

 * No

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)

 * Yes

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?

 * Yes

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/ubuntu-keyboard) on device or emulator?

 * Yes

If you changed the UI, was the change specified/approved by design?

 * No change

If you changed UI labels, did you update the pot file?

 * No change

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?

 * No change

Revision history for this message
Bill Filler (bfiller) wrote :

Did you perform an exploratory manual test run of the code change and any related functionality on device or emulator?
yes

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/<package-name>) on device or emulator?
yes

Did CI run pass? If not, please explain why.
yes

Have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut?
yes

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Keyboard.qml'
2--- qml/Keyboard.qml 2014-08-29 12:08:49 +0000
3+++ qml/Keyboard.qml 2014-09-10 13:48:54 +0000
4@@ -256,6 +256,12 @@
5 keypad.activeKeypadState = "SHIFTED";
6 keypad.autoCapsTriggered = true;
7 }
8+ onDeactivateAutocaps: {
9+ if(keypad.autoCapsTriggered) {
10+ keypad.activeKeypadState = "NORMAL";
11+ keypad.autoCapsTriggered = false;
12+ }
13+ }
14 }
15
16 } // canvas
17
18=== modified file 'src/plugin/inputmethod.cpp'
19--- src/plugin/inputmethod.cpp 2014-08-12 22:51:44 +0000
20+++ src/plugin/inputmethod.cpp 2014-09-10 13:48:54 +0000
21@@ -99,6 +99,7 @@
22 // FIXME: Reconnect feedback instance.
23 Setup::connectAll(&d->event_handler, &d->editor);
24 connect(&d->editor, SIGNAL(autoCapsActivated()), this, SIGNAL(activateAutocaps()));
25+ connect(&d->editor, SIGNAL(autoCapsDeactivated()), this, SIGNAL(deactivateAutocaps()));
26
27 connect(this, SIGNAL(contentTypeChanged(TextContentType)), this, SLOT(setContentType(TextContentType)));
28 connect(this, SIGNAL(activeLanguageChanged(QString)), d->editor.wordEngine(), SLOT(onLanguageChanged(QString)));
29@@ -367,12 +368,7 @@
30 d->editor.text()->setSurroundingOffset(position);
31
32 updateAutoCaps();
33-
34- // If we're at the beginning of a text field (e.g. because it's been cleared,
35- // or the cursor has been moved) then re-evaluate initial autocaps
36- if (position == 0 && position != d->previous_position) {
37- checkInitialAutocaps();
38- }
39+ checkInitialAutocaps();
40 d->previous_position = position;
41 }
42 }
43@@ -424,8 +420,13 @@
44 QString text;
45 int position;
46 bool ok = d->host->surroundingText(text, position);
47- if (ok && text.isEmpty() && position == 0)
48+ if (ok && text.isEmpty() && d->editor.text()->preedit().isEmpty() && position == 0) {
49 Q_EMIT activateAutocaps();
50+ } else {
51+ // Clear autocaps if it has been set by us previously being in an
52+ // empty field
53+ Q_EMIT deactivateAutocaps();
54+ }
55 }
56 }
57
58
59=== modified file 'src/plugin/inputmethod.h'
60--- src/plugin/inputmethod.h 2014-08-26 11:26:35 +0000
61+++ src/plugin/inputmethod.h 2014-09-10 13:48:54 +0000
62@@ -119,6 +119,7 @@
63 Q_SIGNALS:
64 void contentTypeChanged(TextContentType contentType);
65 void activateAutocaps();
66+ void deactivateAutocaps();
67 void enabledLanguagesChanged(QStringList languages);
68 void activeLanguageChanged(QString language);
69 void useAudioFeedbackChanged();
70
71=== modified file 'src/view/abstracttexteditor.cpp'
72--- src/view/abstracttexteditor.cpp 2014-08-11 13:46:41 +0000
73+++ src/view/abstracttexteditor.cpp 2014-09-10 13:48:54 +0000
74@@ -667,8 +667,12 @@
75 }
76 commitPreedit();
77
78- if (auto_caps_activated && d->auto_caps_enabled) {
79- Q_EMIT autoCapsActivated();
80+ if (d->auto_caps_enabled) {
81+ if (auto_caps_activated) {
82+ Q_EMIT autoCapsActivated();
83+ } else {
84+ Q_EMIT autoCapsDeactivated();
85+ }
86 }
87 }
88
89@@ -920,8 +924,12 @@
90 textOnLeft = textOnLeft.trimmed();
91
92 const bool auto_caps_activated = d->word_engine->languageFeature()->activateAutoCaps(textOnLeft);
93- if (auto_caps_activated && d->auto_caps_enabled) {
94- Q_EMIT autoCapsActivated();
95+ if (d->auto_caps_enabled) {
96+ if (auto_caps_activated) {
97+ Q_EMIT autoCapsActivated();
98+ } else {
99+ Q_EMIT autoCapsDeactivated();
100+ }
101 }
102
103 d->backspace_sent = true;
104
105=== modified file 'src/view/abstracttexteditor.h'
106--- src/view/abstracttexteditor.h 2014-07-25 09:43:43 +0000
107+++ src/view/abstracttexteditor.h 2014-09-10 13:48:54 +0000
108@@ -143,6 +143,7 @@
109 Q_SIGNAL void keyboardClosed();
110 Q_SIGNAL void wordCandidatesChanged(const WordCandidateList &word_candidates);
111 Q_SIGNAL void autoCapsActivated();
112+ Q_SIGNAL void autoCapsDeactivated();
113 Q_SIGNAL void leftLayoutSelected();
114 Q_SIGNAL void rightLayoutSelected();
115

Subscribers

People subscribed via source and target branches