Merge lp:~renatofilho/dialer-app/fix-phone-formatter into lp:dialer-app

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Tiago Salem Herrmann
Approved revision: 170
Merged at revision: 170
Proposed branch: lp:~renatofilho/dialer-app/fix-phone-formatter
Merge into: lp:dialer-app
Diff against target: 71 lines (+8/-28)
2 files modified
src/qml/DialerPage/DialerPage.qml (+3/-11)
src/qml/DialerPage/KeypadEntry.qml (+5/-17)
To merge this branch: bzr merge lp:~renatofilho/dialer-app/fix-phone-formatter
Reviewer Review Type Date Requested Status
Tiago Salem Herrmann (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+225697@code.launchpad.net

Commit message

Used PhoneNumberInput class in KeypadEntry.

This class implement the phone number format internally.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
167. By Renato Araujo Oliveira Filho

Set keypad entry default location.

168. By Renato Araujo Oliveira Filho

Moved comments to the right place.

169. By Renato Araujo Oliveira Filho

Fixed cursor position during entry modify.

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) wrote :
review: Needs Fixing (continuous-integration)
170. By Renato Araujo Oliveira Filho

Trunk merged.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

Are there any related MPs required for this MP to build/function as expected? YES
    * lp:~renatofilho/address-book-app/extend-avatar

Is your branch in sync with latest trunk? 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 on device or emulator? YES

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

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

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

> Are there any related MPs required for this MP to build/function as expected?
> YES
> * lp:~renatofilho/address-book-app/extend-avatar
CORRECT BRANCH: lp:~renatofilho/telephony-service/fix-phone-number-field-cursor
>
> Is your branch in sync with latest trunk? 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 on
> device or emulator? YES
>
> If you changed the UI, was the change specified/approved by design? NO UI
> CHANGE
>
> If you changed the packaging (debian), did you add a core-dev as a reviewer to
> this MP? NO UI CHANG

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

Are there any related MPs required for this MP to build/function as expected? YES
    * lp:~renatofilho/telephony-service/fix-phone-number-field-cursor

Is your branch in sync with latest trunk? 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 on device or emulator? YES

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

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

Revision history for this message
Tiago Salem Herrmann (tiagosh) wrote :

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

Did CI run pass? If not, please explain why.
No, It depends on another branch.

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

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/qml/DialerPage/DialerPage.qml'
--- src/qml/DialerPage/DialerPage.qml 2014-07-02 17:11:00 +0000
+++ src/qml/DialerPage/DialerPage.qml 2014-07-07 17:36:47 +0000
@@ -160,10 +160,8 @@
160 onPressAndHold: input.text = ""160 onPressAndHold: input.text = ""
161161
162 onClicked: {162 onClicked: {
163 if (input.cursorPosition != 0) {163 if (input.cursorPosition > 0) {
164 var position = input.cursorPosition;164 input.remove(input.cursorPosition, input.cursorPosition - 1)
165 input.text = input.text.slice(0, input.cursorPosition - 1) + input.text.slice(input.cursorPosition);
166 input.cursorPosition = position - 1;
167 }165 }
168 }166 }
169 }167 }
@@ -281,13 +279,7 @@
281 }279 }
282280
283 onKeyPressed: {281 onKeyPressed: {
284 if (input.cursorPosition != 0) {282 input.insert(input.cursorPosition, label)
285 var position = input.cursorPosition;
286 input.text = input.text.slice(0, input.cursorPosition) + label + input.text.slice(input.cursorPosition);
287 input.cursorPosition = position +1 ;
288 } else {
289 keypadEntry.value += label
290 }
291 }283 }
292 }284 }
293285
294286
=== modified file 'src/qml/DialerPage/KeypadEntry.qml'
--- src/qml/DialerPage/KeypadEntry.qml 2014-06-13 17:21:22 +0000
+++ src/qml/DialerPage/KeypadEntry.qml 2014-07-07 17:36:47 +0000
@@ -31,7 +31,7 @@
3131
32 height: input.height32 height: input.height
3333
34 TextInput {34 PhoneNumberInput {
35 id: input35 id: input
3636
37 property bool __adjusting: false37 property bool __adjusting: false
@@ -51,22 +51,10 @@
51 cursorVisible: true51 cursorVisible: true
52 clip: true52 clip: true
53 opacity: 0.953 opacity: 0.9
5454 defaultRegion: i18n.tr("US")
55 AsYouTypeFormatter {55 updateOnlyWhenFocused: false
56 id: formatter56 // FIXME: this should probably be done in the component itself
5757 autoFormat: input.text.length > 0 && input.text.charAt(0) !== "*" && input.text.charAt(0) !== "#"
58 // FIXME: this should probably be done in the component itself
59 property string firstDigit: input.text.slice(0,1)
60 enabled: firstDigit != "*" && firstDigit != "#"
61 defaultRegionCode: "US"
62 text: input.text
63 }
64
65 Binding {
66 target: input
67 property: "text"
68 value: formatter.formattedText
69 }
7058
71 // Use a custom cursor that does not blink to avoid extra CPU usage.59 // Use a custom cursor that does not blink to avoid extra CPU usage.
72 // https://bugs.launchpad.net/dialer-app/+bug/118866960 // https://bugs.launchpad.net/dialer-app/+bug/1188669

Subscribers

People subscribed via source and target branches