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
=== modified file 'src/qml/DialerPage/DialerPage.qml'
--- src/qml/DialerPage/DialerPage.qml 2016-01-05 16:22:42 +0000
+++ src/qml/DialerPage/DialerPage.qml 2016-01-18 15:13:38 +0000
@@ -468,7 +468,8 @@
468 }468 }
469469
470 console.log("Starting a call to " + keypadEntry.value);470 console.log("Starting a call to " + keypadEntry.value);
471 mainView.call(keypadEntry.value);471 if (mainView.call(keypadEntry.value))
472 keypadEntry.value = ""
472 }473 }
473 }474 }
474 }475 }
475476
=== modified file 'src/qml/dialer-app.qml'
--- src/qml/dialer-app.qml 2015-11-03 13:39:11 +0000
+++ src/qml/dialer-app.qml 2016-01-18 15:13:38 +0000
@@ -325,26 +325,25 @@
325 function call(number, skipDefaultSimDialog) {325 function call(number, skipDefaultSimDialog) {
326 // clear the values here so that the changed signals are fired when the new value is set326 // clear the values here so that the changed signals are fired when the new value is set
327 pendingNumberToDial = "";327 pendingNumberToDial = "";
328
329 if (number === "") {328 if (number === "") {
330 return329 return false
331 }330 }
332331
333 if (isEmergencyNumber(number)) {332 if (isEmergencyNumber(number)) {
334 callEmergency(number);333 callEmergency(number);
335 return;334 return false
336 }335 }
337336
338 if (telepathyHelper.flightMode) {337 if (telepathyHelper.flightMode) {
339 PopupUtils.open(Qt.createComponent("Dialogs/DisableFlightModeDialog.qml").createObject(mainView), mainView, {})338 PopupUtils.open(Qt.createComponent("Dialogs/DisableFlightModeDialog.qml").createObject(mainView), mainView, {})
340 return339 return false
341 }340 }
342341
343 // check if at least one account is selected342 // check if at least one account is selected
344 if (multiplePhoneAccounts && !mainView.account) {343 if (multiplePhoneAccounts && !mainView.account) {
345 Qt.inputMethod.hide()344 Qt.inputMethod.hide()
346 showNotification(i18n.tr("No SIM card selected"), i18n.tr("You need to select a SIM card"));345 showNotification(i18n.tr("No SIM card selected"), i18n.tr("You need to select a SIM card"));
347 return346 return false
348 }347 }
349348
350 if (multiplePhoneAccounts && !telepathyHelper.defaultCallAccount && !dualSimSettings.dialPadDontAsk && !skipDefaultSimDialog) {349 if (multiplePhoneAccounts && !telepathyHelper.defaultCallAccount && !dualSimSettings.dialPadDontAsk && !skipDefaultSimDialog) {
@@ -352,46 +351,47 @@
352 properties["phoneNumber"] = number351 properties["phoneNumber"] = number
353 properties["accountId"] = mainView.account.accountId352 properties["accountId"] = mainView.account.accountId
354 PopupUtils.open(Qt.createComponent("Dialogs/SetDefaultSIMCardDialog.qml").createObject(mainView), mainView, properties)353 PopupUtils.open(Qt.createComponent("Dialogs/SetDefaultSIMCardDialog.qml").createObject(mainView), mainView, properties)
355 return354 return false
356 }355 }
357356
358 if (mainView.account && !mainView.greeterMode && mainView.account.simLocked) {357 if (mainView.account && !mainView.greeterMode && mainView.account.simLocked) {
359 var properties = {}358 var properties = {}
360 properties["accountId"] = mainView.account.accountId359 properties["accountId"] = mainView.account.accountId
361 PopupUtils.open(Qt.createComponent("Dialogs/SimLockedDialog.qml").createObject(mainView), mainView, properties)360 PopupUtils.open(Qt.createComponent("Dialogs/SimLockedDialog.qml").createObject(mainView), mainView, properties)
362 return361 return false
363 }362 }
364363
365 // avoid cleaning the keypadEntry in case there is no signal364 // avoid cleaning the keypadEntry in case there is no signal
366 if (!mainView.account) {365 if (!mainView.account) {
367 showNotification(i18n.tr("No network"), i18n.tr("There is currently no network."))366 showNotification(i18n.tr("No network"), i18n.tr("There is currently no network."))
368 return367 return false
369 }368 }
370369
371 if (!mainView.account.connected) {370 if (!mainView.account.connected) {
372 showNotification(i18n.tr("No network"),371 showNotification(i18n.tr("No network"),
373 telepathyHelper.accountIds.length >= 2 ? i18n.tr("There is currently no network on %1").arg(mainView.account.displayName)372 telepathyHelper.accountIds.length >= 2 ? i18n.tr("There is currently no network on %1").arg(mainView.account.displayName)
374 : i18n.tr("There is currently no network."))373 : i18n.tr("There is currently no network."))
375 return374 return false
376 }375 }
377376
378 if (checkUSSD(number)) {377 if (checkUSSD(number)) {
379 PopupUtils.open(ussdProgressDialog)378 PopupUtils.open(ussdProgressDialog)
380 account.ussdManager.initiate(number)379 account.ussdManager.initiate(number)
381 return380 return true
382 }381 }
383382
384 animateLiveCall();383 animateLiveCall();
385384
386 if (!accountReady) {385 if (!accountReady) {
387 pendingNumberToDial = number;386 pendingNumberToDial = number;
388 return;387 return false
389 }388 }
390389
391 if (account && account.connected) {390 if (account && account.connected) {
392 generalSettings.lastCalledPhoneNumber = number391 generalSettings.lastCalledPhoneNumber = number
393 callManager.startCall(number, account.accountId);392 callManager.startCall(number, account.accountId);
394 }393 }
394 return true
395 }395 }
396396
397 function populateDialpad(number, accountId) {397 function populateDialpad(number, accountId) {

Subscribers

People subscribed via source and target branches