2
* Copyright (C) 2013 Canonical, Ltd.
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.
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.
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/>.
18
import Ubuntu.Components 0.1
19
import "../../Components"
20
import "../../Components/ListItems" as ListItems
27
property var model: undefined
29
title: (model && model.displayName) ? model.displayName : ""
30
url: (model && model.avatar) ? model.avatar : ""
31
previewWidthRatio: 0.34
35
spacing: columns > 1 ? units.gu(2) : 0
36
columns: preview.narrowMode || width < units.gu(60) ? 1 : 2
37
property int columnWidth: columns > 1 ? (width - spacing * (columns - 1)) / columns : width
45
objectName: "statusField"
46
width: parent.columnWidth
47
visible: preview.model != undefined && preview.model.status != undefined
50
// FIXME that should trigger the action on the scope, when there's support
51
onClicked: shell.activateApplication("/usr/share/applications/%1-webapp.desktop".arg(model.statusService), "--homepage=%1".arg(model.statusPostUri))
57
width: parent.columnWidth
67
model: preview.model ? preview.model.phoneNumbers : undefined
70
objectName: "phoneField" + index
72
// FIXME these should trigger actions on the scope, when there's support
73
onPhoneClicked: shell.activateApplication("/usr/share/applications/phone-app.desktop", "call://%1".arg(number.replace(/[^\d\+]/g, "")))
74
onTextClicked: shell.activateApplication("/usr/share/applications/phone-app.desktop", "message://%1".arg(number.replace(/[^\d\+]/g, "")))
86
model: preview.model ? preview.model.emailAddresses : undefined
88
objectName: "emailField" + index
101
model: preview.model ? preview.model.imAccounts : undefined
103
objectName: "imField" + index
116
model: preview.model ? preview.model.addresses : undefined
118
objectName: "addressField" + index