Merge lp:~phablet-team/dialer-app/rtm-fit-finish into lp:dialer-app

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Tiago Salem Herrmann
Approved revision: 220
Merged at revision: 211
Proposed branch: lp:~phablet-team/dialer-app/rtm-fit-finish
Merge into: lp:dialer-app
Diff against target: 1918 lines (+470/-902)
21 files modified
src/qml/ContactsPage/ContactsPage.qml (+3/-2)
src/qml/DialerPage/CallButton.qml (+11/-3)
src/qml/DialerPage/CustomButton.qml (+2/-3)
src/qml/DialerPage/DialerPage.qml (+218/-221)
src/qml/DialerPage/Keypad.qml (+4/-2)
src/qml/DialerPage/KeypadButton.qml (+15/-15)
src/qml/DialerPage/KeypadEntry.qml (+41/-42)
src/qml/HistoryPage/ExpandableButton.qml (+1/-1)
src/qml/HistoryPage/HistoryDelegate.qml (+99/-102)
src/qml/HistoryPage/HistoryPage.qml (+34/-32)
src/qml/HistoryPage/Timeline.qml (+1/-1)
src/qml/LiveCallPage/ConferenceCallDisplay.qml (+1/-1)
src/qml/LiveCallPage/HangupButton.qml (+1/-1)
src/qml/LiveCallPage/LiveCall.qml (+27/-35)
src/qml/LiveCallPage/LiveCallKeypadButton.qml (+1/-1)
src/qml/LiveCallPage/MultiCallDisplay.qml (+1/-1)
src/qml/LiveCallPage/StopWatch.qml (+1/-1)
src/qml/PageWithBottomEdge.qml (+0/-434)
src/qml/dialer-app.qml (+7/-2)
tests/autopilot/dialer_app/emulators.py (+1/-1)
tests/autopilot/dialer_app/tests/test_calls.py (+1/-1)
To merge this branch: bzr merge lp:~phablet-team/dialer-app/rtm-fit-finish
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Tiago Salem Herrmann (community) Approve
Review via email: mp+228530@code.launchpad.net

Commit message

- Visual update
- Update import to use Ubuntu.Components 1.1
- Updated HistoryDelegate with new ListItemWithActions visuals.
- Replaced local implementation of PageWithBottomEdge with Ubuntu.Contacts implementation.
- Used new SDK header API.

Description of the change

Visual update

== Checklist ==
Are there any related MPs required for this MP to build/function as expected? Please list.
Yes: https://code.launchpad.net/~phablet-team/address-book-app/rtm-fit-finish/+merge/228529

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/dialer-app) on device or emulator?
Yes

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

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.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
203. By Renato Araujo Oliveira Filho

Updated HistoryDelegate with new ListItemWithActions visuals.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
204. By Renato Araujo Oliveira Filho

Fixed sim selector.

205. By Renato Araujo Oliveira Filho

Fixed typo.

206. By Renato Araujo Oliveira Filho

Fixed header sections visual when empty.

207. By Renato Araujo Oliveira Filho

Replaced local implementation of PageWithBottomEdge with Ubuntu.Contacts implementation.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
208. By Renato Araujo Oliveira Filho

Fixed live call keypad position.

209. By Renato Araujo Oliveira Filho

Remove 20 digits limit from KeypadEntry;

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
210. By Renato Araujo Oliveira Filho

Move RecentListView back to beginner after close it.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
211. By Renato Araujo Oliveira Filho

Fixed KeypadEntry alingment when there the content width is bigger then the item width.

212. By Renato Araujo Oliveira Filho

HistoryPage header update to new SDK API.

213. By Renato Araujo Oliveira Filho

Fixed multiselection visuals.

214. By Renato Araujo Oliveira Filho

Trunk merged.

215. By Renato Araujo Oliveira Filho

Parent merged.

216. By Gustavo Pichorim Boiko

Fix the account usage in QML.

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)
217. By Gustavo Pichorim Boiko

Fix finding the account index.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
218. By Renato Araujo Oliveira Filho

Implemented support to add a new contact from contact page.

219. By Gustavo Pichorim Boiko

Fix autopilot tests.

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)
220. By Gustavo Pichorim Boiko

Remove wrong line.

