Merge lp:~boiko/dialer-app/show_emergency_calls_when_sim_locked into lp:dialer-app

Proposed by Gustavo Pichorim Boiko
Status: Merged
Approved by: Tiago Salem Herrmann
Approved revision: 526
Merged at revision: 527
Proposed branch: lp:~boiko/dialer-app/show_emergency_calls_when_sim_locked
Merge into: lp:dialer-app
Diff against target: 161 lines (+60/-10)
4 files modified
src/qml/DialerPage/DialerPage.qml (+26/-4)
src/qml/Dialogs/SimLockedDialog.qml (+2/-1)
src/qml/dialer-app.qml (+9/-4)
tests/qml/tst_DialerPage.qml (+23/-1)
To merge this branch: bzr merge lp:~boiko/dialer-app/show_emergency_calls_when_sim_locked
Reviewer Review Type Date Requested Status
Tiago Salem Herrmann (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+293456@code.launchpad.net

Commit message

In order to make it clear that emergency calls are possible in a sim locked situation,
show "Emergency Calls" in the header together with a sim locked icon.

Description of the change

In order to make it clear that emergency calls are possible in a sim locked situation,
show "Emergency Calls" in the header together with a sim locked icon.

To post a comment you must log in.
526. By Gustavo Pichorim Boiko

Update copyright header.

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)
Revision history for this message
Tiago Salem Herrmann (tiagosh) wrote :

