Merge lp:~tiagosh/dialer-app/rtm-14.09-fix-1410961 into lp:dialer-app/rtm-14.09

Proposed by Tiago Salem Herrmann
Status: Superseded
Proposed branch: lp:~tiagosh/dialer-app/rtm-14.09-fix-1410961
Merge into: lp:dialer-app/rtm-14.09
Diff against target: 465 lines (+147/-63)
6 files modified
src/qml/ContactsPage/ContactsPage.qml (+1/-1)
src/qml/DialerPage/DialerPage.qml (+14/-14)
src/qml/HistoryPage/HistoryDetailsPage.qml (+1/-1)
src/qml/HistoryPage/HistoryPage.qml (+2/-2)
src/qml/LiveCallPage/LiveCall.qml (+23/-9)
src/qml/dialer-app.qml (+106/-36)
To merge this branch: bzr merge lp:~tiagosh/dialer-app/rtm-14.09-fix-1410961
Reviewer Review Type Date Requested Status
Ubuntu Phablet Team Pending
Review via email: mp+246801@code.launchpad.net

This proposal has been superseded by a proposal from 2015-01-17.

Commit message

Give some time to finish the greeter animation before removing the LiveCall view.

Description of the change

Give some time to finish the greeter animation before removing the LiveCall view.

