Merge lp:~radonapps/dialer-app/keyentry_clear into lp:dialer-app

Proposed by Daniyaal Rasheed
Status: Needs review
Proposed branch: lp:~radonapps/dialer-app/keyentry_clear
Merge into: lp:dialer-app
Diff against target: 102 lines (+13/-12)
2 files modified
src/qml/DialerPage/DialerPage.qml (+2/-1)
src/qml/dialer-app.qml (+11/-11)
To merge this branch: bzr merge lp:~radonapps/dialer-app/keyentry_clear
Reviewer Review Type Date Requested Status
Tiago Salem Herrmann (community) Needs Fixing
Review via email: mp+282871@code.launchpad.net

Description of the change

Keypad Entry is passed by reference to the call function so that the value can be cleared inside the function when a call successfully initiates.

To post a comment you must log in.
Revision history for this message
Tiago Salem Herrmann (tiagosh) wrote :

Thanks for the patch.

Unfortunately the original bug remains. The keypad entry still contains the value after an USSD command is invoked. (it returns before keypadEntry.value is cleared)

Apart from that, there is one place where you forgot to replace "number" by keypadEntry.value.

To make the diff smaller you could define var number = keypadEntry.value in the beginning of call().

As a suggestion, how about return true or false in the call() function (indicating if the number was actually called) and in DialerPage.qml simply clear the entry if the call method returned true?

review: Needs Fixing
509. By Daniyaal Rasheed

Fixed issues with clearing keypadEntry before USSD returns

Unmerged revisions

509. By Daniyaal Rasheed

Fixed issues with clearing keypadEntry before USSD returns

508. By Daniyaal Rasheed

keypadEntry is cleared when after the user successfully starts a call

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 2016-01-05 16:22:42 +0000
3+++ src/qml/DialerPage/DialerPage.qml 2016-01-18 15:13:38 +0000
4@@ -468,7 +468,8 @@
5 }
6
7 console.log("Starting a call to " + keypadEntry.value);
8- mainView.call(keypadEntry.value);
9+ if (mainView.call(keypadEntry.value))
10+ keypadEntry.value = ""
11 }
12 }
13 }
14
15=== modified file 'src/qml/dialer-app.qml'
16--- src/qml/dialer-app.qml 2015-11-03 13:39:11 +0000
17+++ src/qml/dialer-app.qml 2016-01-18 15:13:38 +0000
18@@ -325,26 +325,25 @@
19 function call(number, skipDefaultSimDialog) {
20 // clear the values here so that the changed signals are fired when the new value is set
21 pendingNumberToDial = "";
22-
23 if (number === "") {
24- return
25+ return false
26 }
27
28 if (isEmergencyNumber(number)) {
29 callEmergency(number);
30- return;
31+ return false
32 }
33
34 if (telepathyHelper.flightMode) {
35 PopupUtils.open(Qt.createComponent("Dialogs/DisableFlightModeDialog.qml").createObject(mainView), mainView, {})
36- return
37+ return false
38 }
39
40 // check if at least one account is selected
41 if (multiplePhoneAccounts && !mainView.account) {
42 Qt.inputMethod.hide()
43 showNotification(i18n.tr("No SIM card selected"), i18n.tr("You need to select a SIM card"));
44- return
45+ return false
46 }
47
48 if (multiplePhoneAccounts && !telepathyHelper.defaultCallAccount && !dualSimSettings.dialPadDontAsk && !skipDefaultSimDialog) {
49@@ -352,46 +351,47 @@
50 properties["phoneNumber"] = number
51 properties["accountId"] = mainView.account.accountId
52 PopupUtils.open(Qt.createComponent("Dialogs/SetDefaultSIMCardDialog.qml").createObject(mainView), mainView, properties)
53- return
54+ return false
55 }
56
57 if (mainView.account && !mainView.greeterMode && mainView.account.simLocked) {
58 var properties = {}
59 properties["accountId"] = mainView.account.accountId
60 PopupUtils.open(Qt.createComponent("Dialogs/SimLockedDialog.qml").createObject(mainView), mainView, properties)
61- return
62+ return false
63 }
64
65 // avoid cleaning the keypadEntry in case there is no signal
66 if (!mainView.account) {
67 showNotification(i18n.tr("No network"), i18n.tr("There is currently no network."))
68- return
69+ return false
70 }
71
72 if (!mainView.account.connected) {
73 showNotification(i18n.tr("No network"),
74 telepathyHelper.accountIds.length >= 2 ? i18n.tr("There is currently no network on %1").arg(mainView.account.displayName)
75 : i18n.tr("There is currently no network."))
76- return
77+ return false
78 }
79
80 if (checkUSSD(number)) {
81 PopupUtils.open(ussdProgressDialog)
82 account.ussdManager.initiate(number)
83- return
84+ return true
85 }
86
87 animateLiveCall();
88
89 if (!accountReady) {
90 pendingNumberToDial = number;
91- return;
92+ return false
93 }
94
95 if (account && account.connected) {
96 generalSettings.lastCalledPhoneNumber = number
97 callManager.startCall(number, account.accountId);
98 }
99+ return true
100 }
101
102 function populateDialpad(number, accountId) {

Subscribers

People subscribed via source and target branches