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
1=== modified file 'src/qml/DialerPage/DialerPage.qml'
2--- src/qml/DialerPage/DialerPage.qml 2014-07-02 17:11:00 +0000
3+++ src/qml/DialerPage/DialerPage.qml 2014-07-07 17:36:47 +0000
4@@ -160,10 +160,8 @@
5 onPressAndHold: input.text = ""
6
7 onClicked: {
8- if (input.cursorPosition != 0) {
9- var position = input.cursorPosition;
10- input.text = input.text.slice(0, input.cursorPosition - 1) + input.text.slice(input.cursorPosition);
11- input.cursorPosition = position - 1;
12+ if (input.cursorPosition > 0) {
13+ input.remove(input.cursorPosition, input.cursorPosition - 1)
14 }
15 }
16 }
17@@ -281,13 +279,7 @@
18 }
19
20 onKeyPressed: {
21- if (input.cursorPosition != 0) {
22- var position = input.cursorPosition;
23- input.text = input.text.slice(0, input.cursorPosition) + label + input.text.slice(input.cursorPosition);
24- input.cursorPosition = position +1 ;
25- } else {
26- keypadEntry.value += label
27- }
28+ input.insert(input.cursorPosition, label)
29 }
30 }
31
32
33=== modified file 'src/qml/DialerPage/KeypadEntry.qml'
34--- src/qml/DialerPage/KeypadEntry.qml 2014-06-13 17:21:22 +0000
35+++ src/qml/DialerPage/KeypadEntry.qml 2014-07-07 17:36:47 +0000
36@@ -31,7 +31,7 @@
37
38 height: input.height
39
40- TextInput {
41+ PhoneNumberInput {
42 id: input
43
44 property bool __adjusting: false
45@@ -51,22 +51,10 @@
46 cursorVisible: true
47 clip: true
48 opacity: 0.9
49-
50- AsYouTypeFormatter {
51- id: formatter
52-
53- // FIXME: this should probably be done in the component itself
54- property string firstDigit: input.text.slice(0,1)
55- enabled: firstDigit != "*" && firstDigit != "#"
56- defaultRegionCode: "US"
57- text: input.text
58- }
59-
60- Binding {
61- target: input
62- property: "text"
63- value: formatter.formattedText
64- }
65+ defaultRegion: i18n.tr("US")
66+ updateOnlyWhenFocused: false
67+ // FIXME: this should probably be done in the component itself
68+ autoFormat: input.text.length > 0 && input.text.charAt(0) !== "*" && input.text.charAt(0) !== "#"
69
70 // Use a custom cursor that does not blink to avoid extra CPU usage.
71 // https://bugs.launchpad.net/dialer-app/+bug/1188669

Subscribers

People subscribed via source and target branches