To post a comment you must log in.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/qml/ContactsPage/ContactsPage.qml'
--- src/qml/ContactsPage/ContactsPage.qml 2014-09-03 17:07:44 +0000
+++ src/qml/ContactsPage/ContactsPage.qml 2015-01-17 02:38:49 +0000
@@ -208,7 +208,7 @@
208 Qt.openUrlExternally("message:///" + encodeURIComponent(detail.number))208 Qt.openUrlExternally("message:///" + encodeURIComponent(detail.number))
209 return209 return
210 }210 }
211 pageStack.pop()211 pageStackNormalMode.pop()
212 if (callManager.hasCalls) {212 if (callManager.hasCalls) {
213 mainView.call(detail.number, mainView.account.accountId);213 mainView.call(detail.number, mainView.account.accountId);
214 } else {214 } else {
215215
=== modified file 'src/qml/DialerPage/DialerPage.qml'
--- src/qml/DialerPage/DialerPage.qml 2014-12-04 12:52:57 +0000
+++ src/qml/DialerPage/DialerPage.qml 2015-01-17 02:38:49 +0000
@@ -32,32 +32,37 @@
32 property alias dialNumber: keypadEntry.value32 property alias dialNumber: keypadEntry.value
33 property alias input: keypadEntry.input33 property alias input: keypadEntry.input
34 property alias callAnimationRunning: callAnimation.running34 property alias callAnimationRunning: callAnimation.running
35 property bool greeterMode: false
35 property var mmiPlugins: []36 property var mmiPlugins: []
36 property list<Action> actionsGreeter37 property list<Action> actionsGreeter
37 property list<Action> actionsNormal: [38 property list<Action> actionsNormal: [
38 Action {39 Action {
39 iconName: "contact"40 iconName: "contact"
40 text: i18n.tr("Contacts")41 text: i18n.tr("Contacts")
41 onTriggered: pageStack.push(Qt.resolvedUrl("../ContactsPage/ContactsPage.qml"))42 onTriggered: pageStackNormalMode.push(Qt.resolvedUrl("../ContactsPage/ContactsPage.qml"))
42 },43 },
43 Action {44 Action {
44 iconName: "settings"45 iconName: "settings"
45 text: i18n.tr("Settings")46 text: i18n.tr("Settings")
46 onTriggered: Qt.openUrlExternally("settings:///system/phone")47 onTriggered: Qt.openUrlExternally("settings:///system/phone")
47 }48 }
49
48 ]50 ]
49 head.actions: greeter.greeterActive ? actionsGreeter : actionsNormal51 head.actions: mainView.greeterMode ? actionsGreeter : actionsNormal
50 head.backAction: Action {52 head.backAction: Action {
51 iconName: "back"53 iconName: "back"
52 text: i18n.tr("Close")54 text: i18n.tr("Close")
53 visible: greeter.greeterActive55 visible: mainView.greeterMode
54 onTriggered: greeter.showGreeter()56 onTriggered: {
57 greeter.showGreeter()
58 dialNumber = "";
59 }
55 }60 }
5661
57 objectName: "dialerPage"62 objectName: "dialerPage"
5863
59 title: {64 title: {
60 if (greeter.greeterActive) {65 if (mainView.greeterMode) {
61 return i18n.tr("Emergency Calls")66 return i18n.tr("Emergency Calls")
62 } else if (telepathyHelper.flightMode) {67 } else if (telepathyHelper.flightMode) {
63 return i18n.tr("Flight mode")68 return i18n.tr("Flight mode")
@@ -73,7 +78,7 @@
73 return i18n.tr("No network")78 return i18n.tr("No network")
74 }79 }
7580
76 state: greeter.greeterActive ? "greeterMode" : "normalMode"81 state: mainView.state
77 // -------- Greeter mode ----------82 // -------- Greeter mode ----------
78 states: [83 states: [
79 State {84 State {
@@ -86,10 +91,6 @@
86 target: addContact91 target: addContact
87 visible: false92 visible: false
88 }93 }
89 PropertyChanges {
90 target: keypadEntry
91 value: ""
92 }
93 },94 },
94 State {95 State {
95 name: "normalMode"96 name: "normalMode"
@@ -101,12 +102,11 @@
101 target: addContact102 target: addContact
102 visible: true103 visible: true
103 }104 }
104
105 }105 }
106 ]106 ]
107107
108 // -------- Bottom Edge Setup -----108 // -------- Bottom Edge Setup -----
109 bottomEdgeEnabled: !greeter.greeterActive109 bottomEdgeEnabled: !mainView.greeterMode
110 bottomEdgePageSource: Qt.resolvedUrl("../HistoryPage/HistoryPage.qml")110 bottomEdgePageSource: Qt.resolvedUrl("../HistoryPage/HistoryPage.qml")
111 // NOTE: uncomment the next line to re-enable progressive bottom edge swiping.111 // NOTE: uncomment the next line to re-enable progressive bottom edge swiping.
112 //bottomEdgeExpandThreshold: bottomEdgePage ? bottomEdgePage.delegateHeight * 3 : 0112 //bottomEdgeExpandThreshold: bottomEdgePage ? bottomEdgePage.delegateHeight * 3 : 0
@@ -181,7 +181,7 @@
181181
182 head.sections.model: {182 head.sections.model: {
183 // does not show dual sim switch if there is only one sim183 // does not show dual sim switch if there is only one sim
184 if (!multipleAccounts || greeter.greeterActive) {184 if (!multipleAccounts || mainView.greeterMode) {
185 return undefined185 return undefined
186 }186 }
187187
@@ -388,7 +388,7 @@
388 return false;388 return false;
389 }389 }
390390
391 if (greeter.greeterActive) {391 if (mainView.greeterMode) {
392 return mainView.isEmergencyNumber(dialNumber);392 return mainView.isEmergencyNumber(dialNumber);
393 }393 }
394394
395395
=== modified file 'src/qml/HistoryPage/HistoryDetailsPage.qml'
--- src/qml/HistoryPage/HistoryDetailsPage.qml 2015-01-09 11:54:33 +0000
+++ src/qml/HistoryPage/HistoryDetailsPage.qml 2015-01-17 02:38:49 +0000
@@ -74,7 +74,7 @@
74 text: i18n.tr("Delete")74 text: i18n.tr("Delete")
75 onTriggered: {75 onTriggered: {
76 eventModel.removeEvents(events);76 eventModel.removeEvents(events);
77 pageStack.pop();77 pageStackNormalMode.pop();
78 }78 }
79 }79 }
8080
8181
=== modified file 'src/qml/HistoryPage/HistoryPage.qml'
--- src/qml/HistoryPage/HistoryPage.qml 2015-01-09 11:54:33 +0000
+++ src/qml/HistoryPage/HistoryPage.qml 2015-01-17 02:38:49 +0000
@@ -112,7 +112,7 @@
112 onSelectedIndexChanged: {112 onSelectedIndexChanged: {
113 // NOTE: be careful on changing the way filters are assigned, if we create a113 // NOTE: be careful on changing the way filters are assigned, if we create a
114 // binding on head.sections, we might get weird results when the page moves to the bottom114 // binding on head.sections, we might get weird results when the page moves to the bottom
115 if (pageStack.depth > 1) {115 if (pageStackNormalMode.depth > 1) {
116 if (head.sections.selectedIndex == 0) {116 if (head.sections.selectedIndex == 0) {
117 historyEventModel.filter = emptyFilter;117 historyEventModel.filter = emptyFilter;
118 } else {118 } else {
@@ -323,7 +323,7 @@
323 iconName: "info"323 iconName: "info"
324 text: i18n.tr("Details")324 text: i18n.tr("Details")
325 onTriggered: {325 onTriggered: {
326 pageStack.push(Qt.resolvedUrl("HistoryDetailsPage.qml"),326 pageStackNormalMode.push(Qt.resolvedUrl("HistoryDetailsPage.qml"),
327 { phoneNumber: participants[0].phoneNumber,327 { phoneNumber: participants[0].phoneNumber,
328 events: model.events,328 events: model.events,
329 eventModel: historyEventModel})329 eventModel: historyEventModel})
330330
=== modified file 'src/qml/LiveCallPage/LiveCall.qml'
--- src/qml/LiveCallPage/LiveCall.qml 2014-12-16 01:11:54 +0000
+++ src/qml/LiveCallPage/LiveCall.qml 2015-01-17 02:38:49 +0000
@@ -60,10 +60,10 @@
60 objectName: "backButton"60 objectName: "backButton"
61 iconName: "back"61 iconName: "back"
62 onTriggered: {62 onTriggered: {
63 if (greeter.greeterActive) {63 if (mainView.greeterMode) {
64 greeter.showGreeter();64 greeter.showGreeter();
65 } else {65 } else {
66 pageStack.pop();66 pageStackNormalMode.pop();
67 }67 }
68 }68 }
69 }69 }
@@ -192,7 +192,7 @@
192192
193 State {193 State {
194 name: "closing"194 name: "closing"
195 when: closeTimer.running195 when: closeTimer.running || greeterAnimationTimer.running
196196
197 PropertyChanges {197 PropertyChanges {
198 target: buttonsArea198 target: buttonsArea
@@ -255,16 +255,30 @@
255 }255 }
256256
257 Timer {257 Timer {
258 id: greeterAnimationTimer
259 interval: 1000
260 repeat: false
261 running: false
262 onTriggered: mainView.removeLiveCallView()
263 }
264
265 Timer {
258 id: closeTimer266 id: closeTimer
259 interval: 3000267 interval: mainView.greeterMode ? 2000 : 3000
260 repeat: false268 repeat: false
261 running: false269 running: false
262 onTriggered: {270 onTriggered: {
263 if (!callManager.hasCalls) {271 if (!callManager.hasCalls) {
264 mainView.switchToKeypadView();272 if (!mainView.greeterMode) {
265 pageStack.currentPage.dialNumber = pendingNumberToDial;273 mainView.removeLiveCallView();
266 if (greeter.greeterActive) {274 }
275 // TODO: we can't be sure that the currentPage is a DialerPage instance
276 if (pageStackNormalMode.currentPage.dialNumber) {
277 pageStackNormalMode.currentPage.dialNumber = pendingNumberToDial;
278 }
279 if (mainView.greeterMode) {
267 greeter.showGreeter();280 greeter.showGreeter();
281 greeterAnimationTimer.running = true
268 }282 }
269 }283 }
270 }284 }
@@ -568,8 +582,8 @@
568 iconSource: "add"582 iconSource: "add"
569 iconWidth: units.gu(3)583 iconWidth: units.gu(3)
570 iconHeight: units.gu(3)584 iconHeight: units.gu(3)
571 enabled: !greeter.greeterActive585 enabled: !mainView.greeterMode
572 onClicked: pageStack.push(Qt.resolvedUrl("../ContactsPage/ContactsPage.qml"))586 onClicked: pageStackNormalMode.push(Qt.resolvedUrl("../ContactsPage/ContactsPage.qml"))
573 }587 }
574588
575 LiveCallKeypadButton {589 LiveCallKeypadButton {
576590
=== modified file 'src/qml/dialer-app.qml'
--- src/qml/dialer-app.qml 2014-12-04 13:24:23 +0000
+++ src/qml/dialer-app.qml 2015-01-17 02:38:49 +0000
@@ -32,6 +32,8 @@
32 property string ussdResponseText: ""32 property string ussdResponseText: ""
33 property bool multipleAccounts: telepathyHelper.activeAccounts.length > 133 property bool multipleAccounts: telepathyHelper.activeAccounts.length > 1
34 property QtObject account: defaultAccount()34 property QtObject account: defaultAccount()
35 property bool greeterMode: (state == "greeterMode")
36 property bool lastHasCalls: callManager.hasCalls
3537
36 function defaultAccount() {38 function defaultAccount() {
37 // we only use the default account property if we have more39 // we only use the default account property if we have more
@@ -58,8 +60,20 @@
58 onApplicationActiveChanged: {60 onApplicationActiveChanged: {
59 if (applicationActive) {61 if (applicationActive) {
60 telepathyHelper.registerChannelObserver()62 telepathyHelper.registerChannelObserver()
61 if (pageStack.currentPage.objectName == "pageLiveCall" && !callManager.hasCalls) {63
62 pageStack.pop();64 if (!callManager.hasCalls) {
65 // if on contacts page in a live call and no calls are found, pop it out
66 if (pageStackNormalMode.depth > 2 && pageStackNormalMode.currentPage.objectName == "contactsPage") {
67 pageStackNormalMode.pop();
68 }
69
70 // pop live call views from both stacks if we have no calls.
71 if (pageStackNormalMode.depth > 1 && pageStackNormalMode.currentPage.objectName == "pageLiveCall") {
72 pageStackNormalMode.pop();
73 }
74 if (pageStackGreeterMode.depth > 1 && pageStackGreeterMode.currentPage.objectName == "pageLiveCall") {
75 pageStackGreeterMode.pop();
76 }
63 }77 }
64 } else {78 } else {
65 telepathyHelper.unregisterChannelObserver()79 telepathyHelper.unregisterChannelObserver()
@@ -70,7 +84,7 @@
70 target: telepathyHelper84 target: telepathyHelper
71 onSetupReady: {85 onSetupReady: {
72 if (multipleAccounts && !telepathyHelper.defaultCallAccount &&86 if (multipleAccounts && !telepathyHelper.defaultCallAccount &&
73 settings.mainViewDontAskCount < 3 && pageStack.depth === 1) {87 settings.mainViewDontAskCount < 3 && pageStackNormalMode.depth === 1 && !mainView.greeterMode) {
74 PopupUtils.open(Qt.createComponent("Dialogs/NoDefaultSIMCardDialog.qml").createObject(mainView))88 PopupUtils.open(Qt.createComponent("Dialogs/NoDefaultSIMCardDialog.qml").createObject(mainView))
75 }89 }
76 }90 }
@@ -104,21 +118,39 @@
104 Binding {118 Binding {
105 target: application119 target: application
106 property: "fullScreen"120 property: "fullScreen"
107 value: greeter.greeterActive121 value: mainView.greeterMode
108 }122 }
109123
124 state: greeter.greeterActive ? "greeterMode" : "normalMode"
110 states: [125 states: [
111 State {126 State {
112 name: "greeterMode"127 name: "greeterMode"
113 when: greeter.greeterActive128
114129 StateChangeScript {
115 StateChangeScript {130 script: {
116 script: {131 // preload greeter stack if not done yet
117 // make sure to reset the view so that the contacts page is not loaded132 if (pageStackGreeterMode.depth == 0) {
118 if (callManager.hasCalls) {133 pageStackGreeterMode.push(Qt.resolvedUrl("DialerPage/DialerPage.qml"))
119 switchToLiveCall();134 }
120 } else {135 // make sure to reset the view so that the contacts page is not loaded
121 switchToKeypadView();136 if (callManager.hasCalls) {
137 switchToLiveCall();
138 } else {
139 removeLiveCallView();
140 }
141 }
142 }
143 },
144 State {
145 name: "normalMode"
146
147 StateChangeScript {
148 script: {
149 // make sure to reset the view so that the contacts page is not loaded
150 if (callManager.hasCalls) {
151 switchToLiveCall();
152 } else {
153 removeLiveCallView();
122 }154 }
123 }155 }
124 }156 }
@@ -160,7 +192,7 @@
160 }192 }
161193
162 function callVoicemail() {194 function callVoicemail() {
163 if (greeter.greeterActive) {195 if (mainView.greeterMode) {
164 return;196 return;
165 }197 }
166 call(mainView.account.voicemailNumber);198 call(mainView.account.voicemailNumber);
@@ -265,7 +297,7 @@
265 return297 return
266 }298 }
267299
268 if (mainView.account && !greeter.greeterActive && mainView.account.simLocked) {300 if (mainView.account && !mainView.greeterMode && mainView.account.simLocked) {
269 var properties = {}301 var properties = {}
270 properties["accountId"] = mainView.account.accountId302 properties["accountId"] = mainView.account.accountId
271 PopupUtils.open(Qt.createComponent("Dialogs/SimLockedDialog.qml").createObject(mainView), mainView, properties)303 PopupUtils.open(Qt.createComponent("Dialogs/SimLockedDialog.qml").createObject(mainView), mainView, properties)
@@ -301,49 +333,72 @@
301 // FIXME: check what to do when not in the dialpad view333 // FIXME: check what to do when not in the dialpad view
302334
303 // if not on the livecall view, go back to the dialpad335 // if not on the livecall view, go back to the dialpad
304 while (pageStack.depth > 1 && pageStack.currentPage.objectName != "pageLiveCall") {336 while (pageStackNormalMode.depth > 1) {
305 pageStack.pop();337 pageStackNormalMode.pop();
306 }338 }
307339
308 if (pageStack.currentPage && typeof(pageStack.currentPage.dialNumber) != 'undefined') {340 if (pageStackNormalMode.currentPage && typeof(pageStackNormalMode.currentPage.dialNumber) != 'undefined') {
309 pageStack.currentPage.dialNumber = number;341 pageStackNormalMode.currentPage.dialNumber = number;
342 }
343 }
344
345 function removeLiveCallView() {
346 // if on contacts page in a live call and no calls are found, pop it out
347 if (pageStackNormalMode.depth > 2 && pageStackNormalMode.currentPage.objectName == "contactsPage") {
348 pageStackNormalMode.pop();
349 }
350
351 if (pageStackNormalMode.depth > 1 && pageStackNormalMode.currentPage.objectName == "pageLiveCall") {
352 pageStackNormalMode.pop();
353 }
354
355 while (pageStackGreeterMode.depth > 1) {
356 pageStackGreeterMode.pop();
310 }357 }
311 }358 }
312359
313 function switchToKeypadView() {360 function switchToKeypadView() {
314 while (pageStack.depth > 1) {361 while (pageStackNormalMode.depth > 1) {
315 pageStack.pop();362 pageStackNormalMode.pop();
363 }
364 while (pageStackGreeterMode.depth > 1) {
365 pageStackGreeterMode.pop();
316 }366 }
317 }367 }
318368
319 function animateLiveCall() {369 function animateLiveCall() {
320 if (pageStack.currentPage && pageStack.currentPage.triggerCallAnimation) {370 var stack = mainView.greeterMode ? pageStackGreeterMode : pageStackNormalMode
321 pageStack.currentPage.triggerCallAnimation();371 if (stack.currentPage && stack.currentPage.triggerCallAnimation) {
372 stack.currentPage.triggerCallAnimation();
322 } else {373 } else {
323 switchToLiveCall();374 switchToLiveCall();
324 }375 }
325 }376 }
326377
327 function switchToLiveCall() {378 function switchToLiveCall() {
328 // pop the stack if the live call is not the visible view379 var stack = mainView.greeterMode ? pageStackGreeterMode : pageStackNormalMode
329 // FIXME: using the objectName here is not pretty, change by something less prone to errors380
330 while (pageStack.depth > 1 && pageStack.currentPage.objectName != "pageLiveCall") {381 if (pageStackNormalMode.depth > 2 && pageStackNormalMode.currentPage.objectName == "contactsPage") {
331 pageStack.pop();382 // pop contacts Page
383 stack.pop();
332 }384 }
385
333 var properties = {}386 var properties = {}
334 if (isEmergencyNumber(pendingNumberToDial)) {387 if (isEmergencyNumber(pendingNumberToDial)) {
335 properties["defaultTimeout"] = 30000388 properties["defaultTimeout"] = 30000
336 }389 }
337390
338 if (pageStack.depth === 1) {391 if (stack.currentPage.objectName == "pageLiveCall") {
339 pageStack.push(Qt.resolvedUrl("LiveCallPage/LiveCall.qml"), properties)392 return;
340 }393 }
394
395 stack.push(Qt.resolvedUrl("LiveCallPage/LiveCall.qml"), properties)
341 }396 }
342397
343 Component.onCompleted: {398 Component.onCompleted: {
344 i18n.domain = "dialer-app"399 i18n.domain = "dialer-app"
345 i18n.bindtextdomain("dialer-app", i18nDirectory)400 i18n.bindtextdomain("dialer-app", i18nDirectory)
346 pageStack.push(Qt.createComponent("DialerPage/DialerPage.qml"))401 pageStackNormalMode.push(Qt.createComponent("DialerPage/DialerPage.qml"))
347402
348 // if there are calls, even if we don't have info about them yet, push the livecall view403 // if there are calls, even if we don't have info about them yet, push the livecall view
349 if (callManager.hasCalls) {404 if (callManager.hasCalls) {
@@ -484,16 +539,22 @@
484 target: callManager539 target: callManager
485 onHasCallsChanged: {540 onHasCallsChanged: {
486 if (!callManager.hasCalls) {541 if (!callManager.hasCalls) {
542 mainView.lastHasCalls = callManager.hasCalls
487 return;543 return;
488 }544 }
489545
546 var stack = mainView.greeterMode ? pageStackGreeterMode : pageStackNormalMode
490 // if we are animating the dialpad view, do not switch to livecall directly547 // if we are animating the dialpad view, do not switch to livecall directly
491 if (pageStack.currentPage && pageStack.currentPage.callAnimationRunning) {548 if (stack.currentPage && stack.currentPage.callAnimationRunning) {
549 mainView.lastHasCalls = callManager.hasCalls
492 return;550 return;
493 }551 }
494552
495 // if not, just open the live call553 // if not, just open the live call
496 switchToLiveCall();554 if (mainView.lastHasCalls != callManager.hasCalls) {
555 mainView.lastHasCalls = callManager.hasCalls
556 switchToLiveCall();
557 }
497 }558 }
498 }559 }
499560
@@ -575,7 +636,16 @@
575 }636 }
576637
577 PageStack {638 PageStack {
578 id: pageStack639 id: pageStackNormalMode
579 anchors.fill: parent640 anchors.fill: parent
641 active: mainView.state == "normalMode"
642 visible: active
643 }
644
645 PageStack {
646 id: pageStackGreeterMode
647 anchors.fill: parent
648 active: mainView.state == "greeterMode"
649 visible: active
580 }650 }
581}651}

Subscribers

People subscribed via source and target branches