Merge lp:~tiagosh/messaging-app/update-sim-dialogs into lp:messaging-app

Proposed by Tiago Salem Herrmann
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 442
Merged at revision: 470
Proposed branch: lp:~tiagosh/messaging-app/update-sim-dialogs
Merge into: lp:messaging-app
Prerequisite: lp:~tiagosh/messaging-app/presence_and_typing_status
Diff against target: 213 lines (+35/-64)
4 files modified
src/qml/Dialogs/NoDefaultSIMCardDialog.qml (+10/-44)
src/qml/MMSDelegate.qml (+2/-2)
src/qml/Messages.qml (+13/-9)
src/qml/messaging-app.qml (+10/-9)
To merge this branch: bzr merge lp:~tiagosh/messaging-app/update-sim-dialogs
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Gustavo Pichorim Boiko (community) Approve
Review via email: mp+267582@code.launchpad.net

Commit message

Update SIM dialogs according to design spec.

Description of the change

Update SIM dialogs according to design spec.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
427. By Tiago Salem Herrmann

merge parent branch

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
428. By Tiago Salem Herrmann

set x-canonical-tmp-files when resending mms

429. By Tiago Salem Herrmann

fix conflict

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)
430. By Tiago Salem Herrmann

merge parent branch

431. By Tiago Salem Herrmann

merge parent branch

432. By Tiago Salem Herrmann

merge parent branch

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
433. By Tiago Salem Herrmann

merge parrent branch

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
434. By Tiago Salem Herrmann

merge trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
435. By Tiago Salem Herrmann

Merge parent branch

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
436. By Tiago Salem Herrmann

merge trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
437. By Tiago Salem Herrmann

merge parent branch

438. By Tiago Salem Herrmann

fix header in group chats

439. By Tiago Salem Herrmann

dont create threads on startChat()

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
Gustavo Pichorim Boiko (boiko) wrote :

Just one inline comment for now.

review: Needs Fixing
440. By Tiago Salem Herrmann

merge parent branch

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
441. By Tiago Salem Herrmann

merge parent branch

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
442. By Tiago Salem Herrmann

Reenable default sim card watcher

Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

