Merge lp:~phablet-team/address-book-app/address-book-app-desktop-translations into lp:address-book-app
- address-book-app-desktop-translations
- Merge into trunk
Proposed by
Ugo Riboni
Status: | Superseded |
---|---|
Proposed branch: | lp:~phablet-team/address-book-app/address-book-app-desktop-translations |
Merge into: | lp:address-book-app |
Diff against target: |
1401 lines (+435/-220) 21 files modified
CMakeLists.txt (+4/-0) data/CMakeLists.txt (+5/-7) data/address-book-app.desktop.in.in (+4/-4) po/CMakeLists.txt (+7/-4) po/address-book-app.pot (+34/-33) po/pt_BR.po (+1/-1) src/app/addressbookapp.cpp (+38/-5) src/app/addressbookapp.h (+7/-0) src/imports/ContactEdit/ContactEditor.qml (+2/-2) src/imports/ContactEdit/TextInputDetail.qml (+1/-4) src/imports/ContactList/ContactListPage.qml (+183/-63) src/imports/ContactView/ContactDetailAvatarView.qml (+2/-1) src/imports/MainWindow.qml (+63/-41) src/imports/Ubuntu/Contacts/ContactDelegate.qml (+15/-2) src/imports/Ubuntu/Contacts/ContactDetailPickerPhoneNumberDelegate.qml (+5/-3) src/imports/Ubuntu/Contacts/ContactListView.qml (+19/-7) src/imports/Ubuntu/Contacts/ContactSimpleListView.qml (+3/-3) src/imports/Ubuntu/Contacts/ListItemWithActions.qml (+30/-33) src/imports/Ubuntu/Contacts/MostCalledModel.qml (+8/-5) src/imports/Ubuntu/Contacts/mostcalledproxymodel.cpp (+3/-2) src/imports/Ubuntu/Contacts/mostcalledproxymodel.h (+1/-0) |
To merge this branch: | bzr merge lp:~phablet-team/address-book-app/address-book-app-desktop-translations |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Needs Fixing | |
Ubuntu Phablet Team | Pending | ||
Review via email: mp+223362@code.launchpad.net |
This proposal has been superseded by a proposal from 2014-07-16.
Commit message
Add translations inside .desktop files
Description of the change
Add translations inside .desktop files
To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : | # |
review:
Needs Fixing
(continuous-integration)
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote : | # |
could you create a new mr against the staging branch?
- 211. By Renato Araujo Oliveira Filho
-
Removed useless code.
- 212. By Renato Araujo Oliveira Filho
-
Staging merged.
Unmerged revisions
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2014-07-07 19:46:23 +0000 | |||
3 | +++ CMakeLists.txt 2014-07-16 12:56:44 +0000 | |||
4 | @@ -18,9 +18,13 @@ | |||
5 | 18 | find_package(Qt5DBus) | 18 | find_package(Qt5DBus) |
6 | 19 | find_package(PkgConfig REQUIRED) | 19 | find_package(PkgConfig REQUIRED) |
7 | 20 | 20 | ||
8 | 21 | find_program(INTLTOOL_MERGE intltool-merge) | ||
9 | 22 | find_program(INTLTOOL_EXTRACT intltool-extract) | ||
10 | 23 | |||
11 | 21 | set(ADDRESS_BOOK_APP_DIR ${CMAKE_INSTALL_DATADIR}/address-book-app) | 24 | set(ADDRESS_BOOK_APP_DIR ${CMAKE_INSTALL_DATADIR}/address-book-app) |
12 | 22 | set(ADDRESS_BOOK_APP_FULL_DIR ${CMAKE_INSTALL_FULL_DATADIR}/address-book-app) | 25 | set(ADDRESS_BOOK_APP_FULL_DIR ${CMAKE_INSTALL_FULL_DATADIR}/address-book-app) |
13 | 23 | set(ADDRESS_BOOK_APP_NAME "Address Book") | 26 | set(ADDRESS_BOOK_APP_NAME "Address Book") |
14 | 27 | set(DESKTOP_FILE address-book-app.desktop) | ||
15 | 24 | set(API_VERSION 0.1) | 28 | set(API_VERSION 0.1) |
16 | 25 | 29 | ||
17 | 26 | # for dh_translations to extract the domain | 30 | # for dh_translations to extract the domain |
18 | 27 | 31 | ||
19 | === modified file 'data/CMakeLists.txt' | |||
20 | --- data/CMakeLists.txt 2014-07-07 19:46:23 +0000 | |||
21 | +++ data/CMakeLists.txt 2014-07-16 12:56:44 +0000 | |||
22 | @@ -5,13 +5,11 @@ | |||
23 | 5 | set(ADDRESS_BOOK_APP_ICON "address-book-app.svg") | 5 | set(ADDRESS_BOOK_APP_ICON "address-book-app.svg") |
24 | 6 | endif() | 6 | endif() |
25 | 7 | 7 | ||
33 | 8 | file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/${ADDRESS_BOOK_APP_DESKTOP_FILE}) | 8 | configure_file(${DESKTOP_FILE}.in.in ${DESKTOP_FILE}.in) |
34 | 9 | file(STRINGS ${ADDRESS_BOOK_APP_DESKTOP_FILE}.in DESKTOP_FILE_CONTENTS) | 9 | add_custom_target(${DESKTOP_FILE} ALL |
35 | 10 | foreach(LINE ${DESKTOP_FILE_CONTENTS}) | 10 | COMMENT "Merging translations into ${DESKTOP_FILE}" |
36 | 11 | string(REGEX REPLACE "tr\\\(\"(.*)\"\\\)" "\\1" LINE "${LINE}") | 11 | COMMAND LC_ALL=C ${INTLTOOL_MERGE} -d -u ${CMAKE_SOURCE_DIR}/po ${DESKTOP_FILE}.in ${DESKTOP_FILE} >/dev/null |
37 | 12 | string(CONFIGURE "${LINE}" LINE) | 12 | ) |
31 | 13 | file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${ADDRESS_BOOK_APP_DESKTOP_FILE} "${LINE}\n") | ||
32 | 14 | endforeach(LINE) | ||
38 | 15 | 13 | ||
39 | 16 | if(CLICK_MODE) | 14 | if(CLICK_MODE) |
40 | 17 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${ADDRESS_BOOK_APP_DESKTOP_FILE} | 15 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${ADDRESS_BOOK_APP_DESKTOP_FILE} |
41 | 18 | 16 | ||
42 | === renamed file 'data/address-book-app.desktop.in' => 'data/address-book-app.desktop.in.in' | |||
43 | --- data/address-book-app.desktop.in 2014-07-07 19:46:23 +0000 | |||
44 | +++ data/address-book-app.desktop.in.in 2014-07-16 12:56:44 +0000 | |||
45 | @@ -3,13 +3,13 @@ | |||
46 | 3 | Version=1.0 | 3 | Version=1.0 |
47 | 4 | Terminal=false | 4 | Terminal=false |
48 | 5 | Type=Application | 5 | Type=Application |
52 | 6 | Name=tr("Contacts") | 6 | _Name=Contacts |
53 | 7 | GenericName=tr("Contacts") | 7 | _GenericName=Contacts |
54 | 8 | Comment=tr("Contacts Address Book") | 8 | _Comment=Contacts Address Book |
55 | 9 | _Keywords=Contacts;People;Numbers | ||
56 | 9 | Exec=@DESKTOP_EXEC@ %u | 10 | Exec=@DESKTOP_EXEC@ %u |
57 | 10 | Icon=@ADDRESS_BOOK_APP_ICON@ | 11 | Icon=@ADDRESS_BOOK_APP_ICON@ |
58 | 11 | X-Ubuntu-Touch=true | 12 | X-Ubuntu-Touch=true |
59 | 12 | X-Ubuntu-StageHint=SideStage | 13 | X-Ubuntu-StageHint=SideStage |
60 | 13 | X-Ubuntu-Gettext-Domain=address-book-app | ||
61 | 14 | X-Ubuntu-Single-Instance=true | 14 | X-Ubuntu-Single-Instance=true |
62 | 15 | @XSCREENSHOT@ | 15 | @XSCREENSHOT@ |
63 | 16 | 16 | ||
64 | === modified file 'po/CMakeLists.txt' | |||
65 | --- po/CMakeLists.txt 2014-05-28 19:56:00 +0000 | |||
66 | +++ po/CMakeLists.txt 2014-07-16 12:56:44 +0000 | |||
67 | @@ -4,8 +4,8 @@ | |||
68 | 4 | set(POT_FILE ${DOMAIN}.pot) | 4 | set(POT_FILE ${DOMAIN}.pot) |
69 | 5 | file(GLOB PO_FILES *.po) | 5 | file(GLOB PO_FILES *.po) |
70 | 6 | file(GLOB_RECURSE I18N_SRCS RELATIVE ${CMAKE_SOURCE_DIR} | 6 | file(GLOB_RECURSE I18N_SRCS RELATIVE ${CMAKE_SOURCE_DIR} |
73 | 7 | ${CMAKE_SOURCE_DIR}/src/*.qml | 7 | ${CMAKE_SOURCE_DIR}/src/*.qml) |
74 | 8 | ${CMAKE_SOURCE_DIR}/data/*.desktop.in) | 8 | list(APPEND I18N_SRCS data/${DESKTOP_FILE}.in.in) |
75 | 9 | list(SORT I18N_SRCS) | 9 | list(SORT I18N_SRCS) |
76 | 10 | 10 | ||
77 | 11 | foreach(PO_FILE ${PO_FILES}) | 11 | foreach(PO_FILE ${PO_FILES}) |
78 | @@ -19,8 +19,11 @@ | |||
79 | 19 | 19 | ||
80 | 20 | find_program(XGETTEXT_EXECUTABLE xgettext) | 20 | find_program(XGETTEXT_EXECUTABLE xgettext) |
81 | 21 | if(XGETTEXT_EXECUTABLE) | 21 | if(XGETTEXT_EXECUTABLE) |
84 | 22 | add_custom_target(${POT_FILE}) | 22 | add_custom_target(${POT_FILE} ALL |
85 | 23 | add_custom_command(TARGET ${POT_FILE} | 23 | COMMENT "Generating translation template" |
86 | 24 | COMMAND ${INTLTOOL_EXTRACT} --update --type=gettext/ini | ||
87 | 25 | --srcdir=${CMAKE_SOURCE_DIR} data/${DESKTOP_FILE}.in.in | ||
88 | 26 | |||
89 | 24 | COMMAND ${XGETTEXT_EXECUTABLE} -o ${POT_FILE} | 27 | COMMAND ${XGETTEXT_EXECUTABLE} -o ${POT_FILE} |
90 | 25 | --c++ --qt --add-comments=TRANSLATORS | 28 | --c++ --qt --add-comments=TRANSLATORS |
91 | 26 | --keyword=tr --keyword=tr:1,2 | 29 | --keyword=tr --keyword=tr:1,2 |
92 | 27 | 30 | ||
93 | === modified file 'po/address-book-app.pot' | |||
94 | --- po/address-book-app.pot 2014-06-30 18:01:45 +0000 | |||
95 | +++ po/address-book-app.pot 2014-07-16 12:56:44 +0000 | |||
96 | @@ -8,7 +8,7 @@ | |||
97 | 8 | msgstr "" | 8 | msgstr "" |
98 | 9 | "Project-Id-Version: address-book-app\n" | 9 | "Project-Id-Version: address-book-app\n" |
99 | 10 | "Report-Msgid-Bugs-To: \n" | 10 | "Report-Msgid-Bugs-To: \n" |
101 | 11 | "POT-Creation-Date: 2014-06-30 15:01-0300\n" | 11 | "POT-Creation-Date: 2014-07-16 09:55-0300\n" |
102 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
103 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
104 | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" |
105 | @@ -22,10 +22,18 @@ | |||
106 | 22 | msgid "%1 vCards imported" | 22 | msgid "%1 vCards imported" |
107 | 23 | msgstr "" | 23 | msgstr "" |
108 | 24 | 24 | ||
109 | 25 | #: src/imports/ContactList/ContactListPage.qml:202 | ||
110 | 26 | msgid "+ New Contact" | ||
111 | 27 | msgstr "" | ||
112 | 28 | |||
113 | 25 | #: src/imports/ContactEdit/ContactEditor.qml:322 | 29 | #: src/imports/ContactEdit/ContactEditor.qml:322 |
114 | 26 | msgid "Add Field" | 30 | msgid "Add Field" |
115 | 27 | msgstr "" | 31 | msgstr "" |
116 | 28 | 32 | ||
117 | 33 | #: src/imports/ContactList/ContactListPage.qml:462 | ||
118 | 34 | msgid "Add contact" | ||
119 | 35 | msgstr "" | ||
120 | 36 | |||
121 | 29 | #: src/imports/ContactEdit/AddFieldDialog.qml:59 | 37 | #: src/imports/ContactEdit/AddFieldDialog.qml:59 |
122 | 30 | #: src/imports/ContactEdit/ContactDetailAddressesEditor.qml:23 | 38 | #: src/imports/ContactEdit/ContactDetailAddressesEditor.qml:23 |
123 | 31 | #: src/imports/ContactView/ContactDetailAddressesView.qml:24 | 39 | #: src/imports/ContactView/ContactDetailAddressesView.qml:24 |
124 | @@ -55,12 +63,12 @@ | |||
125 | 55 | 63 | ||
126 | 56 | #: src/imports/ContactEdit/AddFieldDialog.qml:133 | 64 | #: src/imports/ContactEdit/AddFieldDialog.qml:133 |
127 | 57 | #: src/imports/ContactEdit/ContactEditor.qml:372 | 65 | #: src/imports/ContactEdit/ContactEditor.qml:372 |
129 | 58 | #: src/imports/ContactList/ContactListPage.qml:314 | 66 | #: src/imports/ContactList/ContactListPage.qml:418 |
130 | 59 | #: src/imports/Ubuntu/Contacts/DialogButtons.qml:37 | 67 | #: src/imports/Ubuntu/Contacts/DialogButtons.qml:37 |
131 | 60 | msgid "Cancel" | 68 | msgid "Cancel" |
132 | 61 | msgstr "" | 69 | msgstr "" |
133 | 62 | 70 | ||
135 | 63 | #: src/imports/ContactList/ContactListPage.qml:242 | 71 | #: src/imports/ContactList/ContactListPage.qml:330 |
136 | 64 | msgid "Cancel selection" | 72 | msgid "Cancel selection" |
137 | 65 | msgstr "" | 73 | msgstr "" |
138 | 66 | 74 | ||
139 | @@ -72,22 +80,17 @@ | |||
140 | 72 | msgid "Contact not found" | 80 | msgid "Contact not found" |
141 | 73 | msgstr "" | 81 | msgstr "" |
142 | 74 | 82 | ||
145 | 75 | #: data/address-book-app.desktop.in:6 data/address-book-app.desktop.in:7 | 83 | #: src/imports/ContactList/ContactListPage.qml:146 |
144 | 76 | #: src/imports/ContactList/ContactListPage.qml:75 | ||
146 | 77 | msgid "Contacts" | 84 | msgid "Contacts" |
147 | 78 | msgstr "" | 85 | msgstr "" |
148 | 79 | 86 | ||
149 | 80 | #: data/address-book-app.desktop.in:8 | ||
150 | 81 | msgid "Contacts Address Book" | ||
151 | 82 | msgstr "" | ||
152 | 83 | |||
153 | 84 | #: src/imports/ContactEdit/ContactDetailAddressesEditor.qml:35 | 87 | #: src/imports/ContactEdit/ContactDetailAddressesEditor.qml:35 |
154 | 85 | msgid "Country" | 88 | msgid "Country" |
155 | 86 | msgstr "" | 89 | msgstr "" |
156 | 87 | 90 | ||
157 | 88 | #: src/imports/ContactEdit/ContactEditor.qml:337 | 91 | #: src/imports/ContactEdit/ContactEditor.qml:337 |
160 | 89 | #: src/imports/ContactList/ContactListPage.qml:146 | 92 | #: src/imports/ContactList/ContactListPage.qml:235 |
161 | 90 | #: src/imports/ContactList/ContactListPage.qml:267 | 93 | #: src/imports/ContactList/ContactListPage.qml:355 |
162 | 91 | msgid "Delete" | 94 | msgid "Delete" |
163 | 92 | msgstr "" | 95 | msgstr "" |
164 | 93 | 96 | ||
165 | @@ -120,7 +123,7 @@ | |||
166 | 120 | msgstr "" | 123 | msgstr "" |
167 | 121 | 124 | ||
168 | 122 | #: src/imports/ContactView/ContactFetchError.qml:25 | 125 | #: src/imports/ContactView/ContactFetchError.qml:25 |
170 | 123 | #: src/imports/MainWindow.qml:98 | 126 | #: src/imports/MainWindow.qml:112 |
171 | 124 | msgid "Error" | 127 | msgid "Error" |
172 | 125 | msgstr "" | 128 | msgstr "" |
173 | 126 | 129 | ||
174 | @@ -136,12 +139,12 @@ | |||
175 | 136 | msgid "First name" | 139 | msgid "First name" |
176 | 137 | msgstr "" | 140 | msgstr "" |
177 | 138 | 141 | ||
179 | 139 | #: src/imports/Ubuntu/Contacts/ContactListView.qml:427 | 142 | #: src/imports/Ubuntu/Contacts/ContactListView.qml:442 |
180 | 140 | msgid "Frequently called" | 143 | msgid "Frequently called" |
181 | 141 | msgstr "" | 144 | msgstr "" |
182 | 142 | 145 | ||
183 | 143 | #: src/imports/Common/ContactDetailGroupWithTypeBase.qml:116 | 146 | #: src/imports/Common/ContactDetailGroupWithTypeBase.qml:116 |
185 | 144 | #: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:94 | 147 | #: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:99 |
186 | 145 | msgid "Home" | 148 | msgid "Home" |
187 | 146 | msgstr "" | 149 | msgstr "" |
188 | 147 | 150 | ||
189 | @@ -173,7 +176,7 @@ | |||
190 | 173 | msgid "Loading" | 176 | msgid "Loading" |
191 | 174 | msgstr "" | 177 | msgstr "" |
192 | 175 | 178 | ||
194 | 176 | #: src/imports/ContactList/ContactListPage.qml:232 | 179 | #: src/imports/ContactList/ContactListPage.qml:320 |
195 | 177 | msgid "Loading..." | 180 | msgid "Loading..." |
196 | 178 | msgstr "" | 181 | msgstr "" |
197 | 179 | 182 | ||
198 | @@ -185,7 +188,7 @@ | |||
199 | 185 | msgid "MSN" | 188 | msgid "MSN" |
200 | 186 | msgstr "" | 189 | msgstr "" |
201 | 187 | 190 | ||
203 | 188 | #: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:98 | 191 | #: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:103 |
204 | 189 | msgid "Mobile" | 192 | msgid "Mobile" |
205 | 190 | msgstr "" | 193 | msgstr "" |
206 | 191 | 194 | ||
207 | @@ -193,7 +196,7 @@ | |||
208 | 193 | msgid "Multiple contacts" | 196 | msgid "Multiple contacts" |
209 | 194 | msgstr "" | 197 | msgstr "" |
210 | 195 | 198 | ||
212 | 196 | #: src/imports/ContactEdit/TextInputDetail.qml:77 | 199 | #: src/imports/ContactEdit/TextInputDetail.qml:74 |
213 | 197 | msgid "Next" | 200 | msgid "Next" |
214 | 198 | msgstr "" | 201 | msgstr "" |
215 | 199 | 202 | ||
216 | @@ -211,7 +214,7 @@ | |||
217 | 211 | msgstr "" | 214 | msgstr "" |
218 | 212 | 215 | ||
219 | 213 | #: src/imports/Common/ContactDetailGroupWithTypeBase.qml:118 | 216 | #: src/imports/Common/ContactDetailGroupWithTypeBase.qml:118 |
221 | 214 | #: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:102 | 217 | #: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:107 |
222 | 215 | msgid "Other" | 218 | msgid "Other" |
223 | 216 | msgstr "" | 219 | msgstr "" |
224 | 217 | 220 | ||
225 | @@ -234,6 +237,10 @@ | |||
226 | 234 | msgid "Professional details" | 237 | msgid "Professional details" |
227 | 235 | msgstr "" | 238 | msgstr "" |
228 | 236 | 239 | ||
229 | 240 | #: src/imports/ContactList/ContactListPage.qml:372 | ||
230 | 241 | msgid "Quit" | ||
231 | 242 | msgstr "" | ||
232 | 243 | |||
233 | 237 | #: src/imports/ContactEdit/ContactDetailAddressesEditor.qml:33 | 244 | #: src/imports/ContactEdit/ContactDetailAddressesEditor.qml:33 |
234 | 238 | msgid "Region" | 245 | msgid "Region" |
235 | 239 | msgstr "" | 246 | msgstr "" |
236 | @@ -246,19 +253,19 @@ | |||
237 | 246 | msgid "Save" | 253 | msgid "Save" |
238 | 247 | msgstr "" | 254 | msgstr "" |
239 | 248 | 255 | ||
241 | 249 | #: src/imports/ContactList/ContactListPage.qml:292 | 256 | #: src/imports/ContactList/ContactListPage.qml:396 |
242 | 250 | msgid "Search" | 257 | msgid "Search" |
243 | 251 | msgstr "" | 258 | msgstr "" |
244 | 252 | 259 | ||
246 | 253 | #: src/imports/ContactList/ContactListPage.qml:267 | 260 | #: src/imports/ContactList/ContactListPage.qml:355 |
247 | 254 | msgid "Select" | 261 | msgid "Select" |
248 | 255 | msgstr "" | 262 | msgstr "" |
249 | 256 | 263 | ||
251 | 257 | #: src/imports/ContactList/ContactListPage.qml:251 | 264 | #: src/imports/ContactList/ContactListPage.qml:339 |
252 | 258 | msgid "Select All" | 265 | msgid "Select All" |
253 | 259 | msgstr "" | 266 | msgstr "" |
254 | 260 | 267 | ||
256 | 261 | #: src/imports/ContactList/ContactListPage.qml:75 | 268 | #: src/imports/ContactList/ContactListPage.qml:512 |
257 | 262 | msgid "Select Contacts" | 269 | msgid "Select Contacts" |
258 | 263 | msgstr "" | 270 | msgstr "" |
259 | 264 | 271 | ||
260 | @@ -283,15 +290,15 @@ | |||
261 | 283 | msgid "Street" | 290 | msgid "Street" |
262 | 284 | msgstr "" | 291 | msgstr "" |
263 | 285 | 292 | ||
265 | 286 | #: src/imports/ContactList/ContactListPage.qml:283 | 293 | #: src/imports/ContactList/ContactListPage.qml:387 |
266 | 287 | msgid "Sync" | 294 | msgid "Sync" |
267 | 288 | msgstr "" | 295 | msgstr "" |
268 | 289 | 296 | ||
270 | 290 | #: src/imports/ContactList/ContactListPage.qml:283 | 297 | #: src/imports/ContactList/ContactListPage.qml:387 |
271 | 291 | msgid "Syncing" | 298 | msgid "Syncing" |
272 | 292 | msgstr "" | 299 | msgstr "" |
273 | 293 | 300 | ||
275 | 294 | #: src/imports/ContactList/ContactListPage.qml:232 | 301 | #: src/imports/ContactList/ContactListPage.qml:320 |
276 | 295 | msgid "Syncing..." | 302 | msgid "Syncing..." |
277 | 296 | msgstr "" | 303 | msgstr "" |
278 | 297 | 304 | ||
279 | @@ -303,18 +310,12 @@ | |||
280 | 303 | msgid "Touch" | 310 | msgid "Touch" |
281 | 304 | msgstr "" | 311 | msgstr "" |
282 | 305 | 312 | ||
283 | 306 | #. TRANSLATORS: This value is used as default value for phone number format, when no coutry code is provided | ||
284 | 307 | #. the supported values can be found in: https://www.iso.org/obp/ui/#search | ||
285 | 308 | #: src/imports/ContactEdit/TextInputDetail.qml:73 | ||
286 | 309 | msgid "US" | ||
287 | 310 | msgstr "" | ||
288 | 311 | |||
289 | 312 | #: src/imports/Common/ContactDetailGroupWithTypeBase.qml:117 | 313 | #: src/imports/Common/ContactDetailGroupWithTypeBase.qml:117 |
291 | 313 | #: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:96 | 314 | #: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:101 |
292 | 314 | msgid "Work" | 315 | msgid "Work" |
293 | 315 | msgstr "" | 316 | msgstr "" |
294 | 316 | 317 | ||
296 | 317 | #: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:100 | 318 | #: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:105 |
297 | 318 | msgid "Work Mobile" | 319 | msgid "Work Mobile" |
298 | 319 | msgstr "" | 320 | msgstr "" |
299 | 320 | 321 | ||
300 | 321 | 322 | ||
301 | === modified file 'po/pt_BR.po' | |||
302 | --- po/pt_BR.po 2014-07-05 05:59:02 +0000 | |||
303 | +++ po/pt_BR.po 2014-07-16 12:56:44 +0000 | |||
304 | @@ -307,7 +307,7 @@ | |||
305 | 307 | #. the supported values can be found in: https://www.iso.org/obp/ui/#search | 307 | #. the supported values can be found in: https://www.iso.org/obp/ui/#search |
306 | 308 | #: src/imports/ContactEdit/TextInputDetail.qml:73 | 308 | #: src/imports/ContactEdit/TextInputDetail.qml:73 |
307 | 309 | msgid "US" | 309 | msgid "US" |
309 | 310 | msgstr "" | 310 | msgstr "BR" |
310 | 311 | 311 | ||
311 | 312 | #: src/imports/Common/ContactDetailGroupWithTypeBase.qml:117 | 312 | #: src/imports/Common/ContactDetailGroupWithTypeBase.qml:117 |
312 | 313 | #: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:96 | 313 | #: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:96 |
313 | 314 | 314 | ||
314 | === modified file 'src/app/addressbookapp.cpp' | |||
315 | --- src/app/addressbookapp.cpp 2014-07-04 23:10:37 +0000 | |||
316 | +++ src/app/addressbookapp.cpp 2014-07-16 12:56:44 +0000 | |||
317 | @@ -22,6 +22,7 @@ | |||
318 | 22 | #include <QUrl> | 22 | #include <QUrl> |
319 | 23 | #include <QUrlQuery> | 23 | #include <QUrlQuery> |
320 | 24 | #include <QDebug> | 24 | #include <QDebug> |
321 | 25 | #include <QDesktopServices> | ||
322 | 25 | #include <QStringList> | 26 | #include <QStringList> |
323 | 26 | #include <QQuickItem> | 27 | #include <QQuickItem> |
324 | 27 | #include <QQmlComponent> | 28 | #include <QQmlComponent> |
325 | @@ -30,6 +31,8 @@ | |||
326 | 30 | #include <QLibrary> | 31 | #include <QLibrary> |
327 | 31 | #include <QIcon> | 32 | #include <QIcon> |
328 | 32 | #include <QSettings> | 33 | #include <QSettings> |
329 | 34 | #include <QTimer> | ||
330 | 35 | |||
331 | 33 | 36 | ||
332 | 34 | #include <QQmlEngine> | 37 | #include <QQmlEngine> |
333 | 35 | 38 | ||
334 | @@ -39,11 +42,12 @@ | |||
335 | 39 | { | 42 | { |
336 | 40 | qDebug() << "usage:" | 43 | qDebug() << "usage:" |
337 | 41 | << arguments.at(0).toUtf8().constData() | 44 | << arguments.at(0).toUtf8().constData() |
343 | 42 | << "[addressbook:///addphone?id=<contact-id>&phone=<phone-number>" | 45 | << "[addressbook:///addphone?id=<contact-id>&phone=<phone-number>]" |
344 | 43 | << "[addressbook:///contact?id=<contact-id>" | 46 | << "[addressbook:///addnewphone?phone=<phone-number>]" |
345 | 44 | << "[addressbook:///create?phone=<phone-number>" | 47 | << "[addressbook:///contact?id=<contact-id>]" |
346 | 45 | << "[addressbook:///pick?single=<true/false>" | 48 | << "[addressbook:///create?phone=<phone-number>]" |
347 | 46 | << "[addressbook:///importvcard?url=<vcard-file>" | 49 | << "[addressbook:///pick?single=<true/false>]" |
348 | 50 | << "[addressbook:///importvcard?url=<vcard-file>]" | ||
349 | 47 | << "[--fullscreen]" | 51 | << "[--fullscreen]" |
350 | 48 | << "[--help]" | 52 | << "[--help]" |
351 | 49 | << "[-testability]"; | 53 | << "[-testability]"; |
352 | @@ -266,6 +270,15 @@ | |||
353 | 266 | sendEvent(m_view, &keyReleaseEvent); | 270 | sendEvent(m_view, &keyReleaseEvent); |
354 | 267 | } | 271 | } |
355 | 268 | 272 | ||
356 | 273 | void AddressBookApp::exit() | ||
357 | 274 | { | ||
358 | 275 | if (!m_callbackApplication.isEmpty()) { | ||
359 | 276 | QDesktopServices::openUrl(QUrl(QString("application:///%1").arg(m_callbackApplication))); | ||
360 | 277 | } | ||
361 | 278 | // quit after a delay to avoid problems with unity task manager. | ||
362 | 279 | QTimer::singleShot(1000, this, SLOT(quit())); | ||
363 | 280 | } | ||
364 | 281 | |||
365 | 269 | void AddressBookApp::parseUrl(const QString &arg) | 282 | void AddressBookApp::parseUrl(const QString &arg) |
366 | 270 | { | 283 | { |
367 | 271 | QUrl url = QUrl::fromPercentEncoding(arg.toUtf8()); | 284 | QUrl url = QUrl::fromPercentEncoding(arg.toUtf8()); |
368 | @@ -305,6 +318,11 @@ | |||
369 | 305 | args << "url"; | 318 | args << "url"; |
370 | 306 | methodsMetaData.insert("importvcard", args); | 319 | methodsMetaData.insert("importvcard", args); |
371 | 307 | args.clear(); | 320 | args.clear(); |
372 | 321 | |||
373 | 322 | //addnewphone | ||
374 | 323 | args << "phone"; | ||
375 | 324 | methodsMetaData.insert("addnewphone", args); | ||
376 | 325 | args.clear(); | ||
377 | 308 | } | 326 | } |
378 | 309 | 327 | ||
379 | 310 | QUrlQuery query(url); | 328 | QUrlQuery query(url); |
380 | @@ -316,6 +334,8 @@ | |||
381 | 316 | QPair<QString, QString> item = queryItemsPair[i]; | 334 | QPair<QString, QString> item = queryItemsPair[i]; |
382 | 317 | queryItems.insert(item.first, item.second); | 335 | queryItems.insert(item.first, item.second); |
383 | 318 | } | 336 | } |
384 | 337 | // keep callback arg | ||
385 | 338 | setCallbackApplication(queryItems.take("callback")); | ||
386 | 319 | 339 | ||
387 | 320 | if (methodsMetaData.contains(methodName)) { | 340 | if (methodsMetaData.contains(methodName)) { |
388 | 321 | QStringList argsNames = methodsMetaData[methodName]; | 341 | QStringList argsNames = methodsMetaData[methodName]; |
389 | @@ -450,3 +470,16 @@ | |||
390 | 450 | } | 470 | } |
391 | 451 | return false; | 471 | return false; |
392 | 452 | } | 472 | } |
393 | 473 | |||
394 | 474 | QString AddressBookApp::callbackApplication() const | ||
395 | 475 | { | ||
396 | 476 | return m_callbackApplication; | ||
397 | 477 | } | ||
398 | 478 | |||
399 | 479 | void AddressBookApp::setCallbackApplication(const QString &application) | ||
400 | 480 | { | ||
401 | 481 | if (m_callbackApplication != application) { | ||
402 | 482 | m_callbackApplication = application; | ||
403 | 483 | Q_EMIT callbackApplicationChanged(); | ||
404 | 484 | } | ||
405 | 485 | } | ||
406 | 453 | 486 | ||
407 | === modified file 'src/app/addressbookapp.h' | |||
408 | --- src/app/addressbookapp.h 2014-06-11 21:25:08 +0000 | |||
409 | +++ src/app/addressbookapp.h 2014-07-16 12:56:44 +0000 | |||
410 | @@ -28,6 +28,7 @@ | |||
411 | 28 | Q_PROPERTY(bool firstRun READ isFirstRun CONSTANT) | 28 | Q_PROPERTY(bool firstRun READ isFirstRun CONSTANT) |
412 | 29 | Q_PROPERTY(bool syncing READ isSyncing NOTIFY syncingChanged) | 29 | Q_PROPERTY(bool syncing READ isSyncing NOTIFY syncingChanged) |
413 | 30 | Q_PROPERTY(bool syncEnabled READ syncEnabled NOTIFY syncEnabledChanged) | 30 | Q_PROPERTY(bool syncEnabled READ syncEnabled NOTIFY syncEnabledChanged) |
414 | 31 | Q_PROPERTY(QString callbackApplication READ callbackApplication WRITE setCallbackApplication NOTIFY callbackApplicationChanged) | ||
415 | 31 | 32 | ||
416 | 32 | public: | 33 | public: |
417 | 33 | AddressBookApp(int &argc, char **argv); | 34 | AddressBookApp(int &argc, char **argv); |
418 | @@ -37,9 +38,13 @@ | |||
419 | 37 | bool isSyncing() const; | 38 | bool isSyncing() const; |
420 | 38 | bool syncEnabled() const; | 39 | bool syncEnabled() const; |
421 | 39 | 40 | ||
422 | 41 | QString callbackApplication() const; | ||
423 | 42 | void setCallbackApplication(const QString &application); | ||
424 | 43 | |||
425 | 40 | Q_SIGNALS: | 44 | Q_SIGNALS: |
426 | 41 | void syncingChanged(); | 45 | void syncingChanged(); |
427 | 42 | void syncEnabledChanged(); | 46 | void syncEnabledChanged(); |
428 | 47 | void callbackApplicationChanged(); | ||
429 | 43 | 48 | ||
430 | 44 | public Q_SLOTS: | 49 | public Q_SLOTS: |
431 | 45 | void activateWindow(); | 50 | void activateWindow(); |
432 | @@ -50,6 +55,7 @@ | |||
433 | 50 | bool isFirstRun() const; | 55 | bool isFirstRun() const; |
434 | 51 | void unsetFirstRun() const; | 56 | void unsetFirstRun() const; |
435 | 52 | void sendTabEvent() const; | 57 | void sendTabEvent() const; |
436 | 58 | void exit(); | ||
437 | 53 | 59 | ||
438 | 54 | // sync monitor | 60 | // sync monitor |
439 | 55 | void startSync() const; | 61 | void startSync() const; |
440 | @@ -62,6 +68,7 @@ | |||
441 | 62 | QQuickView *m_view; | 68 | QQuickView *m_view; |
442 | 63 | QDBusInterface *m_syncMonitor; | 69 | QDBusInterface *m_syncMonitor; |
443 | 64 | QString m_initialArg; | 70 | QString m_initialArg; |
444 | 71 | QString m_callbackApplication; | ||
445 | 65 | bool m_viewReady; | 72 | bool m_viewReady; |
446 | 66 | bool m_pickingMode; | 73 | bool m_pickingMode; |
447 | 67 | bool m_testMode; | 74 | bool m_testMode; |
448 | 68 | 75 | ||
449 | === modified file 'src/imports/ContactEdit/ContactEditor.qml' | |||
450 | --- src/imports/ContactEdit/ContactEditor.qml 2014-06-17 17:30:40 +0000 | |||
451 | +++ src/imports/ContactEdit/ContactEditor.qml 2014-07-16 12:56:44 +0000 | |||
452 | @@ -82,8 +82,8 @@ | |||
453 | 82 | // backend error will be handled by the root page (contact list) | 82 | // backend error will be handled by the root page (contact list) |
454 | 83 | var newContact = (contact.model == null) | 83 | var newContact = (contact.model == null) |
455 | 84 | contactEditor.model.saveContact(contact) | 84 | contactEditor.model.saveContact(contact) |
458 | 85 | if (newContact) { | 85 | if (newContact && pageStack.contactListPage) { |
459 | 86 | pageStack.contactCreated(contact) | 86 | pageStack.contactListPage.moveListToContact(contact) |
460 | 87 | } | 87 | } |
461 | 88 | } | 88 | } |
462 | 89 | pageStack.pop() | 89 | pageStack.pop() |
463 | 90 | 90 | ||
464 | === modified file 'src/imports/ContactEdit/TextInputDetail.qml' | |||
465 | --- src/imports/ContactEdit/TextInputDetail.qml 2014-06-12 22:55:20 +0000 | |||
466 | +++ src/imports/ContactEdit/TextInputDetail.qml 2014-07-16 12:56:44 +0000 | |||
467 | @@ -67,10 +67,7 @@ | |||
468 | 67 | id: field | 67 | id: field |
469 | 68 | 68 | ||
470 | 69 | anchors.fill: parent | 69 | anchors.fill: parent |
475 | 70 | 70 | defaultRegion: PhoneUtils.defaultRegion | |
472 | 71 | // TRANSLATORS: This value is used as default value for phone number format, when no coutry code is provided | ||
473 | 72 | // the supported values can be found in: https://www.iso.org/obp/ui/#search | ||
474 | 73 | defaultRegion: i18n.tr("US") | ||
476 | 74 | autoFormat: false | 71 | autoFormat: false |
477 | 75 | 72 | ||
478 | 76 | // Ubuntu.Keyboard | 73 | // Ubuntu.Keyboard |
479 | 77 | 74 | ||
480 | === modified file 'src/imports/ContactList/ContactListPage.qml' | |||
481 | --- src/imports/ContactList/ContactListPage.qml 2014-07-02 23:23:19 +0000 | |||
482 | +++ src/imports/ContactList/ContactListPage.qml 2014-07-16 12:56:44 +0000 | |||
483 | @@ -35,12 +35,28 @@ | |||
484 | 35 | property var onlineAccountsMessageDialog: null | 35 | property var onlineAccountsMessageDialog: null |
485 | 36 | property QtObject contactIndex: null | 36 | property QtObject contactIndex: null |
486 | 37 | property bool contactsLoaded: false | 37 | property bool contactsLoaded: false |
487 | 38 | property string newPhoneToAdd: "" | ||
488 | 38 | 39 | ||
489 | 40 | readonly property bool allowToQuit: (application.callbackApplication.length > 0) | ||
490 | 39 | readonly property bool syncEnabled: application.syncEnabled | 41 | readonly property bool syncEnabled: application.syncEnabled |
491 | 40 | readonly property var contactModel: contactList.listModel ? contactList.listModel : null | 42 | readonly property var contactModel: contactList.listModel ? contactList.listModel : null |
495 | 41 | readonly property bool searching: (state === "searching") | 43 | readonly property bool searching: (state === "searching" || state === "newphoneSearching") |
496 | 42 | 44 | ||
497 | 43 | function createEmptyContact(phoneNumber) { | 45 | // this function is used to reset the contact list page to the default state if it was called |
498 | 46 | // from the uri. For example when called to add a new contact | ||
499 | 47 | function returnToNormalState() | ||
500 | 48 | { | ||
501 | 49 | // these two states are the only state that need to be reset | ||
502 | 50 | if (state == "newphoneSearching" || state == "newphone") { | ||
503 | 51 | pageStack.resetStack() | ||
504 | 52 | state = "" | ||
505 | 53 | newPhoneToAdd = "" | ||
506 | 54 | application.callbackApplication = "" | ||
507 | 55 | } | ||
508 | 56 | } | ||
509 | 57 | |||
510 | 58 | function createEmptyContact(phoneNumber) | ||
511 | 59 | { | ||
512 | 44 | var details = [ {detail: "PhoneNumber", field: "number", value: phoneNumber}, | 60 | var details = [ {detail: "PhoneNumber", field: "number", value: phoneNumber}, |
513 | 45 | {detail: "EmailAddress", field: "emailAddress", value: ""}, | 61 | {detail: "EmailAddress", field: "emailAddress", value: ""}, |
514 | 46 | {detail: "Name", field: "firstName", value: ""} | 62 | {detail: "Name", field: "firstName", value: ""} |
515 | @@ -63,16 +79,71 @@ | |||
516 | 63 | var newContact = mainPage.createEmptyContact(phoneNumber) | 79 | var newContact = mainPage.createEmptyContact(phoneNumber) |
517 | 64 | //WORKAROUND: SKD changes the page header as soon as the page get created | 80 | //WORKAROUND: SKD changes the page header as soon as the page get created |
518 | 65 | // setting active false will avoid that | 81 | // setting active false will avoid that |
529 | 66 | mainPage.showBottomEdgePage(Qt.resolvedUrl("../ContactEdit/ContactEditor.qml"), | 82 | if (bottomEdgeEnabled) { |
530 | 67 | {model: contactList.listModel, | 83 | mainPage.showBottomEdgePage(Qt.resolvedUrl("../ContactEdit/ContactEditor.qml"), |
531 | 68 | contact: newContact, | 84 | {model: contactList.listModel, |
532 | 69 | active: false, | 85 | contact: newContact, |
533 | 70 | enabled: false, | 86 | active: false, |
534 | 71 | initialFocusSection: "name"}) | 87 | enabled: false, |
535 | 72 | 88 | initialFocusSection: "name"}) | |
536 | 73 | } | 89 | } else { |
537 | 74 | 90 | pageStack.push(Qt.resolvedUrl("../ContactEdit/ContactEditor.qml"), | |
538 | 75 | title: contactList.isInSelectionMode ? i18n.tr("Select Contacts") : i18n.tr("Contacts") | 91 | {model: contactList.listModel, |
539 | 92 | contact: newContact, | ||
540 | 93 | initialFocusSection: "name"}) | ||
541 | 94 | } | ||
542 | 95 | } | ||
543 | 96 | |||
544 | 97 | function showContact(contactId) | ||
545 | 98 | { | ||
546 | 99 | pageStack.push(Qt.resolvedUrl("../ContactView/ContactView.qml"), | ||
547 | 100 | {model: contactList.listModel, contactId: contactId}) | ||
548 | 101 | } | ||
549 | 102 | |||
550 | 103 | function addPhoneToContact(contactId, phoneNumber) | ||
551 | 104 | { | ||
552 | 105 | pageStack.push(Qt.resolvedUrl("../ContactView/ContactView.qml"), | ||
553 | 106 | {model: contactList.listModel, | ||
554 | 107 | contactId: contactId, | ||
555 | 108 | addPhoneToContact: phoneNumber}) | ||
556 | 109 | } | ||
557 | 110 | |||
558 | 111 | function importContact(urls) | ||
559 | 112 | { | ||
560 | 113 | if (urls.length > 0) { | ||
561 | 114 | var importDialog = Qt.createQmlObject("VCardImportDialog{}", | ||
562 | 115 | mainPage, | ||
563 | 116 | "VCardImportDialog") | ||
564 | 117 | if (importDialog) { | ||
565 | 118 | importDialog.importVCards(contactList.listModel, urls) | ||
566 | 119 | } | ||
567 | 120 | } | ||
568 | 121 | } | ||
569 | 122 | |||
570 | 123 | function startPickMode(isSingleSelection) | ||
571 | 124 | { | ||
572 | 125 | pickMode = true | ||
573 | 126 | pickMultipleContacts = !isSingleSelection | ||
574 | 127 | contactList.startSelection() | ||
575 | 128 | } | ||
576 | 129 | |||
577 | 130 | function moveListToContact(contact) | ||
578 | 131 | { | ||
579 | 132 | contactIndex = contact | ||
580 | 133 | mainPage.state = "" | ||
581 | 134 | // this means a new contact was created | ||
582 | 135 | if (mainPage.allowToQuit) { | ||
583 | 136 | application.exit() | ||
584 | 137 | } | ||
585 | 138 | } | ||
586 | 139 | |||
587 | 140 | function addNewPhone(phoneNumber) | ||
588 | 141 | { | ||
589 | 142 | newPhoneToAdd = phoneNumber | ||
590 | 143 | state = "newphone" | ||
591 | 144 | } | ||
592 | 145 | |||
593 | 146 | title: i18n.tr("Contacts") | ||
594 | 76 | 147 | ||
595 | 77 | //bottom edge page | 148 | //bottom edge page |
596 | 78 | bottomEdgePageComponent: ContactEditor { | 149 | bottomEdgePageComponent: ContactEditor { |
597 | @@ -124,13 +195,30 @@ | |||
598 | 124 | } | 195 | } |
599 | 125 | } | 196 | } |
600 | 126 | 197 | ||
601 | 198 | Button { | ||
602 | 199 | id: addNewContactButton | ||
603 | 200 | objectName: "addNewContact" | ||
604 | 201 | |||
605 | 202 | text: i18n.tr("+ New Contact") | ||
606 | 203 | anchors { | ||
607 | 204 | top: parent.top | ||
608 | 205 | left: parent.left | ||
609 | 206 | right: parent.right | ||
610 | 207 | margins: visible ? units.gu(2) : 0 | ||
611 | 208 | } | ||
612 | 209 | height: visible ? units.gu(4) : 0 | ||
613 | 210 | visible: false | ||
614 | 211 | onClicked: mainPage.createContactWithPhoneNumber(mainPage.newPhoneToAdd) | ||
615 | 212 | } | ||
616 | 213 | |||
617 | 127 | flickable: null //contactList.fastScrolling ? null : contactList.view | 214 | flickable: null //contactList.fastScrolling ? null : contactList.view |
618 | 128 | ContactsUI.ContactListView { | 215 | ContactsUI.ContactListView { |
619 | 129 | id: contactList | 216 | id: contactList |
620 | 130 | objectName: "contactListView" | 217 | objectName: "contactListView" |
621 | 131 | 218 | ||
622 | 132 | anchors { | 219 | anchors { |
624 | 133 | top: parent.top | 220 | top: addNewContactButton.bottom |
625 | 221 | topMargin: addNewContactButton.visible ? units.gu(2) : 0 | ||
626 | 134 | left: parent.left | 222 | left: parent.left |
627 | 135 | bottom: keyboard.top | 223 | bottom: keyboard.top |
628 | 136 | right: parent.right | 224 | right: parent.right |
629 | @@ -139,7 +227,8 @@ | |||
630 | 139 | detailToPick: ContactDetail.PhoneNumber | 227 | detailToPick: ContactDetail.PhoneNumber |
631 | 140 | multiSelectionEnabled: true | 228 | multiSelectionEnabled: true |
632 | 141 | multipleSelection: !pickMode || | 229 | multipleSelection: !pickMode || |
634 | 142 | mainPage.pickMultipleContacts || (contactExporter.active && contactExporter.isMultiple) | 230 | mainPage.pickMultipleContacts || |
635 | 231 | (contactExporter.active && contactExporter.isMultiple) | ||
636 | 143 | 232 | ||
637 | 144 | leftSideAction: Action { | 233 | leftSideAction: Action { |
638 | 145 | iconName: "delete" | 234 | iconName: "delete" |
639 | @@ -174,6 +263,9 @@ | |||
640 | 174 | Qt.openUrlExternally("tel:///" + encodeURIComponent(detail.number)) | 263 | Qt.openUrlExternally("tel:///" + encodeURIComponent(detail.number)) |
641 | 175 | else if (action == "message") | 264 | else if (action == "message") |
642 | 176 | Qt.openUrlExternally("message:///" + encodeURIComponent(detail.number)) | 265 | Qt.openUrlExternally("message:///" + encodeURIComponent(detail.number)) |
643 | 266 | else if ((mainPage.state === "newphone") || (mainPage.state === "newphoneSearching")) { | ||
644 | 267 | mainPage.addPhoneToContact(contact.contactId, mainPage.newPhoneToAdd) | ||
645 | 268 | } | ||
646 | 177 | } | 269 | } |
647 | 178 | 270 | ||
648 | 179 | onSelectionDone: { | 271 | onSelectionDone: { |
649 | @@ -247,7 +339,7 @@ | |||
650 | 247 | text: i18n.tr("Select All") | 339 | text: i18n.tr("Select All") |
651 | 248 | iconName: "filter" | 340 | iconName: "filter" |
652 | 249 | onTriggered: { | 341 | onTriggered: { |
654 | 250 | if (contactList.selectedItems.count == contactList.count) { | 342 | if (contactList.selectedItems.count === contactList.count) { |
655 | 251 | contactList.clearSelection() | 343 | contactList.clearSelection() |
656 | 252 | } else { | 344 | } else { |
657 | 253 | contactList.selectAll() | 345 | contactList.selectAll() |
658 | @@ -268,10 +360,26 @@ | |||
659 | 268 | } | 360 | } |
660 | 269 | } | 361 | } |
661 | 270 | 362 | ||
662 | 363 | ToolbarButton { | ||
663 | 364 | id: quitButton | ||
664 | 365 | |||
665 | 366 | visible: false | ||
666 | 367 | action: Action { | ||
667 | 368 | objectName: "quitApp" | ||
668 | 369 | |||
669 | 370 | visible: mainPage.allowToQuit | ||
670 | 371 | iconName: "back" | ||
671 | 372 | text: i18n.tr("Quit") | ||
672 | 373 | onTriggered: application.exit() | ||
673 | 374 | } | ||
674 | 375 | } | ||
675 | 376 | |||
676 | 271 | ToolbarItems { | 377 | ToolbarItems { |
677 | 272 | id: toolbarItemsNormalMode | 378 | id: toolbarItemsNormalMode |
678 | 273 | 379 | ||
679 | 274 | visible: false | 380 | visible: false |
680 | 381 | back: mainPage.allowToQuit ? quitButton : null | ||
681 | 382 | |||
682 | 275 | ToolbarButton { | 383 | ToolbarButton { |
683 | 276 | objectName: "Sync" | 384 | objectName: "Sync" |
684 | 277 | action: Action { | 385 | action: Action { |
685 | @@ -289,7 +397,7 @@ | |||
686 | 289 | visible: !mainPage.searching | 397 | visible: !mainPage.searching |
687 | 290 | iconName: "search" | 398 | iconName: "search" |
688 | 291 | onTriggered: { | 399 | onTriggered: { |
690 | 292 | mainPage.state = "searching" | 400 | mainPage.state = (mainPage.state === "newphone" ? "newphoneSearching" : "searching") |
691 | 293 | searchField.forceActiveFocus() | 401 | searchField.forceActiveFocus() |
692 | 294 | } | 402 | } |
693 | 295 | } | 403 | } |
694 | @@ -306,9 +414,9 @@ | |||
695 | 306 | objectName: "cancelSearch" | 414 | objectName: "cancelSearch" |
696 | 307 | 415 | ||
697 | 308 | visible: mainPage.searching | 416 | visible: mainPage.searching |
699 | 309 | iconName: "back" | 417 | iconName: "close" |
700 | 310 | text: i18n.tr("Cancel") | 418 | text: i18n.tr("Cancel") |
702 | 311 | onTriggered: mainPage.state = "" | 419 | onTriggered: mainPage.state = (mainPage.state === "newphoneSearching" ? "newphone" : "") |
703 | 312 | } | 420 | } |
704 | 313 | } | 421 | } |
705 | 314 | } | 422 | } |
706 | @@ -329,13 +437,57 @@ | |||
707 | 329 | onTextChanged: contactList.currentIndex = -1 | 437 | onTextChanged: contactList.currentIndex = -1 |
708 | 330 | inputMethodHints: Qt.ImhNoPredictiveText | 438 | inputMethodHints: Qt.ImhNoPredictiveText |
709 | 331 | } | 439 | } |
710 | 332 | |||
711 | 333 | states: [ | 440 | states: [ |
712 | 334 | State { | 441 | State { |
713 | 335 | name: "" | 442 | name: "" |
714 | 336 | PropertyChanges { | 443 | PropertyChanges { |
715 | 337 | target: searchField | 444 | target: searchField |
716 | 338 | text: "" | 445 | text: "" |
717 | 446 | newPhoneToAdd: "" | ||
718 | 447 | } | ||
719 | 448 | }, | ||
720 | 449 | State { | ||
721 | 450 | name: "newphone" | ||
722 | 451 | PropertyChanges { | ||
723 | 452 | target: searchField | ||
724 | 453 | text: "" | ||
725 | 454 | } | ||
726 | 455 | PropertyChanges { | ||
727 | 456 | target: addNewContactButton | ||
728 | 457 | visible: true | ||
729 | 458 | } | ||
730 | 459 | PropertyChanges { | ||
731 | 460 | target: mainPage | ||
732 | 461 | bottomEdgeEnabled: false | ||
733 | 462 | title: i18n.tr("Add contact") | ||
734 | 463 | } | ||
735 | 464 | PropertyChanges { | ||
736 | 465 | target: contactList | ||
737 | 466 | detailToPick: -1 | ||
738 | 467 | } | ||
739 | 468 | }, | ||
740 | 469 | State { | ||
741 | 470 | name: "newphoneSearching" | ||
742 | 471 | PropertyChanges { | ||
743 | 472 | target: addNewContactButton | ||
744 | 473 | visible: true | ||
745 | 474 | } | ||
746 | 475 | PropertyChanges { | ||
747 | 476 | target: mainPage | ||
748 | 477 | bottomEdgeEnabled: false | ||
749 | 478 | } | ||
750 | 479 | PropertyChanges { | ||
751 | 480 | target: contactList | ||
752 | 481 | detailToPick: -1 | ||
753 | 482 | } | ||
754 | 483 | PropertyChanges { | ||
755 | 484 | target: mainPage | ||
756 | 485 | __customHeaderContents: searchField | ||
757 | 486 | tools: toolbarItemsSearch | ||
758 | 487 | } | ||
759 | 488 | PropertyChanges { | ||
760 | 489 | target: contactList | ||
761 | 490 | showFavourites: false | ||
762 | 339 | } | 491 | } |
763 | 340 | }, | 492 | }, |
764 | 341 | State { | 493 | State { |
765 | @@ -356,10 +508,11 @@ | |||
766 | 356 | PropertyChanges { | 508 | PropertyChanges { |
767 | 357 | target: mainPage | 509 | target: mainPage |
768 | 358 | tools: toolbarItemsSelectionMode | 510 | tools: toolbarItemsSelectionMode |
769 | 511 | bottomEdgeEnabled: false | ||
770 | 512 | title: i18n.tr("Select Contacts") | ||
771 | 359 | } | 513 | } |
772 | 360 | } | 514 | } |
773 | 361 | ] | 515 | ] |
774 | 362 | |||
775 | 363 | tools: toolbarItemsNormalMode | 516 | tools: toolbarItemsNormalMode |
776 | 364 | 517 | ||
777 | 365 | // WORKAROUND: Avoid the gap btw the header and the contact list when the list moves | 518 | // WORKAROUND: Avoid the gap btw the header and the contact list when the list moves |
778 | @@ -392,35 +545,6 @@ | |||
779 | 392 | initialFocusSection: "name"}) | 545 | initialFocusSection: "name"}) |
780 | 393 | } | 546 | } |
781 | 394 | 547 | ||
782 | 395 | Connections { | ||
783 | 396 | target: pageStack | ||
784 | 397 | onCreateContactRequested: mainPage.createContactWithPhoneNumber(phoneNumber) | ||
785 | 398 | onContactRequested: { | ||
786 | 399 | pageStack.push(Qt.resolvedUrl("../ContactView/ContactView.qml"), | ||
787 | 400 | {model: contactList.listModel, contactId: contactId}) | ||
788 | 401 | } | ||
789 | 402 | onEditContatRequested: { | ||
790 | 403 | pageStack.push(Qt.resolvedUrl("../ContactView/ContactView.qml"), | ||
791 | 404 | {model: contactList.listModel, | ||
792 | 405 | contactId: contactId, | ||
793 | 406 | addPhoneToContact: phoneNumber}) | ||
794 | 407 | } | ||
795 | 408 | onContactCreated: { | ||
796 | 409 | mainPage.contactIndex = contact | ||
797 | 410 | } | ||
798 | 411 | |||
799 | 412 | onImportContactRequested: { | ||
800 | 413 | if (urls.length > 0) { | ||
801 | 414 | var importDialog = Qt.createQmlObject("VCardImportDialog{}", | ||
802 | 415 | mainPage, | ||
803 | 416 | "VCardImportDialog") | ||
804 | 417 | if (importDialog) { | ||
805 | 418 | importDialog.importVCards(contactList.listModel, urls) | ||
806 | 419 | } | ||
807 | 420 | } | ||
808 | 421 | } | ||
809 | 422 | } | ||
810 | 423 | |||
811 | 424 | KeyboardRectangle { | 548 | KeyboardRectangle { |
812 | 425 | id: keyboard | 549 | id: keyboard |
813 | 426 | } | 550 | } |
814 | @@ -435,7 +559,6 @@ | |||
815 | 435 | } | 559 | } |
816 | 436 | } | 560 | } |
817 | 437 | 561 | ||
818 | 438 | |||
819 | 439 | QtObject { | 562 | QtObject { |
820 | 440 | id: contactExporter | 563 | id: contactExporter |
821 | 441 | 564 | ||
822 | @@ -470,25 +593,22 @@ | |||
823 | 470 | } | 593 | } |
824 | 471 | 594 | ||
825 | 472 | Component.onCompleted: { | 595 | Component.onCompleted: { |
829 | 473 | if (pickMode) { | 596 | if ((contactList.count === 0) && |
827 | 474 | contactList.startSelection() | ||
828 | 475 | } else if ((contactList.count === 0) && | ||
830 | 476 | application.firstRun && | 597 | application.firstRun && |
831 | 477 | !mainPage.syncEnabled) { | 598 | !mainPage.syncEnabled) { |
832 | 478 | mainPage.onlineAccountsMessageDialog = PopupUtils.open(onlineAccountsDialog, null) | 599 | mainPage.onlineAccountsMessageDialog = PopupUtils.open(onlineAccountsDialog, null) |
833 | 479 | } | 600 | } |
834 | 480 | 601 | ||
836 | 481 | if (TEST_DATA != "") { | 602 | if (TEST_DATA !== "") { |
837 | 482 | contactList.listModel.importContacts("file://" + TEST_DATA) | 603 | contactList.listModel.importContacts("file://" + TEST_DATA) |
838 | 483 | } | 604 | } |
839 | 484 | 605 | ||
848 | 485 | if (!pickMode) { | 606 | mainPage.setBottomEdgePage(Qt.resolvedUrl("../ContactEdit/ContactEditor.qml"), |
849 | 486 | mainPage.setBottomEdgePage(Qt.resolvedUrl("../ContactEdit/ContactEditor.qml"), | 607 | {model: contactList.listModel, |
850 | 487 | {model: contactList.listModel, | 608 | contact: mainPage.createEmptyContact(""), |
851 | 488 | contact: mainPage.createEmptyContact(""), | 609 | active: false, |
852 | 489 | active: false, | 610 | enabled: false, |
853 | 490 | enabled: false, | 611 | initialFocusSection: "name"}) |
854 | 491 | initialFocusSection: "name"}) | 612 | pageStack.contactListPage = mainPage |
847 | 492 | } | ||
855 | 493 | } | 613 | } |
856 | 494 | } | 614 | } |
857 | 495 | 615 | ||
858 | === modified file 'src/imports/ContactView/ContactDetailAvatarView.qml' | |||
859 | --- src/imports/ContactView/ContactDetailAvatarView.qml 2014-07-08 14:20:01 +0000 | |||
860 | +++ src/imports/ContactView/ContactDetailAvatarView.qml 2014-07-16 12:56:44 +0000 | |||
861 | @@ -28,7 +28,8 @@ | |||
862 | 28 | implicitWidth: units.gu(10) | 28 | implicitWidth: units.gu(10) |
863 | 29 | 29 | ||
864 | 30 | Connections { | 30 | Connections { |
866 | 31 | target: root.contact.avatar | 31 | target: root.contact ? root.contact.detail(ContactDetail.Avatar) : null |
867 | 32 | ignoreUnknownSignals: true | ||
868 | 32 | onDetailChanged: avatar.reload() | 33 | onDetailChanged: avatar.reload() |
869 | 33 | } | 34 | } |
870 | 34 | 35 | ||
871 | 35 | 36 | ||
872 | === modified file 'src/imports/MainWindow.qml' | |||
873 | --- src/imports/MainWindow.qml 2014-06-26 15:46:45 +0000 | |||
874 | +++ src/imports/MainWindow.qml 2014-07-16 12:56:44 +0000 | |||
875 | @@ -24,6 +24,7 @@ | |||
876 | 24 | id: mainWindow | 24 | id: mainWindow |
877 | 25 | 25 | ||
878 | 26 | property string modelErrorMessage: "" | 26 | property string modelErrorMessage: "" |
879 | 27 | readonly property bool appActive: Qt.application.active | ||
880 | 27 | 28 | ||
881 | 28 | width: units.gu(40) | 29 | width: units.gu(40) |
882 | 29 | height: units.gu(71) | 30 | height: units.gu(71) |
883 | @@ -32,54 +33,67 @@ | |||
884 | 32 | 33 | ||
885 | 33 | signal applicationReady() | 34 | signal applicationReady() |
886 | 34 | 35 | ||
907 | 35 | function contact(contactId) { | 36 | function contact(contactId) |
908 | 36 | mainStack.contactRequested(contactId) | 37 | { |
909 | 37 | } | 38 | mainStack.resetStack() |
910 | 38 | 39 | if (mainStack.contactListPage) { | |
911 | 39 | function create(phoneNumber) { | 40 | mainStack.contactListPage.showContact(contactId) |
912 | 40 | mainStack.createContactRequested(phoneNumber) | 41 | } |
913 | 41 | } | 42 | } |
914 | 42 | 43 | ||
915 | 43 | function addphone(contactId, phoneNumber) { | 44 | function create(phoneNumber) |
916 | 44 | mainStack.newPhoneNumber = phoneNumber | 45 | { |
917 | 45 | mainStack.editContatRequested(contactId, phoneNumber) | 46 | mainStack.resetStack() |
918 | 46 | } | 47 | if (mainStack.contactListPage) { |
919 | 47 | 48 | mainStack.contactListPage.createContactWithPhoneNumber(phoneNumber) | |
920 | 48 | function pick(single) { | 49 | } |
921 | 49 | var isSingle = (single == "true") | 50 | } |
922 | 50 | mainStack.push(Qt.createComponent("ContactList/ContactListPage.qml"), { pickMode: true, pickMultipleContacts: !isSingle}) | 51 | |
923 | 51 | } | 52 | function addphone(contactId, phoneNumber) |
924 | 52 | 53 | { | |
925 | 53 | function importvcard(_url) { | 54 | mainStack.resetStack() |
926 | 54 | mainStack.importContactRequested([_url]) | 55 | if (mainStack.contactListPage) { |
927 | 56 | mainStack.contactListPage.addPhoneToContact(contactId, phoneNumber) | ||
928 | 57 | } | ||
929 | 58 | } | ||
930 | 59 | |||
931 | 60 | function pick(single) | ||
932 | 61 | { | ||
933 | 62 | mainStack.resetStack() | ||
934 | 63 | if (mainStack.contactListPage) { | ||
935 | 64 | mainStack.contactListPage.startPickMode(single == "true") | ||
936 | 65 | } | ||
937 | 66 | } | ||
938 | 67 | |||
939 | 68 | function importvcard(_url) | ||
940 | 69 | { | ||
941 | 70 | mainStack.resetStack() | ||
942 | 71 | if (mainStack.contactListPage) { | ||
943 | 72 | mainStack.contactListPage.importContactRequested([_url]) | ||
944 | 73 | } | ||
945 | 74 | } | ||
946 | 75 | |||
947 | 76 | function addnewphone(phoneNumer) | ||
948 | 77 | { | ||
949 | 78 | mainStack.resetStack() | ||
950 | 79 | if (mainStack.contactListPage) { | ||
951 | 80 | mainStack.contactListPage.addNewPhone(phoneNumer) | ||
952 | 81 | } | ||
953 | 55 | } | 82 | } |
954 | 56 | 83 | ||
955 | 57 | PageStack { | 84 | PageStack { |
956 | 58 | id: mainStack | 85 | id: mainStack |
957 | 59 | 86 | ||
974 | 60 | property string newPhoneNumber: "" | 87 | property var contactListPage: null |
975 | 61 | 88 | ||
976 | 62 | signal contactRequested(string contactId) | 89 | function resetStack() |
977 | 63 | signal createContactRequested(string phoneNumber) | 90 | { |
978 | 64 | signal editContatRequested(string contactId, string phoneNumber) | 91 | while(depth > 1) { |
979 | 65 | signal contactCreated(QtObject contact) | 92 | pop() |
964 | 66 | signal contactModelError(string errorMessage) | ||
965 | 67 | signal importContactRequested(var urls) | ||
966 | 68 | |||
967 | 69 | anchors { | ||
968 | 70 | fill: parent | ||
969 | 71 | Behavior on bottomMargin { | ||
970 | 72 | NumberAnimation { | ||
971 | 73 | duration: 175 | ||
972 | 74 | easing.type: Easing.OutQuad | ||
973 | 75 | } | ||
980 | 76 | } | 93 | } |
982 | 77 | } | 94 | } |
983 | 78 | 95 | ||
988 | 79 | onContactModelError: { | 96 | anchors.fill: parent |
985 | 80 | modelErrorMessage = errorMessage | ||
986 | 81 | PopupUtils.open(errorDialog, null) | ||
987 | 82 | } | ||
989 | 83 | } | 97 | } |
990 | 84 | 98 | ||
991 | 85 | Component.onCompleted: { | 99 | Component.onCompleted: { |
992 | @@ -133,4 +147,12 @@ | |||
993 | 133 | } | 147 | } |
994 | 134 | } | 148 | } |
995 | 135 | } | 149 | } |
996 | 150 | |||
997 | 151 | |||
998 | 152 | // If application was called from uri handler and lost the focus reset the app to normal state | ||
999 | 153 | onAppActiveChanged: { | ||
1000 | 154 | if (!appActive && mainStack.contactListPage) { | ||
1001 | 155 | mainStack.contactListPage.returnToNormalState() | ||
1002 | 156 | } | ||
1003 | 157 | } | ||
1004 | 136 | } | 158 | } |
1005 | 137 | 159 | ||
1006 | === modified file 'src/imports/Ubuntu/Contacts/ContactDelegate.qml' | |||
1007 | --- src/imports/Ubuntu/Contacts/ContactDelegate.qml 2014-07-09 15:30:13 +0000 | |||
1008 | +++ src/imports/Ubuntu/Contacts/ContactDelegate.qml 2014-07-16 12:56:44 +0000 | |||
1009 | @@ -138,13 +138,16 @@ | |||
1010 | 138 | id: pickerLoader | 138 | id: pickerLoader |
1011 | 139 | 139 | ||
1012 | 140 | source: { | 140 | source: { |
1013 | 141 | if (!root.detailsShown) { | ||
1014 | 142 | return ""; | ||
1015 | 143 | } | ||
1016 | 144 | |||
1017 | 141 | switch(root.detailToPick) { | 145 | switch(root.detailToPick) { |
1018 | 142 | case ContactDetail.PhoneNumber: | 146 | case ContactDetail.PhoneNumber: |
1019 | 143 | default: | 147 | default: |
1020 | 144 | return Qt.resolvedUrl("ContactDetailPickerPhoneNumberDelegate.qml") | 148 | return Qt.resolvedUrl("ContactDetailPickerPhoneNumberDelegate.qml") |
1021 | 145 | } | 149 | } |
1022 | 146 | } | 150 | } |
1023 | 147 | active: contact && root.detailsShown | ||
1024 | 148 | asynchronous: true | 151 | asynchronous: true |
1025 | 149 | anchors { | 152 | anchors { |
1026 | 150 | top: delegate.bottom | 153 | top: delegate.bottom |
1027 | @@ -158,11 +161,21 @@ | |||
1028 | 158 | } | 161 | } |
1029 | 159 | 162 | ||
1030 | 160 | onStatusChanged: { | 163 | onStatusChanged: { |
1032 | 161 | if ((status == Loader.Ready) && contact) { | 164 | if (status == Loader.Ready) { |
1033 | 162 | pickerLoader.item.updateDetails(contact) | 165 | pickerLoader.item.updateDetails(contact) |
1034 | 163 | pickerLoader.item.detailClicked.connect(root._onDetailClicked) | 166 | pickerLoader.item.detailClicked.connect(root._onDetailClicked) |
1035 | 164 | } | 167 | } |
1036 | 165 | } | 168 | } |
1037 | 169 | |||
1038 | 170 | // update delegate if contact update | ||
1039 | 171 | Connections { | ||
1040 | 172 | target: contact | ||
1041 | 173 | onContactChanged: { | ||
1042 | 174 | if (pickerLoader.item) { | ||
1043 | 175 | pickerLoader.item.updateDetails(contact) | ||
1044 | 176 | } | ||
1045 | 177 | } | ||
1046 | 178 | } | ||
1047 | 166 | } | 179 | } |
1048 | 167 | 180 | ||
1049 | 168 | Behavior on height { | 181 | Behavior on height { |
1050 | 169 | 182 | ||
1051 | === modified file 'src/imports/Ubuntu/Contacts/ContactDetailPickerPhoneNumberDelegate.qml' | |||
1052 | --- src/imports/Ubuntu/Contacts/ContactDetailPickerPhoneNumberDelegate.qml 2014-07-07 22:20:38 +0000 | |||
1053 | +++ src/imports/Ubuntu/Contacts/ContactDetailPickerPhoneNumberDelegate.qml 2014-07-16 12:56:44 +0000 | |||
1054 | @@ -17,6 +17,7 @@ | |||
1055 | 17 | import QtQuick 2.2 | 17 | import QtQuick 2.2 |
1056 | 18 | import Ubuntu.Components.ListItems 0.1 as ListItem | 18 | import Ubuntu.Components.ListItems 0.1 as ListItem |
1057 | 19 | import Ubuntu.Components 0.1 | 19 | import Ubuntu.Components 0.1 |
1058 | 20 | import QtContacts 5.0 as QtContacts | ||
1059 | 20 | 21 | ||
1060 | 21 | Item { | 22 | Item { |
1061 | 22 | id: root | 23 | id: root |
1062 | @@ -31,7 +32,9 @@ | |||
1063 | 31 | 32 | ||
1064 | 32 | function updateDetails(contact) | 33 | function updateDetails(contact) |
1065 | 33 | { | 34 | { |
1067 | 34 | phoneNumberEntries.model = contact.phoneNumbers | 35 | if (contact) { |
1068 | 36 | phoneNumberEntries.model = contact.details(QtContacts.ContactDetail.PhoneNumber) | ||
1069 | 37 | } | ||
1070 | 35 | } | 38 | } |
1071 | 36 | 39 | ||
1072 | 37 | height: detailItems.height + units.gu(2) | 40 | height: detailItems.height + units.gu(2) |
1073 | @@ -56,7 +59,6 @@ | |||
1074 | 56 | Repeater { | 59 | Repeater { |
1075 | 57 | id: phoneNumberEntries | 60 | id: phoneNumberEntries |
1076 | 58 | 61 | ||
1077 | 59 | model: contact.phoneNumbers | ||
1078 | 60 | ListItem.Subtitled { | 62 | ListItem.Subtitled { |
1079 | 61 | anchors { | 63 | anchors { |
1080 | 62 | left: parent.left | 64 | left: parent.left |
1081 | @@ -66,7 +68,7 @@ | |||
1082 | 66 | showDivider: false | 68 | showDivider: false |
1083 | 67 | // TODO: change text font color to UbuntuColors.lightAubergine | 69 | // TODO: change text font color to UbuntuColors.lightAubergine |
1084 | 68 | // see bug #1324128 | 70 | // see bug #1324128 |
1086 | 69 | text: number | 71 | text: modelData.number |
1087 | 70 | subText: phoneTypeModel.get(phoneTypeModel.getTypeIndex(modelData)).label | 72 | subText: phoneTypeModel.get(phoneTypeModel.getTypeIndex(modelData)).label |
1088 | 71 | onClicked: root.detailClicked(modelData, "") | 73 | onClicked: root.detailClicked(modelData, "") |
1089 | 72 | 74 | ||
1090 | 73 | 75 | ||
1091 | === modified file 'src/imports/Ubuntu/Contacts/ContactListView.qml' | |||
1092 | --- src/imports/Ubuntu/Contacts/ContactListView.qml 2014-07-09 22:24:55 +0000 | |||
1093 | +++ src/imports/Ubuntu/Contacts/ContactListView.qml 2014-07-16 12:56:44 +0000 | |||
1094 | @@ -401,6 +401,7 @@ | |||
1095 | 401 | var areaY = view.contentY | 401 | var areaY = view.contentY |
1096 | 402 | if (itemY < areaY) { | 402 | if (itemY < areaY) { |
1097 | 403 | view.contentY = itemY | 403 | view.contentY = itemY |
1098 | 404 | view.returnToBounds() | ||
1099 | 404 | } | 405 | } |
1100 | 405 | } | 406 | } |
1101 | 406 | 407 | ||
1102 | @@ -411,16 +412,22 @@ | |||
1103 | 411 | height: visible ? childrenRect.height : 0 | 412 | height: visible ? childrenRect.height : 0 |
1104 | 412 | visible: view.favouritesIsSelected && (callerRepeat.count > 0) | 413 | visible: view.favouritesIsSelected && (callerRepeat.count > 0) |
1105 | 413 | onHeightChanged: { | 414 | onHeightChanged: { |
1106 | 414 | // make selected item fully visible | ||
1107 | 415 | if (calledModel.currentIndex != -1) { | 415 | if (calledModel.currentIndex != -1) { |
1108 | 416 | mostCalledView.makeItemVisible(callerRepeat.itemAt(calledModel.currentIndex)) | 416 | mostCalledView.makeItemVisible(callerRepeat.itemAt(calledModel.currentIndex)) |
1109 | 417 | } else { | ||
1110 | 418 | // WORKAROUND: The SDK header causes the contactY to move to a wrong postion | ||
1111 | 419 | // this should fix the Y position (630 is the header height) | ||
1112 | 420 | view.contentY = -630 | ||
1113 | 421 | } | 417 | } |
1114 | 422 | } | 418 | } |
1115 | 423 | 419 | ||
1116 | 420 | // WORKAROUND: The SDK header causes the contactY to move to a wrong postion | ||
1117 | 421 | // calling the positionViewAtBeginning after the list created fix that | ||
1118 | 422 | Timer { | ||
1119 | 423 | id: moveToBegining | ||
1120 | 424 | |||
1121 | 425 | interval: 100 | ||
1122 | 426 | running: false | ||
1123 | 427 | repeat: false | ||
1124 | 428 | onTriggered: view.positionViewAtBeginning() | ||
1125 | 429 | } | ||
1126 | 430 | |||
1127 | 424 | Rectangle { | 431 | Rectangle { |
1128 | 425 | color: Theme.palette.normal.background | 432 | color: Theme.palette.normal.background |
1129 | 426 | anchors { | 433 | anchors { |
1130 | @@ -453,6 +460,7 @@ | |||
1131 | 453 | 460 | ||
1132 | 454 | onVisibleChanged: { | 461 | onVisibleChanged: { |
1133 | 455 | // update the model every time that it became visible | 462 | // update the model every time that it became visible |
1134 | 463 | // in fact calling update only reloads the model data if it has changed | ||
1135 | 456 | if (visible) { | 464 | if (visible) { |
1136 | 457 | model.update() | 465 | model.update() |
1137 | 458 | } | 466 | } |
1138 | @@ -465,6 +473,10 @@ | |||
1139 | 465 | view.currentIndex = -1 | 473 | view.currentIndex = -1 |
1140 | 466 | } | 474 | } |
1141 | 467 | } | 475 | } |
1142 | 476 | |||
1143 | 477 | // WORKAROUND: The SDK header causes the contactY to move to a wrong postion | ||
1144 | 478 | // calling the positionViewAtBeginning after the list created fix that | ||
1145 | 479 | onLoaded: moveToBegining.restart() | ||
1146 | 468 | } | 480 | } |
1147 | 469 | } | 481 | } |
1148 | 470 | 482 | ||
1149 | @@ -624,8 +636,8 @@ | |||
1150 | 624 | id: fastScroll | 636 | id: fastScroll |
1151 | 625 | 637 | ||
1152 | 626 | listView: view | 638 | listView: view |
1155 | 627 | // only enable FastScroll if the we have more than 2 pages of content | 639 | // only enable FastScroll if the we have more than 2 pages of content and sections is enabled |
1156 | 628 | enabled: view.contentHeight > (view.height * 2) | 640 | enabled: showSections && (view.contentHeight > (view.height * 2)) |
1157 | 629 | 641 | ||
1158 | 630 | anchors { | 642 | anchors { |
1159 | 631 | top: view.top | 643 | top: view.top |
1160 | 632 | 644 | ||
1161 | === modified file 'src/imports/Ubuntu/Contacts/ContactSimpleListView.qml' | |||
1162 | --- src/imports/Ubuntu/Contacts/ContactSimpleListView.qml 2014-07-09 15:30:13 +0000 | |||
1163 | +++ src/imports/Ubuntu/Contacts/ContactSimpleListView.qml 2014-07-16 12:56:44 +0000 | |||
1164 | @@ -134,7 +134,7 @@ | |||
1165 | 134 | 134 | ||
1166 | 135 | This property holds the detail type to be picked | 135 | This property holds the detail type to be picked |
1167 | 136 | */ | 136 | */ |
1169 | 137 | property int detailToPick: 0 | 137 | property int detailToPick: -1 |
1170 | 138 | /*! | 138 | /*! |
1171 | 139 | \qmlproperty bool showSections | 139 | \qmlproperty bool showSections |
1172 | 140 | 140 | ||
1173 | @@ -358,10 +358,10 @@ | |||
1174 | 358 | contactListView.currentIndex = -1 | 358 | contactListView.currentIndex = -1 |
1175 | 359 | return | 359 | return |
1176 | 360 | // check if we should expand and display the details picker | 360 | // check if we should expand and display the details picker |
1178 | 361 | } else if (detailToPick !== 0) { | 361 | } else if (detailToPick !== -1) { |
1179 | 362 | contactListView.currentIndex = index | 362 | contactListView.currentIndex = index |
1180 | 363 | return | 363 | return |
1182 | 364 | } else if (detailToPick == 0) { | 364 | } else if (detailToPick == -1) { |
1183 | 365 | contactListView.detailClicked(contact, null, "") | 365 | contactListView.detailClicked(contact, null, "") |
1184 | 366 | } | 366 | } |
1185 | 367 | } | 367 | } |
1186 | 368 | 368 | ||
1187 | === modified file 'src/imports/Ubuntu/Contacts/ListItemWithActions.qml' | |||
1188 | --- src/imports/Ubuntu/Contacts/ListItemWithActions.qml 2014-07-05 01:00:05 +0000 | |||
1189 | +++ src/imports/Ubuntu/Contacts/ListItemWithActions.qml 2014-07-16 12:56:44 +0000 | |||
1190 | @@ -31,6 +31,8 @@ | |||
1191 | 31 | default property alias contents: main.children | 31 | default property alias contents: main.children |
1192 | 32 | 32 | ||
1193 | 33 | readonly property double actionWidth: units.gu(5) | 33 | readonly property double actionWidth: units.gu(5) |
1194 | 34 | readonly property double leftActionWidth: units.gu(10) | ||
1195 | 35 | readonly property double actionThreshold: actionWidth * 0.4 | ||
1196 | 34 | readonly property double threshold: 0.4 | 36 | readonly property double threshold: 0.4 |
1197 | 35 | readonly property string swipeState: main.x == 0 ? "Normal" : main.x > 0 ? "LeftToRight" : "RightToLeft" | 37 | readonly property string swipeState: main.x == 0 ? "Normal" : main.x > 0 ? "LeftToRight" : "RightToLeft" |
1198 | 36 | readonly property alias swipping: mainItemMoving.running | 38 | readonly property alias swipping: mainItemMoving.running |
1199 | @@ -40,27 +42,20 @@ | |||
1200 | 40 | 42 | ||
1201 | 41 | function returnToBoundsRTL() | 43 | function returnToBoundsRTL() |
1202 | 42 | { | 44 | { |
1203 | 45 | var actionFullWidth = actionWidth + units.gu(2) | ||
1204 | 43 | var xOffset = Math.abs(main.x) | 46 | var xOffset = Math.abs(main.x) |
1206 | 44 | var actionFullWidth = actionWidth + units.gu(1) | 47 | var index = Math.min(Math.floor(xOffset / actionFullWidth), rightSideActions.length) |
1207 | 45 | 48 | ||
1209 | 46 | if (xOffset < actionFullWidth) { | 49 | if (index < 1) { |
1210 | 47 | main.x = 0 | 50 | main.x = 0 |
1211 | 48 | } else if (xOffset > (actionFullWidth * rightActionsRepeater.count)) { | ||
1212 | 49 | main.x = - (actionFullWidth * rightActionsRepeater.count) | ||
1213 | 50 | } else { | 51 | } else { |
1221 | 51 | for (var i = rightActionsRepeater.count; i >= 2; i--) { | 52 | main.x = -(actionFullWidth * index) |
1215 | 52 | if (xOffset >= (actionFullWidth * i)) { | ||
1216 | 53 | main.x = -(actionWidth * i) | ||
1217 | 54 | return | ||
1218 | 55 | } | ||
1219 | 56 | } | ||
1220 | 57 | main.x = -actionWidth | ||
1222 | 58 | } | 53 | } |
1223 | 59 | } | 54 | } |
1224 | 60 | 55 | ||
1225 | 61 | function returnToBoundsLTR() | 56 | function returnToBoundsLTR() |
1226 | 62 | { | 57 | { |
1228 | 63 | var finalX = leftActionView.width | 58 | var finalX = leftActionWidth |
1229 | 64 | if (main.x > (finalX * root.threshold)) | 59 | if (main.x > (finalX * root.threshold)) |
1230 | 65 | main.x = finalX | 60 | main.x = finalX |
1231 | 66 | else | 61 | else |
1232 | @@ -99,16 +94,14 @@ | |||
1233 | 99 | 94 | ||
1234 | 100 | function updateActiveAction() | 95 | function updateActiveAction() |
1235 | 101 | { | 96 | { |
1246 | 102 | var xOffset = Math.abs(main.x) | 97 | if (main.x <= -root.actionWidth) { |
1247 | 103 | if (main.x < 0) { | 98 | var actionFullWidth = actionWidth + units.gu(2) |
1248 | 104 | for (var i = rightActionsRepeater.count - 1; i >= 0; i--) { | 99 | var xOffset = Math.abs(main.x) |
1249 | 105 | var child = rightActionsRepeater.itemAt(i) | 100 | var index = Math.min(Math.floor(xOffset / actionFullWidth), rightSideActions.length) |
1250 | 106 | var childOffset = rightActionsView.width - child.x | 101 | index = index - 1 |
1251 | 107 | if (xOffset <= childOffset) { | 102 | if (index > -1) { |
1252 | 108 | root.activeItem = child | 103 | root.activeItem = rightActionsRepeater.itemAt(index) |
1253 | 109 | root.activeAction = root.rightSideActions[i] | 104 | root.activeAction = root.rightSideActions[index] |
1244 | 110 | return | ||
1245 | 111 | } | ||
1254 | 112 | } | 105 | } |
1255 | 113 | } else { | 106 | } else { |
1256 | 114 | root.activeAction = null | 107 | root.activeAction = null |
1257 | @@ -129,14 +122,17 @@ | |||
1258 | 129 | anchors { | 122 | anchors { |
1259 | 130 | top: parent.top | 123 | top: parent.top |
1260 | 131 | bottom: parent.bottom | 124 | bottom: parent.bottom |
1262 | 132 | left: parent.left | 125 | right: main.left |
1263 | 133 | } | 126 | } |
1265 | 134 | width: height | 127 | width: root.leftActionWidth + actionThreshold |
1266 | 135 | visible: leftSideAction | 128 | visible: leftSideAction |
1267 | 136 | color: "red" | 129 | color: "red" |
1268 | 137 | 130 | ||
1269 | 138 | Icon { | 131 | Icon { |
1271 | 139 | anchors.centerIn: parent | 132 | anchors { |
1272 | 133 | centerIn: parent | ||
1273 | 134 | horizontalCenterOffset: actionThreshold / 2 | ||
1274 | 135 | } | ||
1275 | 140 | name: leftSideAction ? leftSideAction.iconName : "" | 136 | name: leftSideAction ? leftSideAction.iconName : "" |
1276 | 141 | color: Theme.palette.selected.field | 137 | color: Theme.palette.selected.field |
1277 | 142 | height: units.gu(3) | 138 | height: units.gu(3) |
1278 | @@ -149,13 +145,14 @@ | |||
1279 | 149 | 145 | ||
1280 | 150 | anchors { | 146 | anchors { |
1281 | 151 | top: main.top | 147 | top: main.top |
1283 | 152 | right: parent.right | 148 | left: main.right |
1284 | 149 | leftMargin: units.gu(1) | ||
1285 | 153 | bottom: main.bottom | 150 | bottom: main.bottom |
1286 | 154 | } | 151 | } |
1288 | 155 | width: rightActionsRepeater.count * (root.actionWidth + units.gu(1)) | 152 | width: rightActionsRepeater.count > 0 ? rightActionsRepeater.count * (root.actionWidth + units.gu(2)) + actionThreshold : 0 |
1289 | 156 | Row { | 153 | Row { |
1290 | 157 | anchors.fill: parent | 154 | anchors.fill: parent |
1292 | 158 | spacing: units.gu(1) | 155 | spacing: units.gu(2) |
1293 | 159 | Repeater { | 156 | Repeater { |
1294 | 160 | id: rightActionsRepeater | 157 | id: rightActionsRepeater |
1295 | 161 | 158 | ||
1296 | @@ -227,11 +224,6 @@ | |||
1297 | 227 | easing {type: Easing.InOutBack; } | 224 | easing {type: Easing.InOutBack; } |
1298 | 228 | } | 225 | } |
1299 | 229 | } | 226 | } |
1300 | 230 | ScriptAction { | ||
1301 | 231 | script: { | ||
1302 | 232 | root.activeAction.triggered(root) | ||
1303 | 233 | } | ||
1304 | 234 | } | ||
1305 | 235 | PropertyAction { | 227 | PropertyAction { |
1306 | 236 | target: triggerAction.currentItem | 228 | target: triggerAction.currentItem |
1307 | 237 | properties: "width, height" | 229 | properties: "width, height" |
1308 | @@ -249,6 +241,11 @@ | |||
1309 | 249 | easing.type: Easing.OutElastic | 241 | easing.type: Easing.OutElastic |
1310 | 250 | duration: UbuntuAnimation.SlowDuration | 242 | duration: UbuntuAnimation.SlowDuration |
1311 | 251 | } | 243 | } |
1312 | 244 | ScriptAction { | ||
1313 | 245 | script: { | ||
1314 | 246 | root.activeAction.triggered(root) | ||
1315 | 247 | } | ||
1316 | 248 | } | ||
1317 | 252 | } | 249 | } |
1318 | 253 | 250 | ||
1319 | 254 | MouseArea { | 251 | MouseArea { |
1320 | 255 | 252 | ||
1321 | === modified file 'src/imports/Ubuntu/Contacts/MostCalledModel.qml' | |||
1322 | --- src/imports/Ubuntu/Contacts/MostCalledModel.qml 2014-07-03 19:35:30 +0000 | |||
1323 | +++ src/imports/Ubuntu/Contacts/MostCalledModel.qml 2014-07-16 12:56:44 +0000 | |||
1324 | @@ -25,14 +25,18 @@ | |||
1325 | 25 | 25 | ||
1326 | 26 | property var contactModel: null | 26 | property var contactModel: null |
1327 | 27 | property int currentIndex: -1 | 27 | property int currentIndex: -1 |
1328 | 28 | property alias callAverage: mostCalledModel.callAverage | ||
1329 | 28 | 29 | ||
1330 | 29 | signal clicked(int index, QtObject contact) | 30 | signal clicked(int index, QtObject contact) |
1331 | 30 | signal detailClicked(QtObject contact, QtObject detail, string action) | 31 | signal detailClicked(QtObject contact, QtObject detail, string action) |
1332 | 31 | signal infoRequested(int index, QtObject contact) | 32 | signal infoRequested(int index, QtObject contact) |
1333 | 32 | signal addContactClicked(string label) | 33 | signal addContactClicked(string label) |
1334 | 34 | signal loaded() | ||
1335 | 33 | 35 | ||
1336 | 34 | 36 | ||
1337 | 35 | model: MostCalledContactsModel { | 37 | model: MostCalledContactsModel { |
1338 | 38 | id: mostCalledModel | ||
1339 | 39 | |||
1340 | 36 | startInterval: new Date((new Date().getTime() - 2592000000)) // one month ago | 40 | startInterval: new Date((new Date().getTime() - 2592000000)) // one month ago |
1341 | 37 | sourceModel: HistoryEventModel { | 41 | sourceModel: HistoryEventModel { |
1342 | 38 | type: HistoryThreadModel.EventTypeVoice | 42 | type: HistoryThreadModel.EventTypeVoice |
1343 | @@ -46,6 +50,7 @@ | |||
1344 | 46 | matchFlags: HistoryFilter.MatchCaseSensitive | 50 | matchFlags: HistoryFilter.MatchCaseSensitive |
1345 | 47 | } | 51 | } |
1346 | 48 | } | 52 | } |
1347 | 53 | onLoaded: root.loaded() | ||
1348 | 49 | } | 54 | } |
1349 | 50 | 55 | ||
1350 | 51 | delegate: ContactDelegate { | 56 | delegate: ContactDelegate { |
1351 | @@ -79,12 +84,10 @@ | |||
1352 | 79 | onClicked: { | 84 | onClicked: { |
1353 | 80 | if (root.currentIndex === index) { | 85 | if (root.currentIndex === index) { |
1354 | 81 | root.currentIndex = -1 | 86 | root.currentIndex = -1 |
1357 | 82 | return | 87 | } else if (detailToPick !== -1) { |
1356 | 83 | } else if (detailToPick !== 0) { | ||
1358 | 84 | root.currentIndex = index | 88 | root.currentIndex = index |
1362 | 85 | return | 89 | } else if (detailToPick === -1) { |
1363 | 86 | } else if (detailToPick == 0) { | 90 | detailClicked(contact, null, "") |
1361 | 87 | contactListView.detailClicked(contact, null, "") | ||
1364 | 88 | } | 91 | } |
1365 | 89 | } | 92 | } |
1366 | 90 | 93 | ||
1367 | 91 | 94 | ||
1368 | === modified file 'src/imports/Ubuntu/Contacts/mostcalledproxymodel.cpp' | |||
1369 | --- src/imports/Ubuntu/Contacts/mostcalledproxymodel.cpp 2014-07-02 01:43:06 +0000 | |||
1370 | +++ src/imports/Ubuntu/Contacts/mostcalledproxymodel.cpp 2014-07-16 12:56:44 +0000 | |||
1371 | @@ -272,8 +272,7 @@ | |||
1372 | 272 | qSort(data.begin(), data.end(), mostCalledContactsModelDataLessThan); | 272 | qSort(data.begin(), data.end(), mostCalledContactsModelDataLessThan); |
1373 | 273 | 273 | ||
1374 | 274 | // average | 274 | // average |
1377 | 275 | m_average = totalCalls / contactsData.size(); | 275 | m_average = qRound(((qreal) (totalCalls)) / contactsData.size()); |
1376 | 276 | |||
1378 | 277 | Q_FOREACH(const MostCalledContactsModelData &d, data) { | 276 | Q_FOREACH(const MostCalledContactsModelData &d, data) { |
1379 | 278 | if (d.callCount >= m_average) { | 277 | if (d.callCount >= m_average) { |
1380 | 279 | m_data << d; | 278 | m_data << d; |
1381 | @@ -286,6 +285,8 @@ | |||
1382 | 286 | 285 | ||
1383 | 287 | Q_EMIT endResetModel(); | 286 | Q_EMIT endResetModel(); |
1384 | 288 | m_reloadingModel = false; | 287 | m_reloadingModel = false; |
1385 | 288 | Q_EMIT callAverageChanged(m_average); | ||
1386 | 289 | Q_EMIT loaded(); | ||
1387 | 289 | } | 290 | } |
1388 | 290 | 291 | ||
1389 | 291 | void MostCalledContactsModel::markAsOutdated() | 292 | void MostCalledContactsModel::markAsOutdated() |
1390 | 292 | 293 | ||
1391 | === modified file 'src/imports/Ubuntu/Contacts/mostcalledproxymodel.h' | |||
1392 | --- src/imports/Ubuntu/Contacts/mostcalledproxymodel.h 2014-07-02 01:43:06 +0000 | |||
1393 | +++ src/imports/Ubuntu/Contacts/mostcalledproxymodel.h 2014-07-16 12:56:44 +0000 | |||
1394 | @@ -73,6 +73,7 @@ | |||
1395 | 73 | void startIntervalChanged(const QDateTime &value); | 73 | void startIntervalChanged(const QDateTime &value); |
1396 | 74 | void sourceModelChanged(QAbstractItemModel *value); | 74 | void sourceModelChanged(QAbstractItemModel *value); |
1397 | 75 | void outdatedChange(bool value); | 75 | void outdatedChange(bool value); |
1398 | 76 | void loaded(); | ||
1399 | 76 | 77 | ||
1400 | 77 | private Q_SLOTS: | 78 | private Q_SLOTS: |
1401 | 78 | void markAsOutdated(); | 79 | void markAsOutdated(); |
FAILED: Continuous integration, rev:210 jenkins. qa.ubuntu. com/job/ address- book-app- ci/588/ jenkins. qa.ubuntu. com/job/ address- book-app- utopic- amd64-ci/ 41/console jenkins. qa.ubuntu. com/job/ address- book-app- utopic- armhf-ci/ 41/console jenkins. qa.ubuntu. com/job/ address- book-app- utopic- i386-ci/ 41/console jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- utopic- touch/930/ console jenkins. qa.ubuntu. com/job/ generic- mediumtests- utopic/ 846/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/1681/ console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- amd64/986/ console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/address- book-app- ci/588/ rebuild
http://