looks good to me.

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 2016-02-11 17:58:29 +0000
+++ src/qml/DialerPage/DialerPage.qml 2016-04-29 21:33:35 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright 2012-2013 Canonical Ltd.2 * Copyright 2012-2016 Canonical Ltd.
3 *3 *
4 * This file is part of dialer-app.4 * This file is part of dialer-app.
5 *5 *
@@ -71,15 +71,34 @@
7171
72 ]72 ]
73 head.actions: mainView.greeterMode ? actionsGreeter : actionsNormal73 head.actions: mainView.greeterMode ? actionsGreeter : actionsNormal
74 head.backAction: Action {74
75 Action {
76 id: backAction
77 objectName: "backAction"
75 iconName: "back"78 iconName: "back"
76 text: i18n.tr("Close")79 text: i18n.tr("Close")
77 visible: mainView.greeterMode
78 onTriggered: {80 onTriggered: {
79 greeter.showGreeter()81 greeter.showGreeter()
80 dialNumber = "";82 dialNumber = "";
81 }83 }
82 }84 }
85 Action {
86 id: simLockedAction
87 objectName: "simLockedAction"
88 iconName: "simcard-locked"
89 onTriggered: {
90 mainView.showSimLockedDialog()
91 }
92 }
93
94 head.backAction: {
95 if (mainView.greeterMode) {
96 return backAction
97 } else if (mainView.simLocked) {
98 return simLockedAction
99 }
100 return null
101 }
83102
84 objectName: "dialerPage"103 objectName: "dialerPage"
85104
@@ -97,7 +116,10 @@
97 } else if (telepathyHelper.flightMode) {116 } else if (telepathyHelper.flightMode) {
98 return i18n.tr("Flight Mode")117 return i18n.tr("Flight Mode")
99 } else if (mainView.account && mainView.account.simLocked) {118 } else if (mainView.account && mainView.account.simLocked) {
100 return i18n.tr("SIM Locked")119 // just in case we need it back in the future somewhere, keep the original string
120 var oldTitle = i18n.tr("SIM Locked")
121 // show Emergency Calls for sim locked too. There is going to be an icon indicating it is locked
122 return i18n.tr("Emergency Calls")
101 } else if (mainView.account && mainView.account.networkName != "") {123 } else if (mainView.account && mainView.account.networkName != "") {
102 return mainView.account.networkName124 return mainView.account.networkName
103 } else if (multiplePhoneAccounts && !mainView.account) {125 } else if (multiplePhoneAccounts && !mainView.account) {
104126
=== modified file 'src/qml/Dialogs/SimLockedDialog.qml'
--- src/qml/Dialogs/SimLockedDialog.qml 2015-09-07 15:40:45 +0000
+++ src/qml/Dialogs/SimLockedDialog.qml 2016-04-29 21:33:35 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright 2012-2013 Canonical Ltd.2 * Copyright 2012-2016 Canonical Ltd.
3 *3 *
4 * This file is part of dialer-app.4 * This file is part of dialer-app.
5 *5 *
@@ -23,6 +23,7 @@
23Component {23Component {
24 Dialog {24 Dialog {
25 id: dialogue25 id: dialogue
26 objectName: "simLockedDialog"
26 title: i18n.tr("SIM Card is locked")27 title: i18n.tr("SIM Card is locked")
27 Column {28 Column {
28 anchors.left: parent.left29 anchors.left: parent.left
2930
=== modified file 'src/qml/dialer-app.qml'
--- src/qml/dialer-app.qml 2016-03-17 22:01:50 +0000
+++ src/qml/dialer-app.qml 2016-04-29 21:33:35 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright 2012-2013 Canonical Ltd.2 * Copyright 2012-2016 Canonical Ltd.
3 *3 *
4 * This file is part of dialer-app.4 * This file is part of dialer-app.
5 *5 *
@@ -43,6 +43,7 @@
43 }43 }
4444
45 property QtObject account: defaultPhoneAccount()45 property QtObject account: defaultPhoneAccount()
46 property bool simLocked: account && account.simLocked
46 property bool greeterMode: (state == "greeterMode")47 property bool greeterMode: (state == "greeterMode")
47 property bool lastHasCalls: callManager.hasCalls48 property bool lastHasCalls: callManager.hasCalls
48 property bool telepathyReady: false49 property bool telepathyReady: false
@@ -365,9 +366,7 @@
365 }366 }
366367
367 if (mainView.account && !mainView.greeterMode && mainView.account.simLocked) {368 if (mainView.account && !mainView.greeterMode && mainView.account.simLocked) {
368 var properties = {}369 showSimLockedDialog();
369 properties["accountId"] = mainView.account.accountId
370 PopupUtils.open(Qt.createComponent("Dialogs/SimLockedDialog.qml").createObject(mainView), mainView, properties)
371 return370 return
372 }371 }
373372
@@ -473,6 +472,12 @@
473 PopupUtils.open(Qt.resolvedUrl("Dialogs/NotificationDialog.qml"), mainView, {title: title, text: text});472 PopupUtils.open(Qt.resolvedUrl("Dialogs/NotificationDialog.qml"), mainView, {title: title, text: text});
474 }473 }
475474
475 function showSimLockedDialog() {
476 var properties = {}
477 properties["accountId"] = mainView.account.accountId
478 PopupUtils.open(Qt.createComponent("Dialogs/SimLockedDialog.qml").createObject(mainView), mainView, properties)
479 }
480
476 Component.onCompleted: {481 Component.onCompleted: {
477 i18n.domain = "dialer-app"482 i18n.domain = "dialer-app"
478 i18n.bindtextdomain("dialer-app", i18nDirectory)483 i18n.bindtextdomain("dialer-app", i18nDirectory)
479484
=== modified file 'tests/qml/tst_DialerPage.qml'
--- tests/qml/tst_DialerPage.qml 2015-10-19 18:02:58 +0000
+++ tests/qml/tst_DialerPage.qml 2016-04-29 21:33:35 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright 2014 Canonical Ltd.2 * Copyright 2014-2016 Canonical Ltd.
3 *3 *
4 * This file is part of dialer-app.4 * This file is part of dialer-app.
5 *5 *
@@ -114,6 +114,28 @@
114114
115 mainViewLoader.item.applicationActive = false115 mainViewLoader.item.applicationActive = false
116 tryCompare(mainViewLoader.item.currentStack.currentPage, 'title', ' ')116 tryCompare(mainViewLoader.item.currentStack.currentPage, 'title', ' ')
117 mainViewLoader.item.applicationActive = true
118 }
119
120 function test_dialerPageWhenSimLocked() {
121 mainViewLoader.item.switchToKeypadView()
122 tryCompare(mainViewLoader.item, 'applicationActive', true)
123 tryCompare(mainViewLoader.item.currentStack, 'depth', 1)
124
125 mainViewLoader.item.telepathyReady = true
126 greeter.greeterActive = false
127 testAccount.simLocked = true
128
129 var dialerPage = mainViewLoader.item.currentStack.currentPage
130 tryCompare(dialerPage, 'title', i18n.tr('Emergency Calls'))
131 tryCompare(dialerPage.head.backAction, 'objectName', 'simLockedAction')
132
133 // click the action to see if the dialog is shown
134 dialerPage.head.backAction.trigger()
135 var simLockedDialog = findChild(root, 'simLockedDialog')
136 tryCompare(simLockedDialog, 'visible', true)
137 var okButton = findChild(simLockedDialog, 'okSimLockedDialog')
138 mouseClick(okButton)
117 }139 }
118140
119 /*141 /*

Subscribers

People subscribed via source and target branches