Merge lp:~tiagosh/messaging-app/sim-lock into lp:messaging-app

Proposed by Tiago Salem Herrmann on 2014-09-30
Status: Merged
Approved by: Gustavo Pichorim Boiko on 2014-09-30
Approved revision: 260
Merged at revision: 262
Proposed branch: lp:~tiagosh/messaging-app/sim-lock
Merge into: lp:messaging-app
Diff against target: 163 lines (+103/-13)
4 files modified
src/qml/Dialogs/SimLockedDialog.qml (+68/-0)
src/qml/MMSDelegate.qml (+4/-0)
src/qml/Messages.qml (+27/-13)
src/qml/SMSDelegate.qml (+4/-0)
To merge this branch: bzr merge lp:~tiagosh/messaging-app/sim-lock
Reviewer Review Type Date Requested Status
Gustavo Pichorim Boiko (community) 2014-09-30 Approve on 2014-09-30
PS Jenkins bot continuous-integration Approve on 2014-09-30
Review via email: mp+236595@code.launchpad.net

Commit message

Add support for sim lock.

Description of the change

Add support for sim lock.

Are there any related MPs required for this MP to build/function as expected? Please list.
https://code.launchpad.net/~tiagosh/telephony-service/sim-lock/+merge/235505

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)
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 (https://wiki.ubuntu.com/Process/Merges/TestPlan/messaging-app) on device or emulator?
Yes

If you changed the UI, was the change specified/approved by design?
Yes

If you changed UI labels, did you update the pot file?
It will be updated later

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?
N/A

To post a comment you must log in.
Gustavo Pichorim Boiko (boiko) 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.
Yes

Have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut?
Yes

Code looks good and works as expected!

review: Approve
lp:~tiagosh/messaging-app/sim-lock updated on 2014-10-01
261. By Tiago Salem Herrmann on 2014-09-30

hide keyboard on sim lock dialog

262. By Tiago Salem Herrmann on 2014-10-01

Disable the unlock button for now

263. By Tiago Salem Herrmann on 2014-10-01

change dialog message

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'src/qml/Dialogs/SimLockedDialog.qml'
2--- src/qml/Dialogs/SimLockedDialog.qml 1970-01-01 00:00:00 +0000
3+++ src/qml/Dialogs/SimLockedDialog.qml 2014-10-01 15:58:03 +0000
4@@ -0,0 +1,68 @@
5+/*
6+ * Copyright 2012-2013 Canonical Ltd.
7+ *
8+ * This file is part of messaging-app.
9+ *
10+ * dialer-app is free software; you can redistribute it and/or modify
11+ * it under the terms of the GNU General Public License as published by
12+ * the Free Software Foundation; version 3.
13+ *
14+ * dialer-app is distributed in the hope that it will be useful,
15+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+ * GNU General Public License for more details.
18+ *
19+ * You should have received a copy of the GNU General Public License
20+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21+ */
22+
23+import QtQuick 2.0
24+import Ubuntu.Components 1.1
25+import Ubuntu.Components.Popups 0.1
26+
27+Component {
28+ Dialog {
29+ id: dialogue
30+ title: i18n.tr("SIM Card is locked")
31+ Column {
32+ anchors.left: parent.left
33+ anchors.right: parent.right
34+ spacing: units.gu(2)
35+
36+ Label {
37+ anchors.left: parent.left
38+ anchors.right: parent.right
39+ height: paintedHeight
40+ verticalAlignment: Text.AlignVCenter
41+ text: i18n.tr("Please unlock your SIM card to call or send a message. You can unlock your SIM card from the Network Indicator at the top of the screen or by visiting <a href=\"system_settings\">System Settings &gt; Security &amp; Privacy</a>.")
42+ wrapMode: Text.WordWrap
43+ onLinkActivated: {
44+ PopupUtils.close(dialogue)
45+ Qt.openUrlExternally("settings:///system/security-privacy")
46+ }
47+ }
48+ Row {
49+ spacing: units.gu(4)
50+ anchors.horizontalCenter: parent.horizontalCenter
51+ Button {
52+ objectName: "okSimLockedDialog"
53+ text: i18n.tr("Ok")
54+ color: UbuntuColors.orange
55+ onClicked: {
56+ PopupUtils.close(dialogue)
57+ }
58+ }
59+ // Please, reenable this once lp:1374215 gets fixed
60+ /*Button {
61+ objectName: "unlockSimLockedDialog"
62+ text: i18n.tr("Unlock")
63+ color: UbuntuColors.orange
64+ onClicked: {
65+ PopupUtils.close(dialogue)
66+ telepathyHelper.unlockSimCards()
67+ }
68+ }*/
69+ }
70+ }
71+ }
72+}
73
74=== modified file 'src/qml/MMSDelegate.qml'
75--- src/qml/MMSDelegate.qml 2014-08-28 21:54:12 +0000
76+++ src/qml/MMSDelegate.qml 2014-10-01 15:58:03 +0000
77@@ -48,6 +48,10 @@
78
79 function resendMessage()
80 {
81+ if (!sendMessageSanityCheck()) {
82+ return
83+ }
84+
85 var newAttachments = []
86 for (var i = 0; i < attachments.length; i++) {
87 var attachment = []
88
89=== modified file 'src/qml/Messages.qml'
90--- src/qml/Messages.qml 2014-09-17 15:48:56 +0000
91+++ src/qml/Messages.qml 2014-10-01 15:58:03 +0000
92@@ -73,8 +73,27 @@
93 }
94 }
95
96- function checkNetwork() {
97- return messages.account.connected;
98+ function sendMessageSanityCheck() {
99+ // check if at least one account is selected
100+ if (!messages.account) {
101+ Qt.inputMethod.hide()
102+ PopupUtils.open(Qt.createComponent("Dialogs/NoSIMCardSelectedDialog.qml").createObject(messages))
103+ return false
104+ }
105+
106+ if (messages.account.simLocked) {
107+ Qt.inputMethod.hide()
108+ PopupUtils.open(Qt.createComponent("Dialogs/SimLockedDialog.qml").createObject(messages))
109+ return false
110+ }
111+
112+ if (!messages.account.connected) {
113+ Qt.inputMethod.hide()
114+ PopupUtils.open(noNetworkDialog)
115+ return false
116+ }
117+
118+ return true
119 }
120
121 function onPhonePickedDuringSearch(phoneNumber) {
122@@ -831,20 +850,15 @@
123 return false
124 }
125 onClicked: {
126- // check if at least one account is selected
127- if (!messages.account) {
128- Qt.inputMethod.hide()
129- PopupUtils.open(Qt.createComponent("Dialogs/NoSIMCardSelectedDialog.qml").createObject(messages))
130- return
131- }
132- if (!checkNetwork()) {
133- Qt.inputMethod.hide()
134- PopupUtils.open(noNetworkDialog)
135- return
136- }
137+ if (!sendMessageSanityCheck()) {
138+ return
139+ }
140+
141 if (multipleAccounts && !telepathyHelper.defaultMessagingAccount && !settings.messagesDontAsk) {
142+ Qt.inputMethod.hide()
143 PopupUtils.open(Qt.createComponent("Dialogs/SetDefaultSIMCardDialog.qml").createObject(messages))
144 }
145+
146 // make sure we flush everything we have prepared in the OSK preedit
147 Qt.inputMethod.commit();
148 if (textEntry.text == "" && attachments.count == 0) {
149
150=== modified file 'src/qml/SMSDelegate.qml'
151--- src/qml/SMSDelegate.qml 2014-08-26 18:49:54 +0000
152+++ src/qml/SMSDelegate.qml 2014-10-01 15:58:03 +0000
153@@ -34,6 +34,10 @@
154
155 function resendMessage()
156 {
157+ if (!sendMessageSanityCheck()) {
158+ return
159+ }
160+
161 eventModel.removeEvent(root.messageData.accountId,
162 root.messageData.threadId,
163 root.messageData.eventId,

Subscribers

People subscribed via source and target branches