~ubuntu-branches/ubuntu/utopic/messaging-app/utopic-proposed

« back to all changes in this revision

Viewing changes to src/qml/NewRecipientPage.qml

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Ugo Riboni, Tiago Salem Herrmann, Martin Pitt, Pawel Stolowski, Gustavo Pichorim Boiko, Renato Araujo Oliveira Filho
  • Date: 2014-09-04 18:26:42 UTC
  • mfrom: (1.1.51)
  • Revision ID: package-import@ubuntu.com-20140904182642-nubm9vfvbe6b5lwh
Tags: 0.1+14.10.20140904.1-0ubuntu1
[ Ugo Riboni ]
* Make sure the strings from the desktop file template are processed.
  Use paths relative to the po dir in the .pot file to match
  convention. Update the pot file.

[ Tiago Salem Herrmann ]
* Improve startup time (LP: #1325001)

[ Martin Pitt ]
* update POT

[ Pawel Stolowski ]
* Added X-Ubuntu-Default-Department-ID key to the desktop file. This
  is required by click scope to support departments for preinstalled
  applications.

[ Gustavo Pichorim Boiko ]
* Make sure the strings from the desktop file template are processed.
  Use paths relative to the po dir in the .pot file to match
  convention. Update the pot file.

[ Renato Araujo Oliveira Filho ]
* Make sure the strings from the desktop file template are processed.
  Use paths relative to the po dir in the .pot file to match
  convention. Update the pot file.
* Replaced ContactListView used to display search result with a simple
  ListView.
* Set root element as parent for MessageInfoDialog.
* Format the message timestamp using the current system locale. Make
  sure that AM/PM format get correct formatted. (LP: #1353691)
* Added "+ Create new" button on contact list. Hide contact switch
  "all" "favorites" during the search. (LP: #1234947)

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
    title: i18n.tr("Add recipient")
30
30
 
31
 
    head {
32
 
        contents: TextField {
33
 
            id: searchField
 
31
    TextField {
 
32
        id: searchField
34
33
 
35
 
            anchors {
36
 
                left: parent.left
37
 
                leftMargin: units.gu(2)
38
 
                right: parent.right
39
 
                rightMargin: units.gu(2)
40
 
                topMargin: units.gu(1.5)
41
 
                bottomMargin: units.gu(1.5)
42
 
                verticalCenter: parent.verticalCenter
43
 
            }
44
 
            onTextChanged: contactList.currentIndex = -1
45
 
            inputMethodHints: Qt.ImhNoPredictiveText
46
 
            placeholderText: i18n.tr("Search...")
 
34
        anchors {
 
35
            left: parent.left
 
36
            leftMargin: units.gu(2)
 
37
            right: parent.right
 
38
            rightMargin: units.gu(2)
 
39
            topMargin: units.gu(1.5)
 
40
            bottomMargin: units.gu(1.5)
 
41
            verticalCenter: parent.verticalCenter
47
42
        }
48
 
        sections.model: ["All", "Favorites"]
 
43
        onTextChanged: newRecipientPage.currentIndex = -1
 
44
        inputMethodHints: Qt.ImhNoPredictiveText
 
45
        placeholderText: i18n.tr("Search...")
 
46
        visible: false
49
47
    }
50
48
 
 
49
    state: "default"
 
50
    states: [
 
51
        PageHeadState {
 
52
            id: defaultState
 
53
 
 
54
            name: "default"
 
55
            actions: [
 
56
                Action {
 
57
                    text: i18n.tr("Search")
 
58
                    iconName: "search"
 
59
                    onTriggered: {
 
60
                        newRecipientPage.state = "searching"
 
61
                        contactList.showAllContacts()
 
62
                        searchField.forceActiveFocus()
 
63
                    }
 
64
                }
 
65
            ]
 
66
            PropertyChanges {
 
67
                target: newRecipientPage.head
 
68
                actions: defaultState.actions
 
69
                sections.model: [i18n.tr("All"), i18n.tr("Favorites")]
 
70
            }
 
71
            PropertyChanges {
 
72
                target: searchField
 
73
                text: ""
 
74
                visible: false
 
75
            }
 
76
        },
 
77
        PageHeadState {
 
78
            id: searchingState
 
79
 
 
80
            name: "searching"
 
81
            backAction: Action {
 
82
                iconName: "close"
 
83
                text: i18n.tr("Cancel")
 
84
                onTriggered: {
 
85
                    newRecipientPage.forceActiveFocus()
 
86
                    newRecipientPage.state = "default"
 
87
                    newRecipientPage.head.sections.selectedIndex = 0
 
88
                }
 
89
            }
 
90
 
 
91
            PropertyChanges {
 
92
                target: newRecipientPage.head
 
93
                backAction: searchingState.backAction
 
94
                contents: searchField
 
95
            }
 
96
 
 
97
            PropertyChanges {
 
98
                target: searchField
 
99
                text: ""
 
100
                visible: true
 
101
            }
 
102
        }
 
103
    ]
 
104
 
51
105
    Connections {
52
106
        target: newRecipientPage.head.sections
53
107
        onSelectedIndexChanged: {
73
127
            right: parent.right
74
128
            bottom: keyboard.top
75
129
        }
 
130
 
 
131
        header: Item {
 
132
            id: addNewContactButton
 
133
            objectName: "addNewContact"
 
134
 
 
135
            anchors {
 
136
                left: parent.left
 
137
                right: parent.right
 
138
            }
 
139
            height: units.gu(8)
 
140
 
 
141
            Rectangle {
 
142
                anchors.fill: parent
 
143
                color: Theme.palette.selected.background
 
144
                opacity: addNewContactButtonArea.pressed ?  1.0 : 0.0
 
145
            }
 
146
 
 
147
            UbuntuShape {
 
148
                id: addIcon
 
149
 
 
150
                anchors {
 
151
                    left: parent.left
 
152
                    top: parent.top
 
153
                    bottom: parent.bottom
 
154
                    margins: units.gu(1)
 
155
                }
 
156
                width: height
 
157
                radius: "medium"
 
158
                color: Theme.palette.normal.overlay
 
159
                Image {
 
160
                    anchors.centerIn: parent
 
161
                    width: units.gu(2)
 
162
                    height: units.gu(2)
 
163
                    source: "image://theme/add"
 
164
                }
 
165
            }
 
166
 
 
167
            Label {
 
168
                id: name
 
169
 
 
170
                anchors {
 
171
                    left: addIcon.right
 
172
                    leftMargin: units.gu(2)
 
173
                    verticalCenter: parent.verticalCenter
 
174
                    right: parent.right
 
175
                    rightMargin: units.gu(2)
 
176
                }
 
177
                color: UbuntuColors.lightAubergine
 
178
                // TRANSLATORS: this refers to creating a new contact
 
179
                text: i18n.tr("+ Create New")
 
180
                elide: Text.ElideRight
 
181
            }
 
182
 
 
183
            MouseArea {
 
184
                id: addNewContactButtonArea
 
185
 
 
186
                anchors.fill: parent
 
187
                onClicked: Qt.openUrlExternally("addressbook:///create?callback=messaging-app.desktop&phone= ")
 
188
            }
 
189
        }
 
190
 
76
191
        filterTerm: searchField.text
77
192
        detailToPick: ContactDetail.PhoneNumber
78
193
        onDetailClicked: {