Revision history for this message
Tiago Salem Herrmann (tiagosh) 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.
No, it depends on other branches.

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

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
=== modified file 'src/qml/ContactsPage/ContactsPage.qml'
--- src/qml/ContactsPage/ContactsPage.qml 2014-07-25 14:16:22 +0000
+++ src/qml/ContactsPage/ContactsPage.qml 2014-08-04 18:47:59 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
21import Ubuntu.Components.ListItems 0.1 as ListItem21import Ubuntu.Components.ListItems 0.1 as ListItem
22import Ubuntu.Components.Popups 0.122import Ubuntu.Components.Popups 0.1
23import Ubuntu.Contacts 0.123import Ubuntu.Contacts 0.1
@@ -43,7 +43,7 @@
43 }43 }
44 onTextChanged: contactList.currentIndex = -144 onTextChanged: contactList.currentIndex = -1
45 inputMethodHints: Qt.ImhNoPredictiveText45 inputMethodHints: Qt.ImhNoPredictiveText
46 placeholderText: i18n.tr("Type a name or phone to search")46 placeholderText: i18n.tr("Search...")
47 }47 }
4848
49 // background49 // background
@@ -78,6 +78,7 @@
78 mainView.populateDialpad(detail.number)78 mainView.populateDialpad(detail.number)
79 }79 }
80 }80 }
81 onAddDetailClicked: mainView.addPhoneToContact(contact.contactId, " ")
81 }82 }
8283
83 KeyboardRectagle {84 KeyboardRectagle {
8485
=== modified file 'src/qml/DialerPage/CallButton.qml'
--- src/qml/DialerPage/CallButton.qml 2014-05-23 08:30:55 +0000
+++ src/qml/DialerPage/CallButton.qml 2014-08-04 18:47:59 +0000
@@ -17,22 +17,30 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
2121
22AbstractButton {22AbstractButton {
23 id: button23 id: button
24
25 readonly property string defaultColor: "#0F8B21"
26 property alias iconRotation: icon.rotation
27 property alias color: shape.color
28
24 width: units.gu(21)29 width: units.gu(21)
25 height: units.gu(4.5)30 height: units.gu(4.5)
26 opacity: button.pressed ? 0.5 : (enabled ? 1 : 0.2)31 opacity: button.pressed ? 0.5 : (enabled ? 1 : 0.2)
2732
28 UbuntuShape {33 UbuntuShape {
34 id: shape
35
29 anchors.fill: parent36 anchors.fill: parent
30 color: "#0F8B21"37 color: defaultColor
31 gradientColor: "#37B349"
32 radius: "medium"38 radius: "medium"
33 }39 }
3440
35 Icon {41 Icon {
42 id: icon
43
36 anchors.centerIn: parent44 anchors.centerIn: parent
37 width: units.gu(3)45 width: units.gu(3)
38 height: units.gu(3)46 height: units.gu(3)
3947
=== modified file 'src/qml/DialerPage/CustomButton.qml'
--- src/qml/DialerPage/CustomButton.qml 2014-05-21 07:25:47 +0000
+++ src/qml/DialerPage/CustomButton.qml 2014-08-04 18:47:59 +0000
@@ -17,18 +17,17 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
2121
22Button {22Button {
23 property alias icon: buttonIcon.name23 property alias icon: buttonIcon.name
24 property alias iconWidth: buttonIcon.width24 property alias iconWidth: buttonIcon.width
25 property alias iconHeight: buttonIcon.height25 property alias iconHeight: buttonIcon.height
26 property bool lighten: false
2726
28 Icon {27 Icon {
29 id: buttonIcon28 id: buttonIcon
30 anchors.centerIn: parent29 anchors.centerIn: parent
31 color: lighten ? "white" : UbuntuColors.warmGrey30 color: UbuntuColors.darkGrey
32 }31 }
33 color: "transparent"32 color: "transparent"
34}33}
3534
=== modified file 'src/qml/DialerPage/DialerPage.qml'
--- src/qml/DialerPage/DialerPage.qml 2014-07-30 17:55:22 +0000
+++ src/qml/DialerPage/DialerPage.qml 2014-08-04 18:47:59 +0000
@@ -18,35 +18,34 @@
1818
19import QtContacts 5.019import QtContacts 5.0
20import QtQuick 2.020import QtQuick 2.0
21import Ubuntu.Components 0.121import Ubuntu.Components 1.1
22import Ubuntu.Components.Popups 0.122import Ubuntu.Components.Popups 0.1
23import Ubuntu.Telephony 0.123import Ubuntu.Telephony 0.1
24import Ubuntu.Contacts 0.1
24import Ubuntu.Components.ListItems 0.1 as ListItems25import Ubuntu.Components.ListItems 0.1 as ListItems
26
25import "../"27import "../"
2628
27PageWithBottomEdge {29PageWithBottomEdge {
28 id: page30 id: page
31
29 property alias dialNumber: keypadEntry.value32 property alias dialNumber: keypadEntry.value
30 property alias input: keypadEntry.input33 property alias input: keypadEntry.input
31 property bool multipleAccounts: telepathyHelper.accountIds.length > 134 property bool multipleAccounts: telepathyHelper.accountIds.length > 1
32 objectName: "dialerPage"35 objectName: "dialerPage"
3336
34 tools: ToolbarItems {37 head.actions: [
35 ToolbarButton {38 Action {
36 id: contactButton39 iconName: "contact"
37 objectName: "contactButton"40 text: i18n.tr("Contacts")
38 action: Action {41 onTriggered: pageStack.push(Qt.resolvedUrl("../ContactsPage/ContactsPage.qml"))
39 iconSource: "image://theme/contact"42 },
40 text: i18n.tr("Contacts")43 Action {
41 onTriggered: pageStack.push(Qt.resolvedUrl("../ContactsPage/ContactsPage.qml"))44 iconName: "settings"
42 }45 text: i18n.tr("Settings")
46 onTriggered: Qt.openUrlExternally("settings:///system/phone")
43 }47 }
44 }48 ]
45
46 ToolbarItems {
47 id: emptyToolbar
48 visible: false
49 }
5049
51 title: i18n.tr("Keypad")50 title: i18n.tr("Keypad")
5251
@@ -57,8 +56,8 @@
57 when: greeter.greeterActive56 when: greeter.greeterActive
5857
59 PropertyChanges {58 PropertyChanges {
60 target: page59 target: page.head
61 tools: emptyToolbar60 actions: []
62 }61 }
63 PropertyChanges {62 PropertyChanges {
64 target: contactLabel63 target: contactLabel
@@ -98,13 +97,15 @@
98 }97 }
9998
100 onIsReadyChanged: {99 onIsReadyChanged: {
101 bottomEdgePage.fullView = isReady;100 if (bottomEdgePage) {
101 bottomEdgePage.fullView = isReady
102 }
102 }103 }
103104
104 onDialNumberChanged: {105 onDialNumberChanged: {
105 if(checkUSSD(dialNumber)) {106 if(checkUSSD(dialNumber)) {
106 // check for custom strings107 // check for custom strings
107 if (dialNumber == "*#06#") {108 if (dialNumber === "*#06#") {
108 dialNumber = ""109 dialNumber = ""
109 mainView.ussdResponseTitle = "IMEI"110 mainView.ussdResponseTitle = "IMEI"
110 mainView.ussdResponseText = ussdManager.serial(mainView.account.accountId)111 mainView.ussdResponseText = ussdManager.serial(mainView.account.accountId)
@@ -113,6 +114,17 @@
113 }114 }
114 }115 }
115116
117 function accountIndex(account) {
118 var index = -1;
119 for (var i in telepathyHelper.accounts) {
120 if (telepathyHelper.accounts[i] == account) {
121 index = i;
122 break;
123 }
124 }
125 return index;
126 }
127
116 Connections {128 Connections {
117 target: mainView129 target: mainView
118 onPendingNumberToDialChanged: {130 onPendingNumberToDialChanged: {
@@ -121,6 +133,34 @@
121 mainView.switchToKeypadView();133 mainView.switchToKeypadView();
122 }134 }
123 }135 }
136 onAccountChanged: {
137 var newAccountIndex = accountIndex(account);
138 if (newAccountIndex >= 0 && newAccountIndex !== page.head.sections.selectedIndex) {
139 page.head.sections.selectedIndex = newAccountIndex
140 }
141 }
142 }
143
144 head.sections.model: {
145 // does not show dual sim switch if there is only one sim
146 if (!multipleAccounts) {
147 return undefined
148 }
149
150 var accountNames = []
151 for(var i=0; i < telepathyHelper.accounts.length; i++) {
152 accountNames.push(telepathyHelper.accounts[i].displayName)
153 }
154 return accountNames
155 }
156
157 // Account switcher
158 head.sections.selectedIndex: Math.max(0, accountIndex(mainView.account))
159 Connections {
160 target: page.head.sections
161 onSelectedIndexChanged: {
162 mainView.account = telepathyHelper.accounts[page.head.sections.selectedIndex]
163 }
124 }164 }
125165
126 FocusScope {166 FocusScope {
@@ -129,168 +169,90 @@
129 anchors.fill: parent169 anchors.fill: parent
130 focus: true170 focus: true
131171
132 // TODO replace by the sdk sections component when it's released172 Item {
133 Rectangle {173 id: entryWithButtons
134 id: accountList174
135 anchors {175 anchors {
136 left: parent.left
137 right: parent.right
138 top: parent.top176 top: parent.top
139 }177 left: parent.left
140 clip: !multipleAccounts178 right: parent.right
141 height: multipleAccounts ? childrenRect.height : 0179 }
142 z: 1180 height: units.gu(10)
143 color: "white"181
144 Row {182 CustomButton {
183 id: addContact
184
185 anchors {
186 left: parent.left
187 leftMargin: units.gu(2)
188 verticalCenter: parent.verticalCenter
189 }
190 width: units.gu(3)
191 height: (keypadEntry.value !== "" && contactWatcher.isUnknown) ? units.gu(3) : 0
192 icon: "contact-new"
193 iconWidth: units.gu(3)
194 iconHeight: units.gu(3)
195 opacity: (keypadEntry.value !== "" && contactWatcher.isUnknown) ? 1.0 : 0.0
196
197 Behavior on opacity {
198 UbuntuNumberAnimation { }
199 }
200
201 Behavior on width {
202 UbuntuNumberAnimation { }
203 }
204
205 onClicked: mainView.addNewPhone(keypadEntry.value)
206 }
207
208 KeypadEntry {
209 id: keypadEntry
210
145 anchors {211 anchors {
146 top: parent.top212 top: parent.top
147 horizontalCenter: parent.horizontalCenter213 topMargin: units.gu(3)
148 }214 left: addContact.right
149 height: childrenRect.height215 right: backspace.left
150 width: childrenRect.width216 }
151 spacing: units.gu(2)217 height: units.gu(4)
152 Repeater {218 focus: true
153 model: telepathyHelper.accounts219 placeHolder: i18n.tr("Enter a number")
154 delegate: Label {220 Keys.forwardTo: [callButton]
155 width: paintedWidth221 value: mainView.pendingNumberToDial
156 height: paintedHeight222 }
157 text: model.displayName223
158 font.pixelSize: FontUtils.sizeToPixels("small")224 CustomButton {
159 color: mainView.account == modelData ? "red" : "#5d5d5d"225 id: backspace
160 MouseArea {226 objectName: "eraseButton"
161 anchors {227 anchors {
162 fill: parent228 right: parent.right
163 // increase touch area229 rightMargin: units.gu(2)
164 leftMargin: units.gu(-1)230 verticalCenter: parent.verticalCenter
165 rightMargin: units.gu(-1)231 }
166 bottomMargin: units.gu(-1)232 width: units.gu(3)
167 topMargin: units.gu(-1)233 height: input.text !== "" ? units.gu(3) : 0
168 }234 icon: "erase"
169 onClicked: mainView.account = modelData235 iconWidth: units.gu(3)
170 z: 2236 iconHeight: units.gu(3)
171 }237 opacity: input.text !== "" ? 1 : 0
172 }238
173 }239 Behavior on opacity {
174 }240 UbuntuNumberAnimation { }
175 }241 }
176242
177 KeypadEntry {243 Behavior on width {
178 id: keypadEntry244 UbuntuNumberAnimation { }
179245 }
180 anchors {246
181 top: accountList.bottom247 onPressAndHold: input.text = ""
182 topMargin: units.gu(3)248
183 left: parent.left249 onClicked: {
184 right: backspace.left250 if (input.cursorPosition > 0) {
185 }251 input.remove(input.cursorPosition, input.cursorPosition - 1)
186252 }
187 focus: true253 }
188 placeHolder: i18n.tr("Enter a number")254 }
189 Keys.forwardTo: [callButton]255 }
190 value: mainView.pendingNumberToDial
191 }
192
193 CustomButton {
194 id: backspace
195 objectName: "eraseButton"
196 anchors {
197 right: parent.right
198 rightMargin: units.gu(2)
199 verticalCenter: keypadEntry.verticalCenter
200 }
201 width: input.text !== "" ? units.gu(3) : 0
202 height: units.gu(3)
203 icon: "erase"
204 iconWidth: units.gu(3)
205 iconHeight: units.gu(3)
206 opacity: input.text !== "" ? 1 : 0
207
208 Behavior on opacity {
209 UbuntuNumberAnimation { }
210 }
211
212 Behavior on width {
213 UbuntuNumberAnimation { }
214 }
215
216 onPressAndHold: input.text = ""
217
218 onClicked: {
219 if (input.cursorPosition > 0) {
220 input.remove(input.cursorPosition, input.cursorPosition - 1)
221 }
222 }
223 }
224
225 /*ContactSearchListView {
226 id: contactSearch
227 property string searchTerm: keypadEntry.value != "" ? keypadEntry.value : "some value that won't match"
228 anchors {
229 left: parent.left
230 right: parent.right
231 bottom: keypadEntryBackground.bottom
232 margins: units.gu(0.5)
233 }
234
235 states: [
236 State {
237 name: "empty"
238 when: contactSearch.count == 0
239 PropertyChanges {
240 target: contactSearch
241 height: 0
242 }
243 }
244 ]
245
246 Behavior on height {
247 UbuntuNumberAnimation { }
248 }
249
250 filter: UnionFilter {
251 DetailFilter {
252 detail: ContactDetail.Name
253 field: Name.FirstName
254 value: contactSearch.searchTerm
255 matchFlags: DetailFilter.MatchKeypadCollation | DetailFilter.MatchContains
256 }
257
258 DetailFilter {
259 detail: ContactDetail.Name
260 field: Name.LastName
261 value: contactSearch.searchTerm
262 matchFlags: DetailFilter.MatchContains | DetailFilter.MatchKeypadCollation
263 }
264
265 DetailFilter {
266 detail: ContactDetail.PhoneNumber
267 field: PhoneNumber.Number
268 value: contactSearch.searchTerm
269 matchFlags: DetailFilter.MatchPhoneNumber
270 }
271
272 DetailFilter {
273 detail: ContactDetail.PhoneNumber
274 field: PhoneNumber.Number
275 value: contactSearch.searchTerm
276 matchFlags: DetailFilter.MatchContains
277 }
278
279 }
280
281 // FIXME: uncomment this code if we end up having both the header and the toolbar.
282 onCountChanged: {
283 if (count > 0) {
284 page.header.hide();
285 } else {
286 page.header.show();
287 }
288 }
289
290 onDetailClicked: {
291 mainView.call(detail.number);
292 }
293 }*/
294256
295 ListItems.ThinDivider {257 ListItems.ThinDivider {
296 id: divider258 id: divider
@@ -300,8 +262,7 @@
300 leftMargin: units.gu(2)262 leftMargin: units.gu(2)
301 right: parent.right263 right: parent.right
302 rightMargin: units.gu(2)264 rightMargin: units.gu(2)
303 top: keypadEntry.bottom265 top: entryWithButtons.bottom
304 topMargin: units.gu(4)
305 }266 }
306 }267 }
307268
@@ -314,12 +275,13 @@
314 id: contactLabel275 id: contactLabel
315 anchors {276 anchors {
316 horizontalCenter: divider.horizontalCenter277 horizontalCenter: divider.horizontalCenter
317 bottom: divider.top278 bottom: entryWithButtons.bottom
318 bottomMargin: units.gu(1)279 bottomMargin: units.gu(1)
319 }280 }
320 text: contactWatcher.isUnknown ? "" : contactWatcher.alias281 text: contactWatcher.isUnknown ? "" : contactWatcher.alias
321 color: UbuntuColors.lightAubergine282 color: UbuntuColors.lightAubergine
322 opacity: text != "" ? 1 : 0283 opacity: text != "" ? 1 : 0
284 fontSize: "small"
323 Behavior on opacity {285 Behavior on opacity {
324 UbuntuNumberAnimation { }286 UbuntuNumberAnimation { }
325 }287 }
@@ -329,8 +291,8 @@
329 id: keypad291 id: keypad
330292
331 anchors {293 anchors {
332 bottom: footer.top294 top: divider.bottom
333 bottomMargin: units.gu(3)295 topMargin: units.gu(2)
334 horizontalCenter: parent.horizontalCenter296 horizontalCenter: parent.horizontalCenter
335 }297 }
336298
@@ -338,44 +300,79 @@
338 input.insert(input.cursorPosition, label)300 input.insert(input.cursorPosition, label)
339 }301 }
340 }302 }
341303 }
342 Item {304 Item {
343 id: footer305 id: footer
344306
345 anchors.left: parent.left307 anchors {
346 anchors.right: parent.right308 left: parent.left
347 anchors.bottom: parent.bottom309 right: parent.right
348 height: units.gu(10)310 bottom: parent.bottom
349311 }
350 CallButton {312 height: units.gu(10)
351 id: callButton313
352 objectName: "callButton"314 CallButton {
353 anchors.bottom: footer.bottom315 id: callButton
354 anchors.bottomMargin: units.gu(5)316 objectName: "callButton"
355 anchors.horizontalCenter: parent.horizontalCenter317 anchors {
356 onClicked: {318 bottom: footer.bottom
357 console.log("Starting a call to " + keypadEntry.value);319 bottomMargin: units.gu(5)
358 // avoid cleaning the keypadEntry in case there is no signal320 horizontalCenter: parent.horizontalCenter
359 if (!mainView.account.connected) {321 }
360 PopupUtils.open(noNetworkDialog)322 onClicked: {
361 return323 console.log("Starting a call to " + keypadEntry.value);
362 }324 // avoid cleaning the keypadEntry in case there is no signal
363 mainView.call(keypadEntry.value, mainView.account.accountId);325 if (!mainView.account.connected) {
364 keypadEntry.value = "";326 PopupUtils.open(noNetworkDialog)
365 }327 return
366 enabled: {328 }
367 if (dialNumber == "") {329 callAnimation.start()
368 return false;330 }
369 }331 enabled: {
370332 if (dialNumber == "") {
371 if (greeter.greeterActive) {333 return false;
372 return mainView.isEmergencyNumber(dialNumber);334 }
373 }335
374336 if (greeter.greeterActive) {
375 return true;337 return mainView.isEmergencyNumber(dialNumber);
376 }338 }
377 }339
378340 return true;
341 }
342 }
343 }
344
345 SequentialAnimation {
346 id: callAnimation
347
348 PropertyAction {
349 target: callButton
350 property: "color"
351 value: "red"
352 }
353
354 ParallelAnimation {
355 UbuntuNumberAnimation {
356 target: keypadContainer
357 property: "opacity"
358 to: 0.0
359 duration: UbuntuAnimation.SlowDuration
360 }
361 UbuntuNumberAnimation {
362 target: callButton
363 property: "iconRotation"
364 to: -90.0
365 duration: UbuntuAnimation.SlowDuration
366 }
367 }
368 ScriptAction {
369 script: {
370 mainView.call(keypadEntry.value, mainView.account.accountId);
371 keypadEntry.value = ""
372 callButton.iconRotation = 0.0
373 keypadContainer.opacity = 1.0
374 callButton.color = callButton.defaultColor
375 }
379 }376 }
380 }377 }
381}378}
382379
=== modified file 'src/qml/DialerPage/Keypad.qml'
--- src/qml/DialerPage/Keypad.qml 2014-05-23 08:30:55 +0000
+++ src/qml/DialerPage/Keypad.qml 2014-08-04 18:47:59 +0000
@@ -17,13 +17,13 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
21import Ubuntu.Components.ListItems 0.1 as ListItems21import Ubuntu.Components.ListItems 0.1 as ListItems
2222
23Item {23Item {
24 id: keypad24 id: keypad
2525
26 property int keysWidth: units.gu(13)26 property int keysWidth: units.gu(11)
27 property int keysHeight: units.gu(8)27 property int keysHeight: units.gu(8)
2828
29 width: keys.width29 width: keys.width
@@ -36,6 +36,8 @@
3636
37 rows: 437 rows: 4
38 columns: 338 columns: 3
39 columnSpacing: units.gu(2.0)
40 rowSpacing: units.gu(0.5)
39 anchors.centerIn: parent41 anchors.centerIn: parent
4042
41 KeypadButton {43 KeypadButton {
4244
=== modified file 'src/qml/DialerPage/KeypadButton.qml'
--- src/qml/DialerPage/KeypadButton.qml 2014-06-10 17:29:13 +0000
+++ src/qml/DialerPage/KeypadButton.qml 2014-08-04 18:47:59 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
2121
22AbstractButton {22AbstractButton {
23 id: button23 id: button
@@ -33,6 +33,17 @@
33 property bool isCorner: false33 property bool isCorner: false
34 property int corner34 property int corner
3535
36 UbuntuShape {
37 anchors.fill: parent
38 opacity: button.pressed ? 1 : 0
39
40 Behavior on opacity {
41 UbuntuNumberAnimation {
42 duration: UbuntuAnimation.BriskDuration
43 }
44 }
45 }
46
36 Item {47 Item {
37 height: childrenRect.height48 height: childrenRect.height
38 width: parent.width49 width: parent.width
@@ -46,18 +57,6 @@
46 }57 }
47 }58 }
4859
49 Rectangle {
50 anchors.fill: parent
51 color: Qt.rgba(0, 0, 0, 0.15)
52 opacity: button.pressed ? 1 : 0
53
54 Behavior on opacity {
55 UbuntuNumberAnimation {
56 duration: UbuntuAnimation.BriskDuration
57 }
58 }
59 }
60
61 Label {60 Label {
62 id: labelItem61 id: labelItem
6362
@@ -65,10 +64,10 @@
65 anchors.horizontalCenter: parent.horizontalCenter64 anchors.horizontalCenter: parent.horizontalCenter
66 anchors.verticalCenterOffset: -units.gu(0.5)65 anchors.verticalCenterOffset: -units.gu(0.5)
67 horizontalAlignment: Text.AlignHCenter66 horizontalAlignment: Text.AlignHCenter
68 fontSize: "large"
69 height: paintedHeight67 height: paintedHeight
70 font.weight: Font.DemiBold68 font.pixelSize: units.dp(30)
71 verticalAlignment: Text.AlignTop69 verticalAlignment: Text.AlignTop
70 color: UbuntuColors.darkGrey
72 }71 }
7372
74 Label {73 Label {
@@ -79,6 +78,7 @@
79 anchors.horizontalCenter: parent.horizontalCenter78 anchors.horizontalCenter: parent.horizontalCenter
80 horizontalAlignment: Text.AlignHCenter79 horizontalAlignment: Text.AlignHCenter
81 fontSize: "x-small"80 fontSize: "x-small"
81 color: UbuntuColors.darkGrey
82 }82 }
8383
84 Icon {84 Icon {
8585
=== modified file 'src/qml/DialerPage/KeypadEntry.qml'
--- src/qml/DialerPage/KeypadEntry.qml 2014-07-14 23:17:06 +0000
+++ src/qml/DialerPage/KeypadEntry.qml 2014-08-04 18:47:59 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
21import Ubuntu.Components.ListItems 0.1 as ListItems21import Ubuntu.Components.ListItems 0.1 as ListItems
22import Ubuntu.Telephony.PhoneNumber 0.122import Ubuntu.Telephony.PhoneNumber 0.1
2323
@@ -29,28 +29,48 @@
29 property alias placeHolder: hint.text29 property alias placeHolder: hint.text
30 property alias placeHolderPixelFontSize: hint.font.pixelSize30 property alias placeHolderPixelFontSize: hint.font.pixelSize
3131
32 height: input.height
3332
34 PhoneNumberInput {33 PhoneNumberInput {
35 id: input34 id: input
3635
37 property bool __adjusting: false36 property bool __adjusting: false
3837 readonly property double maximumFontSize: units.dp(30)
39 anchors.left: parent.left38 readonly property double minimumFontSize: FontUtils.sizeToPixels("large")
40 anchors.leftMargin: units.gu(2)39
41 anchors.right: parent.right40 function adjustTextSize()
42 anchors.rightMargin: units.gu(2)41 {
43 anchors.verticalCenter: parent.verticalCenter42 // avoid infinite recursion here
44 horizontalAlignment: TextInput.AlignHCenter43 if (__adjusting) {
45 font.pixelSize: units.dp(39)44 return;
46 font.weight: Font.Light45 }
46
47 __adjusting = true;
48
49 // start by resetting the font size to discover the scale that should be used
50 font.pixelSize = maximumFontSize
51
52 // check if it really needs to be scaled
53 if (contentWidth > width) {
54 var factor = width / contentWidth;
55 font.pixelSize = Math.max(font.pixelSize * factor, minimumFontSize);
56 }
57 __adjusting = false
58 }
59
60 anchors {
61 left: parent.left
62 leftMargin: units.gu(2)
63 right: parent.right
64 rightMargin: units.gu(2)
65 verticalCenter: parent.verticalCenter
66 }
67 horizontalAlignment: (text.length < 19 ? TextInput.AlignHCenter : TextInput.AlignRight)
68 font.pixelSize: maximumFontSize
47 font.family: "Ubuntu"69 font.family: "Ubuntu"
48 color: "#AAAAAA"70 color: UbuntuColors.darkGrey
49 maximumLength: 20
50 focus: true71 focus: true
51 cursorVisible: true72 cursorVisible: true
52 clip: true73 clip: true
53 opacity: 0.9
54 defaultRegion: PhoneUtils.defaultRegion74 defaultRegion: PhoneUtils.defaultRegion
55 updateOnlyWhenFocused: false75 updateOnlyWhenFocused: false
56 // FIXME: this should probably be done in the component itself76 // FIXME: this should probably be done in the component itself
@@ -63,7 +83,7 @@
63 anchors.bottom: parent.bottom83 anchors.bottom: parent.bottom
64 width: units.dp(3)84 width: units.dp(3)
65 color: "#DD4814"85 color: "#DD4814"
66 visible: input.text != ""86 visible: input.text !== ""
67 }87 }
6888
69 // force cursor to be always visible89 // force cursor to be always visible
@@ -72,24 +92,7 @@
72 cursorVisible = true92 cursorVisible = true
73 }93 }
7494
75 onContentWidthChanged: {95 onContentWidthChanged: adjustTextSize()
76 // avoid infinite recursion here
77 if (__adjusting) {
78 return;
79 }
80
81 __adjusting = true;
82
83 // start by resetting the font size to discover the scale that should be used
84 font.pixelSize = units.dp(39);
85
86 // check if it really needs to be scaled
87 if (contentWidth > width) {
88 var factor = width / contentWidth;
89 font.pixelSize = font.pixelSize * factor;
90 }
91 __adjusting = false;
92 }
93 }96 }
9497
95 MouseArea {98 MouseArea {
@@ -99,7 +102,7 @@
99 input.cursorPosition = input.positionAt(mouseX,TextInput.CursorOnCharacter)102 input.cursorPosition = input.positionAt(mouseX,TextInput.CursorOnCharacter)
100 }103 }
101 onPressAndHold: {104 onPressAndHold: {
102 if (input.text != "") {105 if (input.text !== "") {
103 held = true106 held = true
104 input.selectAll()107 input.selectAll()
105 input.copy()108 input.copy()
@@ -112,20 +115,16 @@
112 input.deselect()115 input.deselect()
113 held = false116 held = false
114 }117 }
115
116 }118 }
117 }119 }
118120
119 Label {121 Label {
120 id: hint122 id: hint
121 visible: input.text == ""123 visible: input.text === ""
122 anchors.centerIn: input124 anchors.centerIn: parent
123 text: ""125 text: ""
124 fontSize: "x-large"126 font.pixelSize: input.maximumFontSize
125 font.weight: Font.Light127 color: UbuntuColors.darkGrey
126 font.family: "Ubuntu"
127 color: "#464646"
128 opacity: 0.9128 opacity: 0.9
129 }129 }
130
131}130}
132131
=== modified file 'src/qml/HistoryPage/ExpandableButton.qml'
--- src/qml/HistoryPage/ExpandableButton.qml 2013-10-10 17:36:08 +0000
+++ src/qml/HistoryPage/ExpandableButton.qml 2014-08-04 18:47:59 +0000
@@ -15,7 +15,7 @@
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.0
18import Ubuntu.Components 0.118import Ubuntu.Components 1.1
19import Ubuntu.Components.ListItems 0.1 as ListItem19import Ubuntu.Components.ListItems 0.1 as ListItem
2020
21ListItem.Empty {21ListItem.Empty {
2222
=== modified file 'src/qml/HistoryPage/HistoryDelegate.qml'
--- src/qml/HistoryPage/HistoryDelegate.qml 2014-07-30 17:55:22 +0000
+++ src/qml/HistoryPage/HistoryDelegate.qml 2014-08-04 18:47:59 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
21import Ubuntu.Components.ListItems 0.1 as ListItem21import Ubuntu.Components.ListItems 0.1 as ListItem
22import Ubuntu.Components.Popups 0.122import Ubuntu.Components.Popups 0.1
23import Ubuntu.Telephony 0.123import Ubuntu.Telephony 0.1
@@ -37,8 +37,8 @@
3737
38 property string phoneNumberSubTypeLabel: ""38 property string phoneNumberSubTypeLabel: ""
39 property bool isFirst: false39 property bool isFirst: false
40 property bool selected: false
41 property bool fullView: false40 property bool fullView: false
41 property bool active: false
4242
43 function activate() {43 function activate() {
44 // ignore private and unknown numbers44 // ignore private and unknown numbers
@@ -63,8 +63,8 @@
63 }63 }
64 }64 }
6565
66 height: units.gu(8)
66 color: Theme.palette.normal.background67 color: Theme.palette.normal.background
67 height: mainSection.height
68 triggerActionOnMouseRelease: true68 triggerActionOnMouseRelease: true
6969
70 states: [70 states: [
@@ -90,21 +90,18 @@
90 }90 }
91 ]91 ]
9292
93
94 Rectangle {
95 anchors.fill: parent
96 color: "black"
97 opacity: historyDelegate.selected ? 0.2 : 0
98 Behavior on opacity {
99 UbuntuNumberAnimation { }
100 }
101 }
102
103 Item {93 Item {
104 id: helper94 id: helper
10595
106 function updateSubTypeLabel() {96 function updateSubTypeLabel() {
107 phoneNumberSubTypeLabel = contactWatcher.isUnknown ? model.participants[0] : phoneTypeModel.get(phoneTypeModel.getTypeIndex(phoneDetail)).label97 var subLabel = contactWatcher.isUnknown
98 if (model.participants[0]) {
99 var typeInfo = phoneTypeModel.get(phoneTypeModel.getTypeIndex(phoneDetail))
100 if (typeInfo) {
101 subLabel = typeInfo.label
102 }
103 }
104 phoneNumberSubTypeLabel = subLabel
108 }105 }
109106
110 Component.onCompleted: updateSubTypeLabel()107 Component.onCompleted: updateSubTypeLabel()
@@ -130,96 +127,96 @@
130 }127 }
131 }128 }
132129
133 Item {130 Rectangle {
134 id: mainSection131 anchors {
132 fill: parent
133 topMargin: units.gu(-1)
134 bottomMargin: units.gu(-1)
135 leftMargin: units.gu(-2)
136 rightMargin: units.gu(-2)
137 }
138 opacity: historyDelegate.active ? 0.2 : 0.0
139 color: "black"
140 Behavior on opacity {
141 UbuntuNumberAnimation {}
142 }
143 }
135144
145 ContactAvatar {
146 id: avatar
136 anchors {147 anchors {
137 left: parent.left148 left: parent.left
138 right: parent.right149 top: parent.top
139 top: parent.top150 bottom: parent.bottom
140 }151 }
141 height: units.gu(8)152 width: height
142153 fallbackAvatarUrl: contactWatcher.avatar === "" ? "image://theme/stock_contact" : contactWatcher.avatar
143 ContactAvatar {154 fallbackDisplayName: contactWatcher.alias !== "" ? contactWatcher.alias : contactWatcher.phoneNumber
144 id: avatar155 showAvatarPicture: (fallbackAvatarUrl != "image://theme/stock_contact") || (initials.length === 0)
145 anchors.left: parent.left156 }
146 anchors.leftMargin: units.gu(1)157
147 anchors.verticalCenter: parent.verticalCenter158 Label {
148 height: units.gu(6)159 id: titleLabel
149 width: height160 anchors {
150 fallbackAvatarUrl: contactWatcher.avatar === "" ? "image://theme/stock_contact" : contactWatcher.avatar161 top: parent.top
151 fallbackDisplayName: contactWatcher.alias !== "" ? contactWatcher.alias : contactWatcher.phoneNumber162 left: avatar.right
152 showAvatarPicture: (fallbackAvatarUrl != "image://theme/stock_contact") || (initials.length === 0)163 leftMargin: units.gu(2)
153 }164 right: time.left
154165 }
155 Label {166 height: units.gu(2)
156 id: titleLabel167 verticalAlignment: Text.AlignVCenter
157 anchors {168 fontSize: "medium"
158 top: parent.top169 text: {
159 topMargin: units.gu(2)170 if (contactWatcher.phoneNumber == "x-ofono-private") {
160 left: avatar.right171 return i18n.tr("Private number")
161 leftMargin: units.gu(2)172 } else if (contactWatcher.phoneNumber == "x-ofono-unknown") {
162 right: time.left173 return i18n.tr("Unknown number")
163 rightMargin: units.gu(1)174 } else if (contactWatcher.alias != "") {
164 }175 return contactWatcher.alias
165 height: units.gu(2)176 }
166 verticalAlignment: Text.AlignVCenter177 return PhoneUtils.PhoneUtils.format(contactWatcher.phoneNumber)
167 fontSize: "medium"178 }
168 text: {179 elide: Text.ElideRight
169 if (contactWatcher.phoneNumber == "x-ofono-private") {180 color: UbuntuColors.lightAubergine
170 return i18n.tr("Private number")181 }
171 } else if (contactWatcher.phoneNumber == "x-ofono-unknown") {182
172 return i18n.tr("Unknown number")183 Label {
173 } else if (contactWatcher.alias != "") {184 id: phoneLabel
174 return contactWatcher.alias185 anchors {
175 }186 bottom: parent.bottom
176 return PhoneUtils.PhoneUtils.format(contactWatcher.phoneNumber)187 left: avatar.right
177 }188 leftMargin: units.gu(2)
178 elide: Text.ElideRight189 }
179 color: UbuntuColors.lightAubergine190 height: units.gu(2)
180 }191 verticalAlignment: Text.AlignVCenter
181192 fontSize: "small"
182 Label {193 // FIXME: handle conference call
183 id: phoneLabel194 text: phoneNumberSubTypeLabel
184 anchors {195 visible: interactive && !contactWatcher.isUnknown // non-interactive entries are calls from unknown or private numbers
185 bottom: parent.bottom196 }
186 bottomMargin: units.gu(2)197
187 left: avatar.right198 // time and duration on the right side of the delegate
188 leftMargin: units.gu(2)199 Label {
189 }200 id: time
190 height: units.gu(2)201 anchors {
191 verticalAlignment: Text.AlignVCenter202 right: parent.right
192 fontSize: "small"203 verticalCenter: titleLabel.verticalCenter
193 // FIXME: handle conference call204 }
194 text: phoneNumberSubTypeLabel205 height: units.gu(2)
195 visible: interactive && !contactWatcher.isUnknown // non-interactive entries are calls from unknown or private numbers206 verticalAlignment: Text.AlignVCenter
196 }207 fontSize: "small"
197208 text: Qt.formatTime(model.timestamp, "hh:mm")
198 // time and duration on the right side of the delegate209 }
199 Label {210
200 id: time211 Label {
201 anchors {212 id: callType
202 right: parent.right213 anchors {
203 rightMargin: units.gu(2)214 right: parent.right
204 verticalCenter: titleLabel.verticalCenter215 verticalCenter: phoneLabel.verticalCenter
205 }216 }
206 height: units.gu(2)217 height: units.gu(2)
207 verticalAlignment: Text.AlignVCenter218 verticalAlignment: Text.AlignVCenter
208 fontSize: "small"219 fontSize: "small"
209 text: Qt.formatTime(model.timestamp, "hh:mm")220 text: selectCallType()
210 }
211
212 Label {
213 id: callType
214 anchors {
215 right: parent.right
216 rightMargin: units.gu(2)
217 verticalCenter: phoneLabel.verticalCenter
218 }
219 height: units.gu(2)
220 verticalAlignment: Text.AlignVCenter
221 fontSize: "small"
222 text: selectCallType()
223 }
224 }221 }
225}222}
226223
=== modified file 'src/qml/HistoryPage/HistoryPage.qml'
--- src/qml/HistoryPage/HistoryPage.qml 2014-07-25 18:49:29 +0000
+++ src/qml/HistoryPage/HistoryPage.qml 2014-08-04 18:47:59 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
21import Ubuntu.Components.ListItems 0.1 as ListItem21import Ubuntu.Components.ListItems 0.1 as ListItem
22import Ubuntu.History 0.122import Ubuntu.History 0.1
23import Ubuntu.Telephony 0.123import Ubuntu.Telephony 0.1
@@ -48,47 +48,47 @@
48 anchors.fill: parent48 anchors.fill: parent
49 color: Theme.palette.normal.background49 color: Theme.palette.normal.background
50 }50 }
51 states: [
52 PageHeadState {
53 name: "select"
54 when: selectionMode
55 head: historyPage.head
5156
52 ToolbarItems {57 backAction: Action {
53 id: historySelectionToolbar
54 visible: false
55 back: ToolbarButton {
56 id: selectionModeCancelButton
57 objectName: "selectionModeCancelButton"
58 action: Action {
59 objectName: "selectionModeCancelAction"58 objectName: "selectionModeCancelAction"
60 iconName: "close"59 iconName: "close"
61 onTriggered: historyList.cancelSelection()60 onTriggered: historyList.cancelSelection()
62 }61 }
63 }62
64 ToolbarButton {63 actions: [
65 id: selectionModeSelectAllButton64 Action {
66 objectName: "selectionModeSelectAllButton"65 objectName: "selectionModeSelectAllAction"
67 action: Action {66 iconName: "select"
68 objectName: "selectionModeSelectAllAction"67 onTriggered: {
69 iconName: "filter"68 if (historyList.selectedItems.count === historyList.count) {
70 onTriggered: historyList.selectAll()69 historyList.clearSelection()
71 }70 } else {
72 }71 historyList.selectAll()
73 ToolbarButton {72 }
74 id: selectionModeDeleteButton73 }
75 objectName: "selectionModeDeleteButton"74 },
76 action: Action {75 Action {
77 objectName: "selectionModeDeleteAction"76 objectName: "selectionModeDeleteAction"
78 enabled: historyList.selectedItems.count > 077 enabled: historyList.selectedItems.count > 0
79 iconName: "delete"78 iconName: "delete"
80 onTriggered: historyList.endSelection()79 onTriggered: historyList.endSelection()
81 }80 }
82 }81 ]
83 }82 }
8483 ]
85 tools: selectionMode ? historySelectionToolbar : null84
86 onActiveChanged: {85 onActiveChanged: {
87 if (!active) {86 if (!active) {
88 if (selectionMode) {87 if (selectionMode) {
89 historyList.cancelSelection();88 historyList.cancelSelection();
90 }89 }
91 historyList.resetSwipe()90 historyList.resetSwipe()
91 historyList.positionViewAtBeginning()
92 }92 }
9393
94 }94 }
@@ -202,10 +202,12 @@
202 right: parent.right202 right: parent.right
203 }203 }
204204
205 selected: historyDelegate.ListView.isCurrentItem || historyList.isSelected(historyDelegate)205 selected: historyList.isSelected(historyDelegate)
206 selectionMode: historyList.isInSelectionMode
206 isFirst: model.index === 0207 isFirst: model.index === 0
207 locked: historyList.isInSelectionMode208 locked: historyList.isInSelectionMode
208 fullView: historyPage.fullView209 fullView: historyPage.fullView
210 active: ListView.isCurrentItem
209211
210 // Animate item removal212 // Animate item removal
211 ListView.onRemove: SequentialAnimation {213 ListView.onRemove: SequentialAnimation {
212214
=== modified file 'src/qml/HistoryPage/Timeline.qml'
--- src/qml/HistoryPage/Timeline.qml 2013-10-09 14:46:13 +0000
+++ src/qml/HistoryPage/Timeline.qml 2014-08-04 18:47:59 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
2121
22Item {22Item {
23 property bool isFirst: false23 property bool isFirst: false
2424
=== modified file 'src/qml/LiveCallPage/ConferenceCallDisplay.qml'
--- src/qml/LiveCallPage/ConferenceCallDisplay.qml 2014-03-07 21:11:59 +0000
+++ src/qml/LiveCallPage/ConferenceCallDisplay.qml 2014-08-04 18:47:59 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
21import Ubuntu.Components.ListItems 0.1 as ListItem21import Ubuntu.Components.ListItems 0.1 as ListItem
22import Ubuntu.Telephony 0.122import Ubuntu.Telephony 0.1
2323
2424
=== modified file 'src/qml/LiveCallPage/HangupButton.qml'
--- src/qml/LiveCallPage/HangupButton.qml 2014-05-23 08:30:55 +0000
+++ src/qml/LiveCallPage/HangupButton.qml 2014-08-04 18:47:59 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
2121
22AbstractButton {22AbstractButton {
23 id: button23 id: button
2424
=== modified file 'src/qml/LiveCallPage/LiveCall.qml'
--- src/qml/LiveCallPage/LiveCall.qml 2014-06-25 19:34:44 +0000
+++ src/qml/LiveCallPage/LiveCall.qml 2014-08-04 18:47:59 +0000
@@ -18,7 +18,7 @@
1818
19import QtQuick 2.019import QtQuick 2.0
20import QtGraphicalEffects 1.020import QtGraphicalEffects 1.0
21import Ubuntu.Components 0.121import Ubuntu.Components 1.1
22import Ubuntu.Components.ListItems 0.1 as ListItems22import Ubuntu.Components.ListItems 0.1 as ListItems
23import Ubuntu.Telephony 0.123import Ubuntu.Telephony 0.1
24import Ubuntu.Contacts 0.124import Ubuntu.Contacts 0.1
@@ -40,43 +40,36 @@
40 property bool isVoicemail: call ? call.voicemail : false40 property bool isVoicemail: call ? call.voicemail : false
41 property string phoneNumberSubTypeLabel: ""41 property string phoneNumberSubTypeLabel: ""
42 property string caller: {42 property string caller: {
43 if (contactWatcher.alias != "") {43 if (contactWatcher.alias !== "") {
44 return contactWatcher.alias;44 return contactWatcher.alias;
45 } else if (contactWatcher.phoneNumber !== "") {
46 return contactWatcher.phoneNumber;
45 } else {47 } else {
46 return contactWatcher.phoneNumber;48 return "Calling..."
47 }49 }
48 }50 }
49 title: caller //i18n.tr("Call")51
50 ToolbarItems {52 property list<Action> regularActions: [
51 id: regularToolbar53 Action {
52 visible: false54 objectName: "fakeBackButton"
53 back: ToolbarButton {55 visible: false
54 action: Action {56 },
55 objectName: "fakeBackButton"57 Action {
56 }
57 }
58 ToolbarButton {
59 objectName: "newCallButton"58 objectName: "newCallButton"
60 action: Action {59 iconName: "contact"
61 iconName: "contact"60 text: i18n.tr("New Call")
62 text: i18n.tr("New Call")61 onTriggered: pageStack.push(Qt.resolvedUrl("../ContactsPage/ContactsPage.qml"))
63 onTriggered: pageStack.push(Qt.resolvedUrl("../ContactsPage/ContactsPage.qml"))62 }
64 }63 ]
65 }64 property list<Action> greeterModeActions: [
66 }65 Action {
6766 objectName: "fakeBackButton"
68 ToolbarItems {67 visible: false
69 id: greeterModeToolbar68 }
70 visible: false69 ]
71 back: ToolbarButton {70
72 action: Action {71 title: caller
73 objectName: "fakeBackButton"72 head.actions: greeter.greeterActive ? greeterModeActions : regularActions
74 }
75 }
76 }
77
78 tools: greeter.greeterActive ? greeterModeToolbar : regularToolbar
79
80 x: header ? header.height : 073 x: header ? header.height : 0
8174
82 // if there are no calls, just reset the view75 // if there are no calls, just reset the view
@@ -303,7 +296,6 @@
303 id: keypad296 id: keypad
304297
305 anchors.bottom: parent.bottom298 anchors.bottom: parent.bottom
306 anchors.bottomMargin: units.gu(2)
307 anchors.horizontalCenter: parent.horizontalCenter299 anchors.horizontalCenter: parent.horizontalCenter
308 onKeyPressed: {300 onKeyPressed: {
309 if (call) {301 if (call) {
@@ -324,7 +316,7 @@
324 anchors {316 anchors {
325 horizontalCenter: parent.horizontalCenter317 horizontalCenter: parent.horizontalCenter
326 bottom: footer.top318 bottom: footer.top
327 bottomMargin: units.gu(2)319 bottomMargin: units.gu(1)
328 }320 }
329321
330 LiveCallKeypadButton {322 LiveCallKeypadButton {
331323
=== modified file 'src/qml/LiveCallPage/LiveCallKeypadButton.qml'
--- src/qml/LiveCallPage/LiveCallKeypadButton.qml 2014-05-20 08:17:35 +0000
+++ src/qml/LiveCallPage/LiveCallKeypadButton.qml 2014-08-04 18:47:59 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
2121
22AbstractButton {22AbstractButton {
23 id: button23 id: button
2424
=== modified file 'src/qml/LiveCallPage/MultiCallDisplay.qml'
--- src/qml/LiveCallPage/MultiCallDisplay.qml 2014-04-08 19:56:50 +0000
+++ src/qml/LiveCallPage/MultiCallDisplay.qml 2014-08-04 18:47:59 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
21import Ubuntu.Telephony 0.121import Ubuntu.Telephony 0.1
2222
23Column {23Column {
2424
=== modified file 'src/qml/LiveCallPage/StopWatch.qml'
--- src/qml/LiveCallPage/StopWatch.qml 2014-05-20 08:17:35 +0000
+++ src/qml/LiveCallPage/StopWatch.qml 2014-08-04 18:47:59 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
2121
22Item {22Item {
23 function pad(text, length) {23 function pad(text, length) {
2424
=== removed file 'src/qml/PageWithBottomEdge.qml'
--- src/qml/PageWithBottomEdge.qml 2014-07-11 18:48:12 +0000
+++ src/qml/PageWithBottomEdge.qml 1970-01-01 00:00:00 +0000
@@ -1,434 +0,0 @@
1/*
2 * Copyright (C) 2014 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17/*
18 Example:
19
20 MainView {
21 objectName: "mainView"
22
23 applicationName: "com.ubuntu.developer.boiko.bottomedge"
24
25 width: units.gu(100)
26 height: units.gu(75)
27
28 Component {
29 id: pageComponent
30
31 PageWithBottomEdge {
32 id: mainPage
33 title: i18n.tr("Main Page")
34
35 Rectangle {
36 anchors.fill: parent
37 color: "white"
38 }
39
40 bottomEdgePageComponent: Page {
41 title: "Contents"
42 anchors.fill: parent
43 //anchors.topMargin: contentsPage.flickable.contentY
44
45 ListView {
46 anchors.fill: parent
47 model: 50
48 delegate: ListItems.Standard {
49 text: "One Content Item: " + index
50 }
51 }
52 }
53 bottomEdgeTitle: i18n.tr("Bottom edge action")
54 }
55 }
56
57 PageStack {
58 id: stack
59 Component.onCompleted: stack.push(pageComponent)
60 }
61 }
62
63*/
64
65import QtQuick 2.0
66import Ubuntu.Components 0.1
67
68Page {
69 id: page
70
71 property alias bottomEdgePageComponent: edgeLoader.sourceComponent
72 property alias bottomEdgePageSource: edgeLoader.source
73 property alias bottomEdgeTitle: tipLabel.text
74 property alias bottomEdgeEnabled: bottomEdge.visible
75 property int bottomEdgeExpandThreshold: page.height * 0.2
76 property int bottomEdgeExposedArea: bottomEdge.state !== "expanded" ? (page.height - bottomEdge.y - bottomEdge.tipHeight) : _areaWhenExpanded
77 property bool reloadBottomEdgePage: true
78
79 readonly property alias bottomEdgePage: edgeLoader.item
80 readonly property bool isReady: (tip.opacity === 0.0) && (bottomEdge.y === bottomEdge.pageStartY)
81 readonly property bool isCollapsed: (tip.opacity === 1.0)
82 readonly property bool bottomEdgePageLoaded: (edgeLoader.status == Loader.Ready)
83
84 property bool _showEdgePageWhenReady: false
85 property int _areaWhenExpanded: 0
86
87 signal bottomEdgeReleased()
88 signal bottomEdgeDismissed()
89
90
91 function showBottomEdgePage(source, properties)
92 {
93 edgeLoader.setSource(source, properties)
94 _showEdgePageWhenReady = true
95 }
96
97 function setBottomEdgePage(source, properties)
98 {
99 edgeLoader.setSource(source, properties)
100 }
101
102 function _pushPage()
103 {
104 if (edgeLoader.status === Loader.Ready) {
105 edgeLoader.item.active = true
106 page.pageStack.push(edgeLoader.item)
107 if (edgeLoader.item.flickable) {
108 edgeLoader.item.flickable.contentY = -page.header.height
109 edgeLoader.item.flickable.returnToBounds()
110 }
111
112 if (edgeLoader.item.ready)
113 edgeLoader.item.ready()
114 }
115 }
116
117
118 Component.onCompleted: {
119 // avoid a binding on the expanded height value
120 var expandedHeight = height;
121 _areaWhenExpanded = expandedHeight;
122 }
123
124 onActiveChanged: {
125 if (active) {
126 bottomEdge.state = "collapsed"
127 }
128 }
129
130 onBottomEdgePageLoadedChanged: {
131 if (_showEdgePageWhenReady && bottomEdgePageLoaded) {
132 bottomEdge.state = "expanded"
133 _showEdgePageWhenReady = false
134 }
135 }
136
137 Rectangle {
138 id: bgVisual
139
140 color: "black"
141 anchors.fill: page
142 opacity: 0.7 * ((page.height - bottomEdge.y) / page.height)
143 z: 1
144 }
145
146 Timer {
147 id: hideIndicator
148
149 interval: 3000
150 running: true
151 repeat: false
152 onTriggered: tipContainer.y = -units.gu(1)
153 }
154
155 Rectangle {
156 id: bottomEdge
157 objectName: "bottomEdge"
158
159 readonly property int tipHeight: units.gu(3)
160 readonly property var header: page.__propagated && page.__propagated.header ? page.__propagated.header : null
161 readonly property int pageStartY: 0
162
163 z: 1
164 color: Theme.palette.normal.background
165 parent: page
166 anchors {
167 left: parent.left
168 right: parent.right
169 }
170 height: page.height
171 y: height
172
173 Rectangle {
174 id: shadow
175
176 anchors {
177 left: parent.left
178 right: parent.right
179 }
180 height: units.gu(1)
181 y: -height
182 opacity: 0.0
183 gradient: Gradient {
184 GradientStop { position: 0.0; color: "transparent" }
185 GradientStop { position: 1.0; color: Qt.rgba(0, 0, 0, 0.2) }
186 }
187 }
188
189 Item {
190 id: tipContainer
191 objectName: "bottomEdgeTip"
192
193 width: childrenRect.width
194 height: bottomEdge.tipHeight
195 clip: true
196 y: -bottomEdge.tipHeight
197 anchors.horizontalCenter: parent.horizontalCenter
198 Behavior on y {
199 UbuntuNumberAnimation {}
200 }
201
202 UbuntuShape {
203 id: tip
204
205 width: tipLabel.paintedWidth + units.gu(6)
206 height: bottomEdge.tipHeight + units.gu(1)
207 color: Theme.palette.normal.overlay
208 Label {
209 id: tipLabel
210
211 anchors {
212 top: parent.top
213 left: parent.left
214 right: parent.right
215 }
216 height: bottomEdge.tipHeight
217 verticalAlignment: Text.AlignVCenter
218 horizontalAlignment: Text.AlignHCenter
219 }
220 }
221 }
222
223 MouseArea {
224 preventStealing: true
225 drag.axis: Drag.YAxis
226 drag.target: bottomEdge
227 drag.minimumY: bottomEdge.pageStartY
228 drag.maximumY: page.height
229
230 anchors {
231 left: parent.left
232 right: parent.right
233 }
234 height: bottomEdge.tipHeight
235 y: -height
236
237 onReleased: {
238 page.bottomEdgeReleased()
239 if (bottomEdge.y < (page.height - bottomEdgeExpandThreshold - bottomEdge.tipHeight)) {
240 bottomEdge.state = "expanded"
241 } else {
242 bottomEdge.state = "collapsed"
243 bottomEdge.y = bottomEdge.height
244 }
245 }
246
247 onPressed: bottomEdge.state = "floating"
248 }
249
250 Behavior on y {
251 UbuntuNumberAnimation {}
252 }
253
254 state: "collapsed"
255 states: [
256 State {
257 name: "collapsed"
258 PropertyChanges {
259 target: bottomEdge
260 y: bottomEdge.height
261 }
262 PropertyChanges {
263 target: tip
264 opacity: 1.0
265 }
266 PropertyChanges {
267 target: tipContainer
268 y: -bottomEdge.tipHeight
269 }
270 PropertyChanges {
271 target: hideIndicator
272 running: true
273 }
274 },
275 State {
276 name: "expanded"
277 PropertyChanges {
278 target: bottomEdge
279 y: bottomEdge.pageStartY
280 }
281 PropertyChanges {
282 target: tip
283 opacity: 0.0
284 }
285 PropertyChanges {
286 target: tipContainer
287 y: -bottomEdge.tipHeight
288 }
289 PropertyChanges {
290 target: hideIndicator
291 running: false
292 }
293 },
294 State {
295 name: "floating"
296 PropertyChanges {
297 target: shadow
298 opacity: 1.0
299 }
300 PropertyChanges {
301 target: hideIndicator
302 running: false
303 }
304 PropertyChanges {
305 target: tipContainer
306 y: -bottomEdge.tipHeight
307 }
308 }
309 ]
310
311 transitions: [
312 Transition {
313 to: "expanded"
314 SequentialAnimation {
315 UbuntuNumberAnimation {
316 targets: [bottomEdge,tip]
317 properties: "y,opacity"
318 duration: UbuntuAnimation.SlowDuration
319 }
320 ScriptAction {
321 script: page._pushPage()
322 }
323 }
324 },
325 Transition {
326 from: "expanded"
327 to: "collapsed"
328 SequentialAnimation {
329 ScriptAction {
330 script: {
331 Qt.inputMethod.hide()
332 edgeLoader.item.parent = edgeLoader
333 edgeLoader.item.anchors.fill = edgeLoader
334 edgeLoader.item.active = false
335 }
336 }
337 UbuntuNumberAnimation {
338 targets: [bottomEdge,tip]
339 properties: "y,opacity"
340 duration: UbuntuAnimation.SlowDuration
341 }
342 ScriptAction {
343 script: {
344 // destroy current bottom page
345 if (page.reloadBottomEdgePage) {
346 edgeLoader.active = false
347 }
348
349 // notify
350 page.bottomEdgeDismissed()
351
352 // load a new bottom page in memory
353 edgeLoader.active = true
354
355 hideIndicator.restart()
356 }
357 }
358 }
359 },
360 Transition {
361 from: "floating"
362 to: "collapsed"
363 UbuntuNumberAnimation {
364 targets: [bottomEdge,tip]
365 properties: "y,opacity"
366 }
367 }
368 ]
369
370 Item {
371 anchors.fill: parent
372 clip: true
373
374 Loader {
375 id: edgeLoader
376
377 z: 1
378 active: true
379 asynchronous: true
380 anchors.fill: parent
381
382 //WORKAROUND: The SDK move the page contents down to allocate space for the header we need to avoid that during the page dragging
383 Binding {
384 target: edgeLoader
385 property: "anchors.topMargin"
386 value: edgeLoader.item && edgeLoader.item.flickable ? -bottomEdge.header.height : 0
387 when: (edgeLoader.status === Loader.Ready && !page.isReady)
388 }
389
390 Behavior on anchors.topMargin {
391 UbuntuNumberAnimation {}
392 }
393
394 onLoaded: {
395 if (page.isReady && edgeLoader.item.active != true) {
396 page._pushPage()
397 }
398 }
399 }
400 }
401
402 MouseArea {
403 preventStealing: true
404 drag.axis: Drag.YAxis
405 drag.target: bottomEdge
406 drag.minimumY: bottomEdge.pageStartY
407 drag.maximumY: page.height
408
409 anchors {
410 left: parent.left
411 right: parent.right
412 }
413 height: bottomEdge.tipHeight
414 y: -height
415 z: 2
416
417 onReleased: {
418 page.bottomEdgeReleased()
419 if (bottomEdge.y < (page.height - bottomEdgeExpandThreshold - bottomEdge.tipHeight)) {
420 bottomEdge.state = "expanded"
421 } else {
422 bottomEdge.state = "collapsed"
423 bottomEdge.y = bottomEdge.height
424 }
425 }
426
427 onPressed: {
428 bottomEdge.state = "floating"
429 bottomEdge.y -= bottomEdge.tipHeight
430 }
431 }
432
433 }
434}
4350
=== modified file 'src/qml/dialer-app.qml'
--- src/qml/dialer-app.qml 2014-07-28 16:44:39 +0000
+++ src/qml/dialer-app.qml 2014-08-04 18:47:59 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
21import Ubuntu.Components.Popups 0.121import Ubuntu.Components.Popups 0.1
22import Ubuntu.Telephony 0.122import Ubuntu.Telephony 0.1
2323
@@ -92,6 +92,11 @@
92 Qt.openUrlExternally("addressbook:///addnewphone?callback=dialer-app.desktop&phone=" + encodeURIComponent(phoneNumber))92 Qt.openUrlExternally("addressbook:///addnewphone?callback=dialer-app.desktop&phone=" + encodeURIComponent(phoneNumber))
93 }93 }
9494
95 function addPhoneToContact(contactId, phoneNumber) {
96 Qt.openUrlExternally("addressbook:///addphone?callback=dialer-app.desktop&id=%1&phone=%2".arg(encodeURIComponent(contactId))
97 .arg(encodeURIComponent(phoneNumber)))
98 }
99
95 function sendMessage(phoneNumber) {100 function sendMessage(phoneNumber) {
96 Qt.openUrlExternally("message:///" + encodeURIComponent(phoneNumber))101 Qt.openUrlExternally("message:///" + encodeURIComponent(phoneNumber))
97 }102 }
@@ -222,7 +227,7 @@
222 Dialog {227 Dialog {
223 id: dialogue228 id: dialogue
224 title: i18n.tr("No network")229 title: i18n.tr("No network")
225 text: telepathyHelper.accountIds.length >= 2 ? i18n.tr("There is currently no network on %1").arg(mainView.accounts.displayName)230 text: telepathyHelper.accountIds.length >= 2 ? i18n.tr("There is currently no network on %1").arg(mainView.account.displayName)
226 : i18n.tr("There is currently no network.")231 : i18n.tr("There is currently no network.")
227 Button {232 Button {
228 objectName: "closeNoNetworkDialog"233 objectName: "closeNoNetworkDialog"
229234
=== modified file 'tests/autopilot/dialer_app/emulators.py'
--- tests/autopilot/dialer_app/emulators.py 2014-07-29 23:51:52 +0000
+++ tests/autopilot/dialer_app/emulators.py 2014-08-04 18:47:59 +0000
@@ -65,7 +65,7 @@
65 """Bring the bottom edge page to the screen"""65 """Bring the bottom edge page to the screen"""
66 self.bottomEdgePageLoaded.wait_for(True)66 self.bottomEdgePageLoaded.wait_for(True)
67 try:67 try:
68 action_item = self.wait_select_single('QQuickItem',68 action_item = self.wait_select_single('UbuntuShape',
69 objectName='bottomEdgeTip')69 objectName='bottomEdgeTip')
70 start_x = (action_item.globalRect.x +70 start_x = (action_item.globalRect.x +
71 (action_item.globalRect.width * 0.5))71 (action_item.globalRect.width * 0.5))
7272
=== modified file 'tests/autopilot/dialer_app/tests/test_calls.py'
--- tests/autopilot/dialer_app/tests/test_calls.py 2014-06-13 21:52:17 +0000
+++ tests/autopilot/dialer_app/tests/test_calls.py 2014-08-04 18:47:59 +0000
@@ -71,7 +71,7 @@
71 def get_history_for_number(self, number):71 def get_history_for_number(self, number):
72 # because of the bottom edge tree structure, multiple copies of the72 # because of the bottom edge tree structure, multiple copies of the
73 # same item are returned, so just use the first one73 # same item are returned, so just use the first one
74 return self.history_list.select_many("Label", text=number)[0]74 return self.history_list.select_many("HistoryDelegate", phoneNumber=number)[0]
7575
76 def test_outgoing_noanswer(self):76 def test_outgoing_noanswer(self):
77 """Outgoing call to a normal number, no answer"""77 """Outgoing call to a normal number, no answer"""

Subscribers

People subscribed via source and target branches