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
=== modified file 'qml/Keyboard.qml'
--- qml/Keyboard.qml 2014-08-29 12:08:49 +0000
+++ qml/Keyboard.qml 2014-09-10 13:48:54 +0000
@@ -256,6 +256,12 @@
256 keypad.activeKeypadState = "SHIFTED";256 keypad.activeKeypadState = "SHIFTED";
257 keypad.autoCapsTriggered = true;257 keypad.autoCapsTriggered = true;
258 }258 }
259 onDeactivateAutocaps: {
260 if(keypad.autoCapsTriggered) {
261 keypad.activeKeypadState = "NORMAL";
262 keypad.autoCapsTriggered = false;
263 }
264 }
259 }265 }
260266
261 } // canvas267 } // canvas
262268
=== modified file 'src/plugin/inputmethod.cpp'
--- src/plugin/inputmethod.cpp 2014-08-12 22:51:44 +0000
+++ src/plugin/inputmethod.cpp 2014-09-10 13:48:54 +0000
@@ -99,6 +99,7 @@
99 // FIXME: Reconnect feedback instance.99 // FIXME: Reconnect feedback instance.
100 Setup::connectAll(&d->event_handler, &d->editor);100 Setup::connectAll(&d->event_handler, &d->editor);
101 connect(&d->editor, SIGNAL(autoCapsActivated()), this, SIGNAL(activateAutocaps()));101 connect(&d->editor, SIGNAL(autoCapsActivated()), this, SIGNAL(activateAutocaps()));
102 connect(&d->editor, SIGNAL(autoCapsDeactivated()), this, SIGNAL(deactivateAutocaps()));
102103
103 connect(this, SIGNAL(contentTypeChanged(TextContentType)), this, SLOT(setContentType(TextContentType)));104 connect(this, SIGNAL(contentTypeChanged(TextContentType)), this, SLOT(setContentType(TextContentType)));
104 connect(this, SIGNAL(activeLanguageChanged(QString)), d->editor.wordEngine(), SLOT(onLanguageChanged(QString)));105 connect(this, SIGNAL(activeLanguageChanged(QString)), d->editor.wordEngine(), SLOT(onLanguageChanged(QString)));
@@ -367,12 +368,7 @@
367 d->editor.text()->setSurroundingOffset(position);368 d->editor.text()->setSurroundingOffset(position);
368369
369 updateAutoCaps();370 updateAutoCaps();
370371 checkInitialAutocaps();
371 // If we're at the beginning of a text field (e.g. because it's been cleared,
372 // or the cursor has been moved) then re-evaluate initial autocaps
373 if (position == 0 && position != d->previous_position) {
374 checkInitialAutocaps();
375 }
376 d->previous_position = position;372 d->previous_position = position;
377 }373 }
378}374}
@@ -424,8 +420,13 @@
424 QString text;420 QString text;
425 int position;421 int position;
426 bool ok = d->host->surroundingText(text, position);422 bool ok = d->host->surroundingText(text, position);
427 if (ok && text.isEmpty() && position == 0)423 if (ok && text.isEmpty() && d->editor.text()->preedit().isEmpty() && position == 0) {
428 Q_EMIT activateAutocaps();424 Q_EMIT activateAutocaps();
425 } else {
426 // Clear autocaps if it has been set by us previously being in an
427 // empty field
428 Q_EMIT deactivateAutocaps();
429 }
429 }430 }
430}431}
431432
432433
=== modified file 'src/plugin/inputmethod.h'
--- src/plugin/inputmethod.h 2014-08-26 11:26:35 +0000
+++ src/plugin/inputmethod.h 2014-09-10 13:48:54 +0000
@@ -119,6 +119,7 @@
119Q_SIGNALS:119Q_SIGNALS:
120 void contentTypeChanged(TextContentType contentType);120 void contentTypeChanged(TextContentType contentType);
121 void activateAutocaps();121 void activateAutocaps();
122 void deactivateAutocaps();
122 void enabledLanguagesChanged(QStringList languages);123 void enabledLanguagesChanged(QStringList languages);
123 void activeLanguageChanged(QString language);124 void activeLanguageChanged(QString language);
124 void useAudioFeedbackChanged();125 void useAudioFeedbackChanged();
125126
=== modified file 'src/view/abstracttexteditor.cpp'
--- src/view/abstracttexteditor.cpp 2014-08-11 13:46:41 +0000
+++ src/view/abstracttexteditor.cpp 2014-09-10 13:48:54 +0000
@@ -667,8 +667,12 @@
667 }667 }
668 commitPreedit();668 commitPreedit();
669669
670 if (auto_caps_activated && d->auto_caps_enabled) {670 if (d->auto_caps_enabled) {
671 Q_EMIT autoCapsActivated();671 if (auto_caps_activated) {
672 Q_EMIT autoCapsActivated();
673 } else {
674 Q_EMIT autoCapsDeactivated();
675 }
672 }676 }
673}677}
674678
@@ -920,8 +924,12 @@
920 textOnLeft = textOnLeft.trimmed();924 textOnLeft = textOnLeft.trimmed();
921925
922 const bool auto_caps_activated = d->word_engine->languageFeature()->activateAutoCaps(textOnLeft);926 const bool auto_caps_activated = d->word_engine->languageFeature()->activateAutoCaps(textOnLeft);
923 if (auto_caps_activated && d->auto_caps_enabled) {927 if (d->auto_caps_enabled) {
924 Q_EMIT autoCapsActivated();928 if (auto_caps_activated) {
929 Q_EMIT autoCapsActivated();
930 } else {
931 Q_EMIT autoCapsDeactivated();
932 }
925 }933 }
926934
927 d->backspace_sent = true;935 d->backspace_sent = true;
928936
=== modified file 'src/view/abstracttexteditor.h'
--- src/view/abstracttexteditor.h 2014-07-25 09:43:43 +0000
+++ src/view/abstracttexteditor.h 2014-09-10 13:48:54 +0000
@@ -143,6 +143,7 @@
143 Q_SIGNAL void keyboardClosed();143 Q_SIGNAL void keyboardClosed();
144 Q_SIGNAL void wordCandidatesChanged(const WordCandidateList &word_candidates);144 Q_SIGNAL void wordCandidatesChanged(const WordCandidateList &word_candidates);
145 Q_SIGNAL void autoCapsActivated();145 Q_SIGNAL void autoCapsActivated();
146 Q_SIGNAL void autoCapsDeactivated();
146 Q_SIGNAL void leftLayoutSelected();147 Q_SIGNAL void leftLayoutSelected();
147 Q_SIGNAL void rightLayoutSelected();148 Q_SIGNAL void rightLayoutSelected();
148149

Subscribers

People subscribed via source and target branches