Merge lp:~renatofilho/address-book-app/contact-share into lp:~phablet-team/address-book-app/staging
- contact-share
- Merge into staging
Status: | Superseded |
---|---|
Proposed branch: | lp:~renatofilho/address-book-app/contact-share |
Merge into: | lp:~phablet-team/address-book-app/staging |
Prerequisite: | lp:~renatofilho/address-book-app/new-designer-contact-list |
Diff against target: |
617 lines (+138/-248) 14 files modified
CMakeLists.txt (+0/-1) click/address-book-content.json (+3/-0) debian/control (+0/-1) src/app/CMakeLists.txt (+0/-7) src/app/addressbookapp.cpp (+0/-10) src/app/addressbookapp.h (+0/-3) src/app/contentcommunicator.cpp (+0/-140) src/app/contentcommunicator.h (+0/-61) src/imports/CMakeLists.txt (+1/-0) src/imports/ContactList/ContactListPage.qml (+44/-19) src/imports/ContactShare/CMakeLists.txt (+10/-0) src/imports/ContactShare/ContactSharePage.qml (+62/-0) src/imports/ContactView/ContactView.qml (+11/-0) src/imports/MainWindow.qml (+7/-6) |
To merge this branch: | bzr merge lp:~renatofilho/address-book-app/contact-share |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Needs Fixing | |
Michael Sheldon (community) | Approve | ||
Review via email: mp+221778@code.launchpad.net |
This proposal has been superseded by a proposal from 2014-06-11.
Commit message
Implemented contact share.
Replaced ContentHub API with QML API.
Description of the change
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:235
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
Michael Sheldon (michael-sheldon) wrote : | # |
Couple of issue, when sharing I'm now getting:
file://
And when either exporting to another application or sharing, the exported .vcf file contains *all* contacts, not just the selected/shared ones.
Also as a minor thing the import of Ubuntu.
Renato Araujo Oliveira Filho (renatofilho) wrote : | # |
Are there any related MPs required for this MP to build/function as expected? YES
lp:~renatofilho/address-book-app/new-designer-contact-list
Is your branch in sync with latest trunk: 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 on device or emulator? ?YES
If you changed the UI, was the change specified/approved by design? NO UI CHANGE
If you changed the packaging (debian), did you subscribe a core-dev to this MP? NO PACKAGE CHANGE
Renato Araujo Oliveira Filho (renatofilho) wrote : | # |
Are there any related MPs required for this MP to build/function as expected? YES
lp:~renatofilho/address-book-app/new-designer-contact-list
Is your branch in sync with latest trunk: 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 on device or emulator? ?YES
If you changed the UI, was the change specified/approved by design? NO UI CHANGE
If you changed the packaging (debian), did you subscribe a core-dev to this MP? YES
Michael Sheldon (michael-sheldon) 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.
* Failed due to unrelated issues (old SDK package in Jenkins)
Have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut?
* Yes
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:236
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:236
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:236
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
- 184. By Renato Araujo Oliveira Filho
-
Implemented contact share.
Removed contenthub c++ code.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:237
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 185. By Renato Araujo Oliveira Filho
-
Merged mainline.
Unmerged revisions
- 183. By Renato Araujo Oliveira Filho
-
Update app visuals.
Implemented fast scroll. Fixes: https://bugs.launchpad .net/bugs/ 1317445. Approved by Gustavo Pichorim Boiko, PS Jenkins bot.
- 182. By Renato Araujo Oliveira Filho
-
Implemented contact search. Fixes: https:/
/bugs.launchpad .net/bugs/ 1267248. Approved by PS Jenkins bot, Tiago Salem Herrmann.
- 181. By Renato Araujo Oliveira Filho
-
Fixed click mode compilation.
- 180. By Leo Arias
-
Log autopilot warnings to a file temporary, because of bug 1327325. Fixes: https:/
/bugs.launchpad .net/bugs/ 1327325. Approved by PS Jenkins bot, Renato Araujo Oliveira Filho.
- 179. By Renato Araujo Oliveira Filho
-
Merged mainline.
- 178. By Leo Arias
-
Initial refactor of autopilot tests.
Approved by PS Jenkins bot, Renato Araujo Oliveira Filho, Chris Gagnon.
- 177. By Renato Araujo Oliveira Filho
-
Used new SDK header.
- 176. By Renato Araujo Oliveira Filho
-
Merged trunk.
Preview Diff
1 | === modified file 'CMakeLists.txt' |
2 | --- CMakeLists.txt 2014-06-05 16:35:45 +0000 |
3 | +++ CMakeLists.txt 2014-06-11 21:25:54 +0000 |
4 | @@ -17,7 +17,6 @@ |
5 | find_package(Qt5Quick) |
6 | find_package(Qt5DBus) |
7 | find_package(PkgConfig REQUIRED) |
8 | -pkg_check_modules(CONTENTHUB REQUIRED libcontent-hub) |
9 | |
10 | set(ADDRESS_BOOK_APP_DIR ${CMAKE_INSTALL_DATADIR}/address-book-app) |
11 | set(ADDRESS_BOOK_APP_FULL_DIR ${CMAKE_INSTALL_FULL_DATADIR}/address-book-app) |
12 | |
13 | === modified file 'click/address-book-content.json' |
14 | --- click/address-book-content.json 2014-03-12 01:34:34 +0000 |
15 | +++ click/address-book-content.json 2014-06-11 21:25:54 +0000 |
16 | @@ -1,4 +1,7 @@ |
17 | { |
18 | + "destination": [ |
19 | + "contacts" |
20 | + ], |
21 | "source": [ |
22 | "contacts" |
23 | ] |
24 | |
25 | === modified file 'debian/control' |
26 | --- debian/control 2014-06-06 21:02:16 +0000 |
27 | +++ debian/control 2014-06-11 21:25:54 +0000 |
28 | @@ -5,7 +5,6 @@ |
29 | Build-Depends: cmake, |
30 | debhelper (>= 9), |
31 | dh-translations, |
32 | - libcontent-hub-dev, |
33 | libgl1-mesa-dev | libgl-dev, |
34 | libgles2-mesa-dev, |
35 | python3, |
36 | |
37 | === modified file 'src/app/CMakeLists.txt' |
38 | --- src/app/CMakeLists.txt 2014-05-28 20:25:19 +0000 |
39 | +++ src/app/CMakeLists.txt 2014-06-11 21:25:54 +0000 |
40 | @@ -4,14 +4,11 @@ |
41 | |
42 | include_directories( |
43 | ${CMAKE_BINARY_DIR} |
44 | - ${CONTENTHUB_INCLUDE_DIRS} |
45 | ) |
46 | |
47 | set(ADDRESS_BOOK_APP_SRCS |
48 | addressbookapp.h |
49 | addressbookapp.cpp |
50 | - contentcommunicator.h |
51 | - contentcommunicator.cpp |
52 | imagescalethread.h |
53 | imagescalethread.cpp |
54 | main.cpp |
55 | @@ -23,10 +20,6 @@ |
56 | |
57 | qt5_use_modules(${ADDRESS_BOOK_APP_BIN} Gui Core Qml Quick DBus) |
58 | |
59 | -target_link_libraries(${ADDRESS_BOOK_APP_BIN} |
60 | - ${CONTENTHUB_LIBRARIES} |
61 | -) |
62 | - |
63 | install(TARGETS ${ADDRESS_BOOK_APP_BIN} |
64 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} |
65 | ) |
66 | |
67 | === modified file 'src/app/addressbookapp.cpp' |
68 | --- src/app/addressbookapp.cpp 2014-06-05 19:22:08 +0000 |
69 | +++ src/app/addressbookapp.cpp 2014-06-11 21:25:54 +0000 |
70 | @@ -17,7 +17,6 @@ |
71 | #include "config.h" |
72 | #include "addressbookapp.h" |
73 | #include "imagescalethread.h" |
74 | -#include "contentcommunicator.h" |
75 | |
76 | #include <QDir> |
77 | #include <QUrl> |
78 | @@ -94,7 +93,6 @@ |
79 | AddressBookApp::AddressBookApp(int &argc, char **argv) |
80 | : QGuiApplication(argc, argv), |
81 | m_view(0), |
82 | - m_contentComm(0), |
83 | m_syncMonitor(0), |
84 | m_pickingMode(false), |
85 | m_testMode(false), |
86 | @@ -151,10 +149,7 @@ |
87 | qCritical("Library qttestability load failed!"); |
88 | } |
89 | m_testMode = true; |
90 | - } else { |
91 | - m_contentComm = new ContentCommunicator(this); |
92 | } |
93 | - |
94 | /* Ubuntu APP Manager gathers info on the list of running applications from the .desktop |
95 | file specified on the command line with the desktop_file_hint switch, and will also pass a stage hint |
96 | So app will be launched like this: |
97 | @@ -186,7 +181,6 @@ |
98 | m_view->setTitle("AddressBook"); |
99 | m_view->engine()->addImportPath(QCoreApplication::applicationDirPath() + "/" + importPath("")); |
100 | m_view->rootContext()->setContextProperty("QTCONTACTS_MANAGER_OVERRIDE", defaultManager); |
101 | - m_view->rootContext()->setContextProperty("contactContentHub", m_contentComm); |
102 | m_view->rootContext()->setContextProperty("application", this); |
103 | m_view->rootContext()->setContextProperty("contactKey", contactKey); |
104 | m_view->rootContext()->setContextProperty("TEST_DATA", testData); |
105 | @@ -220,10 +214,6 @@ |
106 | if (m_view) { |
107 | delete m_view; |
108 | } |
109 | - |
110 | - if (m_contentComm) { |
111 | - delete m_contentComm; |
112 | - } |
113 | } |
114 | |
115 | void AddressBookApp::onViewStatusChanged(QQuickView::Status status) |
116 | |
117 | === modified file 'src/app/addressbookapp.h' |
118 | --- src/app/addressbookapp.h 2014-05-09 20:00:09 +0000 |
119 | +++ src/app/addressbookapp.h 2014-06-11 21:25:54 +0000 |
120 | @@ -22,8 +22,6 @@ |
121 | #include <QtGui/QGuiApplication> |
122 | #include <QtQuick/QQuickView> |
123 | |
124 | -class ContentCommunicator; |
125 | - |
126 | class AddressBookApp : public QGuiApplication |
127 | { |
128 | Q_OBJECT |
129 | @@ -62,7 +60,6 @@ |
130 | |
131 | private: |
132 | QQuickView *m_view; |
133 | - ContentCommunicator *m_contentComm; |
134 | QDBusInterface *m_syncMonitor; |
135 | QString m_initialArg; |
136 | bool m_viewReady; |
137 | |
138 | === removed file 'src/app/contentcommunicator.cpp' |
139 | --- src/app/contentcommunicator.cpp 2014-03-12 00:58:11 +0000 |
140 | +++ src/app/contentcommunicator.cpp 1970-01-01 00:00:00 +0000 |
141 | @@ -1,140 +0,0 @@ |
142 | -/* |
143 | - * Copyright (C) 2013 Canonical, Ltd. |
144 | - * |
145 | - * This program is free software; you can redistribute it and/or modify |
146 | - * it under the terms of the GNU General Public License as published by |
147 | - * the Free Software Foundation; version 3. |
148 | - * |
149 | - * This program is distributed in the hope that it will be useful, |
150 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
151 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
152 | - * GNU General Public License for more details. |
153 | - * |
154 | - * You should have received a copy of the GNU General Public License |
155 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
156 | - * |
157 | - */ |
158 | - |
159 | -#include <contentcommunicator.h> |
160 | - |
161 | -#include <QDebug> |
162 | -#include <QTemporaryFile> |
163 | -#include <QDir> |
164 | - |
165 | -#include <com/ubuntu/content/hub.h> |
166 | -#include <com/ubuntu/content/item.h> |
167 | -#include <com/ubuntu/content/transfer.h> |
168 | - |
169 | -using namespace com::ubuntu::content; |
170 | - |
171 | -/*! |
172 | - * \brief ContentCommunicator::ContentCommunicator |
173 | - * \param parent |
174 | - */ |
175 | -ContentCommunicator::ContentCommunicator(QObject *parent) |
176 | - : ImportExportHandler(parent), |
177 | - m_transfer(0) |
178 | -{ |
179 | - Hub *hub = Hub::Client::instance(); |
180 | - if (hub) { |
181 | - hub->register_import_export_handler(this); |
182 | - } else { |
183 | - qWarning() << "Fail to get Hub client instance"; |
184 | - } |
185 | -} |
186 | - |
187 | -/*! |
188 | - * \brief \reimp |
189 | - */ |
190 | -void ContentCommunicator::handle_import(content::Transfer *) |
191 | -{ |
192 | - qDebug() << Q_FUNC_INFO << "address book app does not import content"; |
193 | -} |
194 | - |
195 | -/*! |
196 | - * \brief \reimp |
197 | - */ |
198 | -void ContentCommunicator::handle_export(content::Transfer *transfer) |
199 | -{ |
200 | - if (m_transfer != 0) { |
201 | - qWarning() << "address book app does only one content export at a time"; |
202 | - transfer->abort(); |
203 | - m_transfer = 0; |
204 | - return; |
205 | - } |
206 | - |
207 | - if (transfer) { |
208 | - m_transfer = transfer; |
209 | - connect(m_transfer, SIGNAL(selectionTypeChanged()), SIGNAL(multipleItemsChanged())); |
210 | - } else { |
211 | - qWarning() << "Transfer pointer is null in handle_export"; |
212 | - } |
213 | - Q_EMIT contactRequested(); |
214 | - Q_EMIT activeChanged(); |
215 | - Q_EMIT multipleItemsChanged(); |
216 | -} |
217 | - |
218 | -/*! |
219 | - * \brief \reimp |
220 | - */ |
221 | -void ContentCommunicator::handle_share(content::Transfer *) |
222 | -{ |
223 | - qDebug() << Q_FUNC_INFO << "address book app does not share content"; |
224 | -} |
225 | - |
226 | -/*! |
227 | - * \brief ContentCommunicator::cancelTransfer aborts the current transfer |
228 | - */ |
229 | -void ContentCommunicator::cancelTransfer() |
230 | -{ |
231 | - if (!m_transfer) { |
232 | - qWarning() << "No ongoing transfer to cancel"; |
233 | - return; |
234 | - } |
235 | - |
236 | - m_transfer->abort(); |
237 | - m_transfer = 0; |
238 | - Q_EMIT activeChanged(); |
239 | -} |
240 | - |
241 | -/*! |
242 | - * \brief ContentCommunicator::returnContacts returns the given contacts |
243 | - * via content hub to the requester |
244 | - * \param urls |
245 | - */ |
246 | -void ContentCommunicator::returnContacts(const QUrl &contactsFile) |
247 | -{ |
248 | - if (!m_transfer) { |
249 | - qWarning() << "No ongoing transfer to return a contact"; |
250 | - return; |
251 | - } |
252 | - |
253 | - QVector<Item> items; |
254 | - items << contactsFile; |
255 | - m_transfer->charge(items); |
256 | - m_transfer = 0; |
257 | - Q_EMIT activeChanged(); |
258 | -} |
259 | - |
260 | -bool ContentCommunicator::isActive() const |
261 | -{ |
262 | - return (m_transfer != 0); |
263 | -} |
264 | - |
265 | -bool ContentCommunicator::isMultipleItems() const |
266 | -{ |
267 | - return (m_transfer && m_transfer->selectionType() == Transfer::multiple); |
268 | -} |
269 | - |
270 | -QUrl ContentCommunicator::createTemporaryFile() const |
271 | -{ |
272 | - QTemporaryFile tmp(QDir::tempPath() + "/vcard_XXXXXX.vcf"); |
273 | - tmp.setAutoRemove(false); |
274 | - if (!tmp.open()) { |
275 | - qWarning() << "Fail to create temporary file for vcard."; |
276 | - return QUrl(); |
277 | - } |
278 | - QString tmpFileName = tmp.fileName(); |
279 | - tmp.close(); |
280 | - return QUrl::fromLocalFile(tmpFileName); |
281 | -} |
282 | |
283 | === removed file 'src/app/contentcommunicator.h' |
284 | --- src/app/contentcommunicator.h 2014-03-12 00:58:11 +0000 |
285 | +++ src/app/contentcommunicator.h 1970-01-01 00:00:00 +0000 |
286 | @@ -1,61 +0,0 @@ |
287 | -/* |
288 | - * Copyright (C) 2013 Canonical, Ltd. |
289 | - * |
290 | - * This program is free software; you can redistribute it and/or modify |
291 | - * it under the terms of the GNU General Public License as published by |
292 | - * the Free Software Foundation; version 3. |
293 | - * |
294 | - * This program is distributed in the hope that it will be useful, |
295 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
296 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
297 | - * GNU General Public License for more details. |
298 | - * |
299 | - * You should have received a copy of the GNU General Public License |
300 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
301 | - * |
302 | - */ |
303 | - |
304 | -#ifndef CONTENTCOMMUNICATOR_H |
305 | -#define CONTENTCOMMUNICATOR_H |
306 | - |
307 | -#include <com/ubuntu/content/import_export_handler.h> |
308 | -#include <com/ubuntu/content/transfer.h> |
309 | - |
310 | -#include <QStringList> |
311 | - |
312 | -using namespace com::ubuntu; |
313 | - |
314 | -/*! |
315 | - * Class to handle the communication with the content manager |
316 | - */ |
317 | -class ContentCommunicator : public content::ImportExportHandler |
318 | -{ |
319 | - Q_OBJECT |
320 | - Q_PROPERTY(bool active READ isActive NOTIFY activeChanged) |
321 | - Q_PROPERTY(bool multipleItems READ isMultipleItems NOTIFY multipleItemsChanged) |
322 | - |
323 | -public: |
324 | - ContentCommunicator(QObject *parent = 0); |
325 | - |
326 | - virtual void handle_import(content::Transfer*); |
327 | - virtual void handle_export(content::Transfer *transfer); |
328 | - virtual void handle_share(content::Transfer*); |
329 | - |
330 | - bool isActive() const; |
331 | - bool isMultipleItems() const; |
332 | - |
333 | -public Q_SLOTS: |
334 | - void cancelTransfer(); |
335 | - void returnContacts(const QUrl &contactsFile); |
336 | - QUrl createTemporaryFile() const; |
337 | - |
338 | -Q_SIGNALS: |
339 | - void contactRequested(); |
340 | - void activeChanged(); |
341 | - void multipleItemsChanged(); |
342 | - |
343 | -private: |
344 | - content::Transfer *m_transfer; |
345 | -}; |
346 | - |
347 | -#endif // CONTENTCOMMUNICATOR_H |
348 | |
349 | === modified file 'src/imports/CMakeLists.txt' |
350 | --- src/imports/CMakeLists.txt 2013-11-12 15:52:18 +0000 |
351 | +++ src/imports/CMakeLists.txt 2014-06-11 21:25:54 +0000 |
352 | @@ -13,4 +13,5 @@ |
353 | add_subdirectory(ContactList) |
354 | add_subdirectory(ContactView) |
355 | add_subdirectory(ContactEdit) |
356 | +add_subdirectory(ContactShare) |
357 | add_subdirectory(Ubuntu) |
358 | |
359 | === modified file 'src/imports/ContactList/ContactListPage.qml' |
360 | --- src/imports/ContactList/ContactListPage.qml 2014-06-09 22:45:19 +0000 |
361 | +++ src/imports/ContactList/ContactListPage.qml 2014-06-11 21:25:54 +0000 |
362 | @@ -21,6 +21,7 @@ |
363 | import Ubuntu.Components.ListItems 0.1 as ListItem |
364 | import Ubuntu.Contacts 0.1 as ContactsUI |
365 | import Ubuntu.Components.Popups 0.1 as Popups |
366 | +import Ubuntu.Content 0.1 as ContentHub |
367 | import "../ContactEdit" |
368 | import "../Common" |
369 | |
370 | @@ -29,6 +30,7 @@ |
371 | objectName: "contactListPage" |
372 | |
373 | property bool pickMode: false |
374 | + property alias contentHubTransfer: contactExporter.activeTransfer |
375 | property bool pickMultipleContacts: false |
376 | property var onlineAccountsMessageDialog: null |
377 | property QtObject contactIndex: null |
378 | @@ -125,7 +127,8 @@ |
379 | detailToPick: ContactDetail.PhoneNumber |
380 | multiSelectionEnabled: true |
381 | multipleSelection: !pickMode || |
382 | - ((contactContentHub && contactContentHub.multipleItems) || mainPage.pickMultipleContacts) |
383 | + mainPage.pickMultipleContacts || (contactExporter.active && contactExporter.isMultiple) |
384 | + |
385 | DetailFilter { |
386 | id: nameFilter |
387 | |
388 | @@ -190,9 +193,7 @@ |
389 | for (var i=0; i < items.count; i++) { |
390 | contacts.push(items.get(i).model.contact) |
391 | } |
392 | - exporter.contactModel = contactList.listModel |
393 | - exporter.contacts = contacts |
394 | - exporter.start() |
395 | + contactExporter.exportContacts(contacts) |
396 | } else { |
397 | var contacts = [] |
398 | |
399 | @@ -207,8 +208,8 @@ |
400 | |
401 | onSelectionCanceled: { |
402 | if (pickMode) { |
403 | - if (contactContentHub) { |
404 | - contactContentHub.cancelTransfer() |
405 | + if (contentHubTransfer) { |
406 | + contentHubTransfer.state = ContentTransfer.Aborted |
407 | } |
408 | pageStack.pop() |
409 | application.returnVcard("") |
410 | @@ -442,20 +443,37 @@ |
411 | } |
412 | } |
413 | |
414 | - ContactExporter { |
415 | - id: exporter |
416 | - contactModel: contactList.listModel ? contactList.listModel : null |
417 | - outputFile: contactContentHub ? contactContentHub.createTemporaryFile() : "/tmp/vcard_address_book_app.vcf" |
418 | - onCompleted: { |
419 | - if (contactContentHub) { |
420 | - if (error == ContactModel.ExportNoError) { |
421 | - contactContentHub.returnContacts(exporter.outputFile) |
422 | - } else { |
423 | - contactContentHub.cancelTransfer() |
424 | - } |
425 | + |
426 | + QtObject { |
427 | + id: contactExporter |
428 | + |
429 | + property var activeTransfer: null |
430 | + readonly property bool active: activeTransfer && (activeTransfer.state === ContentHub.ContentTransfer.InProgress && activeTransfer.direction === ContentHub.ContentTransfer.Import) |
431 | + readonly property bool isMultiple: activeTransfer && (activeTransfer.selectionType === ContentHub.ContentTransfer.Multiple) |
432 | + |
433 | + function exportContacts(contacts) |
434 | + { |
435 | + if (activeTransfer) { |
436 | + var exportUrl = "file:///tmp/address_book_app_export.vcf" |
437 | + mainPage.contactModel.exportCompleted.connect(contactExporter.onExportCompleted) |
438 | + mainPage.contactModel.exportContacts(exportUrl, [], contacts) |
439 | + } else { |
440 | + console.error("Export requested with noo active transfer") |
441 | + } |
442 | + } |
443 | + |
444 | + function onExportCompleted(error, url) |
445 | + { |
446 | + mainPage.contactModel.exportCompleted.disconnect(contactExporter.onExportCompleted) |
447 | + if (error === ContactModel.ExportNoError) { |
448 | + var obj = Qt.createQmlObject("import Ubuntu.Content 0.1; ContentItem { url: '" + url + "' }", contactExporter) |
449 | + activeTransfer.items = [obj] |
450 | + activeTransfer.state = ContentHub.ContentTransfer.Charged |
451 | + } else { |
452 | + console.error("Fail to export contacts:" + error) |
453 | } |
454 | pageStack.pop() |
455 | - application.returnVcard(exporter.outputFile) |
456 | + application.returnVcard(url) |
457 | } |
458 | } |
459 | |
460 | @@ -479,7 +497,6 @@ |
461 | } |
462 | } |
463 | |
464 | - |
465 | Component.onCompleted: { |
466 | if (pickMode) { |
467 | contactList.startSelection() |
468 | @@ -492,5 +509,13 @@ |
469 | if (TEST_DATA != "") { |
470 | contactList.listModel.importContacts("file://" + TEST_DATA) |
471 | } |
472 | + |
473 | + if (!pickMode) { |
474 | + mainPage.setBottomEdgePage(Qt.resolvedUrl("../ContactEdit/ContactEditor.qml"), |
475 | + {model: contactList.listModel, |
476 | + contact: mainPage.createEmptyContact(""), |
477 | + active: false, |
478 | + enabled: false}) |
479 | + } |
480 | } |
481 | } |
482 | |
483 | === added directory 'src/imports/ContactShare' |
484 | === added file 'src/imports/ContactShare/CMakeLists.txt' |
485 | --- src/imports/ContactShare/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
486 | +++ src/imports/ContactShare/CMakeLists.txt 2014-06-11 21:25:54 +0000 |
487 | @@ -0,0 +1,10 @@ |
488 | +set(CONTACT_SHARE_QMLS |
489 | + ContactSharePage.qml |
490 | +) |
491 | + |
492 | +install(FILES ${CONTACT_SHARE_QMLS} |
493 | + DESTINATION ${ADDRESS_BOOK_APP_DIR}/imports/ContactShare |
494 | +) |
495 | + |
496 | +# make the files visible on qtcreator |
497 | +add_custom_target(contact_share_QmlFiles ALL SOURCES ${CONTACT_SHARE_QMLS}) |
498 | |
499 | === added file 'src/imports/ContactShare/ContactSharePage.qml' |
500 | --- src/imports/ContactShare/ContactSharePage.qml 1970-01-01 00:00:00 +0000 |
501 | +++ src/imports/ContactShare/ContactSharePage.qml 2014-06-11 21:25:54 +0000 |
502 | @@ -0,0 +1,62 @@ |
503 | +/* |
504 | + * Copyright (C) 2012-2014 Canonical, Ltd. |
505 | + * |
506 | + * This program is free software; you can redistribute it and/or modify |
507 | + * it under the terms of the GNU General Public License as published by |
508 | + * the Free Software Foundation; version 3. |
509 | + * |
510 | + * This program is distributed in the hope that it will be useful, |
511 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
512 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
513 | + * GNU General Public License for more details. |
514 | + * |
515 | + * You should have received a copy of the GNU General Public License |
516 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
517 | + */ |
518 | + |
519 | +import QtQuick 2.2 |
520 | +import QtContacts 5.0 |
521 | +import Ubuntu.Components 0.1 |
522 | +import Ubuntu.Content 0.1 as ContentHub |
523 | + |
524 | +Page { |
525 | + id: picker |
526 | + |
527 | + property var contactModel |
528 | + property var contact |
529 | + property var curTransfer |
530 | + |
531 | + ContentHub.ContentPeerPicker { |
532 | + visible: true |
533 | + anchors.fill: parent |
534 | + contentType: ContentHub.ContentType.Contacts |
535 | + handler: ContentHub.ContentHandler.Share |
536 | + |
537 | + onPeerSelected: { |
538 | + picker.curTransfer = peer.request(); |
539 | + if (picker.curTransfer.state === ContentHub.ContentTransfer.InProgress) { |
540 | + var vCardUrl = "file:///tmp/vcard_" + encodeURIComponent(contact.contactId) + ".vcf" |
541 | + picker.contactModel.exportContacts(vCardUrl, [], [picker.contact]) |
542 | + } |
543 | + } |
544 | + |
545 | + onCancelPressed: pageStack.pop() |
546 | + } |
547 | + |
548 | + Connections { |
549 | + target: picker.contactModel |
550 | + onExportCompleted: { |
551 | + if (picker.curTransfer && (picker.curTransfer.state === ContentHub.ContentTransfer.InProgress)) { |
552 | + if (error === ContactModel.ExportNoError) { |
553 | + var obj = Qt.createQmlObject("import Ubuntu.Content 0.1; ContentItem { url: '" + url + "' }", picker) |
554 | + picker.curTransfer.items = [ obj ] |
555 | + picker.curTransfer.state = ContentHub.ContentTransfer.Charged |
556 | + } else { |
557 | + picker.curTransfer = ContentHub.ContentTransfer.Aborted |
558 | + console.error("Fail to export contact:" + error) |
559 | + } |
560 | + } |
561 | + pageStack.pop() |
562 | + } |
563 | + } |
564 | +} |
565 | |
566 | === modified file 'src/imports/ContactView/ContactView.qml' |
567 | --- src/imports/ContactView/ContactView.qml 2014-06-10 12:27:54 +0000 |
568 | +++ src/imports/ContactView/ContactView.qml 2014-06-11 21:25:54 +0000 |
569 | @@ -202,6 +202,17 @@ |
570 | tools: ToolbarItems { |
571 | ToolbarButton { |
572 | action: Action { |
573 | + objectName: "share" |
574 | + text: i18n.tr("Share") |
575 | + iconName: "share" |
576 | + onTriggered: { |
577 | + pageStack.push(Qt.resolvedUrl("../ContactShare/ContactSharePage.qml"), |
578 | + { contactModel: root.model, contact: root.contact}) |
579 | + } |
580 | + } |
581 | + } |
582 | + ToolbarButton { |
583 | + action: Action { |
584 | objectName: "edit" |
585 | text: i18n.tr("Edit") |
586 | iconSource: "artwork:/edit.png" |
587 | |
588 | === modified file 'src/imports/MainWindow.qml' |
589 | --- src/imports/MainWindow.qml 2014-06-05 19:20:12 +0000 |
590 | +++ src/imports/MainWindow.qml 2014-06-11 21:25:54 +0000 |
591 | @@ -18,6 +18,7 @@ |
592 | import QtContacts 5.0 |
593 | import Ubuntu.Components 0.1 |
594 | import Ubuntu.Components.Popups 0.1 as Popups |
595 | +import Ubuntu.Content 0.1 as ContentHub |
596 | |
597 | MainView { |
598 | id: mainWindow |
599 | @@ -110,12 +111,12 @@ |
600 | } |
601 | |
602 | Connections { |
603 | - target: contactContentHub |
604 | - onActiveChanged: { |
605 | - if (contactContentHub && contactContentHub.active) { |
606 | - // enter in pick mode |
607 | - mainStack.push(Qt.createComponent("ContactList/ContactListPage.qml"), {pickMode: true}) |
608 | - } |
609 | + target: ContentHub.ContentHub |
610 | + onExportRequested: { |
611 | + // enter in pick mode |
612 | + mainStack.push(Qt.createComponent("ContactList/ContactListPage.qml"), |
613 | + {pickMode: true, |
614 | + contentHubTransfer: transfer}) |
615 | } |
616 | } |
617 | } |
FAILED: Continuous integration, rev:234 jenkins. qa.ubuntu. com/job/ phablet- team-address- book-app- staging- ci/80/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- utopic- touch/610 jenkins. qa.ubuntu. com/job/ generic- mediumtests- utopic/ 559 jenkins. qa.ubuntu. com/job/ phablet- team-address- book-app- staging- utopic- amd64-ci/ 80 jenkins. qa.ubuntu. com/job/ phablet- team-address- book-app- staging- utopic- armhf-ci/ 80 jenkins. qa.ubuntu. com/job/ phablet- team-address- book-app- staging- utopic- armhf-ci/ 80/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ phablet- team-address- book-app- staging- utopic- i386-ci/ 80 jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- runner- mako/1051 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/1176 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/1176/ artifact/ work/output/ *zip*/output. zip s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 7990 jenkins. qa.ubuntu. com/job/ autopilot- testrunner- otto-utopic/ 500 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- amd64/698 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- amd64/698/ artifact/ work/output/ *zip*/output. zip
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/phablet- team-address- book-app- staging- ci/80/rebuild
http://