Looks good now!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/qml/Dialogs/NoDefaultSIMCardDialog.qml'
2--- src/qml/Dialogs/NoDefaultSIMCardDialog.qml 2015-09-14 13:51:27 +0000
3+++ src/qml/Dialogs/NoDefaultSIMCardDialog.qml 2015-11-19 16:17:37 +0000
4@@ -24,66 +24,32 @@
5 Component {
6 Dialog {
7 id: dialogue
8- title: i18n.tr("Switch to default SIM:")
9+ title: i18n.tr("Welcome to your Messaging app!")
10 Column {
11 anchors.left: parent.left
12 anchors.right: parent.right
13 spacing: units.gu(2)
14
15- Row {
16- spacing: units.gu(4)
17- anchors.horizontalCenter: parent.horizontalCenter
18- height: paintedHeight + units.gu(3)
19- Repeater {
20- model: telepathyHelper.activeAccounts
21- delegate: Label {
22- text: modelData.displayName
23- color: UbuntuColors.orange
24- MouseArea {
25- anchors.fill: parent
26- onClicked: {
27- PopupUtils.close(dialogue)
28- telepathyHelper.setDefaultAccount(TelepathyHelper.Messaging, modelData)
29- }
30- }
31- }
32- }
33- }
34-
35 Label {
36 anchors.left: parent.left
37 anchors.right: parent.right
38 height: paintedHeight + units.gu(6)
39 verticalAlignment: Text.AlignVCenter
40- text: i18n.tr("Select a default SIM for all outgoing messages. You can always alter your choice in <a href=\"system_settings\">System Settings</a>.")
41+ text: i18n.tr("If you wish to edit your SIM and other mobile preferences, please visit <a href=\"system_settings\">System Settings</a>.")
42 wrapMode: Text.WordWrap
43 onLinkActivated: {
44 PopupUtils.close(dialogue)
45 Qt.openUrlExternally("settings:///system/cellular")
46 }
47 }
48- Row {
49- spacing: units.gu(4)
50- anchors.horizontalCenter: parent.horizontalCenter
51- Button {
52- objectName: "noNoSimCardDefaultDialog"
53- text: i18n.tr("No")
54- color: UbuntuColors.orange
55- onClicked: {
56- settings.mainViewDontAskCount = 3
57- PopupUtils.close(dialogue)
58- Qt.inputMethod.hide()
59- }
60- }
61- Button {
62- objectName: "laterNoSimCardDefaultDialog"
63- text: i18n.tr("Later")
64- color: UbuntuColors.orange
65- onClicked: {
66- PopupUtils.close(dialogue)
67- settings.mainViewDontAskCount++
68- Qt.inputMethod.hide()
69- }
70+ Button {
71+ objectName: "closeNoSimCardDefaultDialog"
72+ text: i18n.tr("Close")
73+ color: UbuntuColors.orange
74+ onClicked: {
75+ settings.mainViewIgnoreFirstTimeDialog = true
76+ PopupUtils.close(dialogue)
77+ Qt.inputMethod.hide()
78 }
79 }
80 }
81
82=== modified file 'src/qml/MMSDelegate.qml'
83--- src/qml/MMSDelegate.qml 2015-11-19 16:17:37 +0000
84+++ src/qml/MMSDelegate.qml 2015-11-19 16:17:37 +0000
85@@ -64,8 +64,8 @@
86 attachment.push(item.filePath)
87 newAttachments.push(attachment)
88 }
89- deleteMessage()
90- messages.sendMessage(textMessage, messages.participantIds, newAttachments)
91+ messages.sendMessage(textMessage, messages.participantIds, newAttachments, {"x-canonical-tmp-files": true})
92+ deleteMessage();
93 }
94
95 function copyMessage()
96
97=== modified file 'src/qml/Messages.qml'
98--- src/qml/Messages.qml 2015-11-19 16:17:37 +0000
99+++ src/qml/Messages.qml 2015-11-19 16:17:37 +0000
100@@ -325,7 +325,11 @@
101 multiRecipient.forceActiveFocus()
102 }
103
104- function sendMessage(text, participantIds, attachments) {
105+ function sendMessage(text, participantIds, attachments, properties) {
106+ if (typeof(properties) === 'undefined') {
107+ properties = {}
108+ }
109+
110 // check if at least one account is selected
111 if (!messages.account) {
112 Qt.inputMethod.hide()
113@@ -427,20 +431,19 @@
114 }
115 eventModel.writeEvents([event]);
116 } else {
117- var isMMS = attachments.length > 0
118- var isMmsGroupChat = participantIds.length > 1 && telepathyHelper.mmsGroupChat
119+ var isMmsGroupChat = participants.length > 1 && telepathyHelper.mmsGroupChat && messages.account.type == AccountEntry.PhoneAccount
120 // mms group chat only works if we know our own phone number
121 var isSelfContactKnown = account.selfContactId != ""
122- // FIXME: maybe move this to telepathy-ofono itself and treat as just sendMessage on the app?
123- if (isMMS || (isMmsGroupChat && isSelfContactKnown)) {
124- chatManager.sendMMS(participantIds, text, attachments, messages.account.accountId)
125- } else {
126- chatManager.sendMessage(participantIds, text, messages.account.accountId)
127+ if (isMmsGroupChat && !isSelfContactKnown) {
128+ // TODO: inform the user to enter the phone number of the selected sim card manually
129+ // and use it in the telepathy-ofono account as selfContactId.
130+ return
131 }
132+ chatManager.sendMessage(messages.account.accountId, participantIds, text, attachments, properties)
133 }
134
135 // FIXME: soon it won't be just about SIM cards, so the dialogs need updating
136- if (multiplePhoneAccounts && !telepathyHelper.defaultMessagingAccount && !settings.messagesDontAsk) {
137+ if (multiplePhoneAccounts && !telepathyHelper.defaultMessagingAccount && !settings.messagesDontAsk && account.type == AccountEntry.PhoneAccount) {
138 Qt.inputMethod.hide()
139 PopupUtils.open(Qt.createComponent("Dialogs/SetDefaultSIMCardDialog.qml").createObject(messages))
140 } else {
141@@ -854,6 +857,7 @@
142 name: "groupChat"
143 head: messages.head
144 when: groupChat
145+ contents: header
146 backAction: backButton
147
148 actions: [
149
150=== modified file 'src/qml/messaging-app.qml'
151--- src/qml/messaging-app.qml 2015-11-19 16:17:37 +0000
152+++ src/qml/messaging-app.qml 2015-11-19 16:17:37 +0000
153@@ -27,7 +27,6 @@
154 MainView {
155 id: mainView
156
157- property string newPhoneNumber
158 property bool multiplePhoneAccounts: {
159 var numAccounts = 0
160 for (var i in telepathyHelper.activeAccounts) {
161@@ -45,7 +44,7 @@
162 function defaultPhoneAccount() {
163 // we only use the default account property if we have more
164 // than one account, otherwise we use always the first one
165- if (multiplePhoneAccounts) {
166+ if (multiplePhoneAccounts && telepathyHelper.defaultMessagingAccount) {
167 return telepathyHelper.defaultMessagingAccount
168 } else {
169 for (var i in telepathyHelper.activeAccounts) {
170@@ -133,7 +132,6 @@
171 onDefaultMessagingAccountChanged: account = Qt.binding(defaultPhoneAccount)
172 }
173
174-
175 automaticOrientation: true
176 width: units.gu(40)
177 height: units.gu(71)
178@@ -148,8 +146,7 @@
179 target: telepathyHelper
180 onSetupReady: {
181 if (multiplePhoneAccounts && !telepathyHelper.defaultMessagingAccount &&
182- settings.mainViewDontAskCount < 3 && mainStack.depth === 1) {
183- // FIXME: soon it will be more than just SIM cards, update the dialog accordingly
184+ !settings.mainViewIgnoreFirstTimeDialog && mainStack.depth === 1) {
185 PopupUtils.open(Qt.createComponent("Dialogs/NoDefaultSIMCardDialog.qml").createObject(mainView))
186 }
187 }
188@@ -171,7 +168,7 @@
189 id: settings
190 category: "DualSim"
191 property bool messagesDontAsk: false
192- property int mainViewDontAskCount: 0
193+ property bool mainViewIgnoreFirstTimeDialog: false
194 }
195
196 Connections {
197@@ -227,9 +224,13 @@
198 participantIds,
199 mainView.account.type == AccountEntry.PhoneAccount ? HistoryThreadModel.MatchPhoneNumber
200 : HistoryThreadModel.MatchCaseSensitive,
201- true)
202- properties["participants"] = thread.participants
203- } else {
204+ false)
205+ if (thread.hasOwnProperty("participants")) {
206+ properties["participants"] = thread.participants
207+ }
208+ }
209+
210+ if (!properties.hasOwnProperty("participants")) {
211 var participants = []
212 for (var i in participantIds) {
213 var participant = {}

Subscribers

People subscribed via source and target branches