Merge lp:~renatofilho/address-book-app/fix-1207774 into lp:address-book-app
- fix-1207774
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Renato Araujo Oliveira Filho |
Approved revision: | 70 |
Merged at revision: | 84 |
Proposed branch: | lp:~renatofilho/address-book-app/fix-1207774 |
Merge into: | lp:address-book-app |
Diff against target: |
149 lines (+75/-2) 3 files modified
src/app/addressbookapp.cpp (+18/-1) src/app/addressbookapp.h (+1/-0) src/imports/ContactEdit/ContactDetailAvatarEditor.qml (+56/-1) |
To merge this branch: | bzr merge lp:~renatofilho/address-book-app/fix-1207774 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Approve | |
Gustavo Pichorim Boiko (community) | Approve | ||
Bill Filler (community) | Needs Fixing | ||
Review via email: mp+187131@code.launchpad.net |
Commit message
Implemented support for avatar editor.
Description of the change
To test this will you need the new address-
PS Jenkins bot (ps-jenkins) wrote : | # |
Bill Filler (bfiller) wrote : | # |
wasn't sure if this was ready for review yet, but I tried it. wasn't working. the gallery comes up and I choose a picture but when it goes back to address-book there is no picture. I see this error in the log. I was using address-
file://
file://
file://
ShaderEffect: Property 'source' is not assigned a valid texture provider (QQuickImage*).
ShaderEffect: Property 'source' is not assigned a valid texture provider (QQuickImage*).
QObject* qml_content_
QmlImportExport
virtual void com::ubuntu:
QString {anonymous}
virtual void com::ubuntu:
com::ubuntu:
com::ubuntu:
ContentPeer* ContentHub:
static const com::ubuntu:
ContentPeer:
ContentTransfer* ContentHub:
static const com::ubuntu:
ContentTransfer
void ContentTransfer
void ContentTransfer
void ContentTransfer
void ContentTransfer
bool ContentTransfer
QDBusConnection: name 'com.ubuntu.
void com::ubuntu:
void com::ubuntu:
void ContentTransfer
void ContentTransfer
QObject::connect: Cannot connect QQuickShaderEff
QObject::connect: Cannot connect QQuickShaderEff
QObject::connect: Cannot connect QQuickShaderEff
void ContentTransfer
void ContentTransfer
file://
Detectable autorepeat not supported.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:65
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:66
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:68
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:69
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:70
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Gustavo Pichorim Boiko (boiko) wrote : | # |
Looks good and works as expected!
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
PS Jenkins bot (ps-jenkins) : | # |
Preview Diff
1 | === modified file 'src/app/addressbookapp.cpp' |
2 | --- src/app/addressbookapp.cpp 2013-09-23 13:48:33 +0000 |
3 | +++ src/app/addressbookapp.cpp 2013-09-29 21:37:42 +0000 |
4 | @@ -32,6 +32,7 @@ |
5 | #include <QDBusConnectionInterface> |
6 | #include <QLibrary> |
7 | #include <QIcon> |
8 | +#include <QTemporaryFile> |
9 | |
10 | #include <QQmlEngine> |
11 | |
12 | @@ -76,7 +77,7 @@ |
13 | static void installIconPath() |
14 | { |
15 | QByteArray iconTheme = qgetenv("ADDRESS_BOOK_APP_ICON_THEME"); |
16 | - if (!iconTheme.isEmpty()) { |
17 | + if (!iconTheme.isEmpty()) { |
18 | QIcon::setThemeName(iconTheme); |
19 | } |
20 | } |
21 | @@ -353,3 +354,19 @@ |
22 | m_view->requestActivate(); |
23 | } |
24 | } |
25 | + |
26 | +QUrl AddressBookApp::copyImage(QObject *contact, const QUrl &imageUrl) |
27 | +{ |
28 | + QFile img(imageUrl.toLocalFile()); |
29 | + if (img.exists() && img.open(QFile::ReadOnly)) { |
30 | + QTemporaryFile *tmp = new QTemporaryFile(contact); |
31 | + if (tmp->open()) { |
32 | + tmp->close(); |
33 | + QImage tmpAvatar = QImage(img.fileName()); |
34 | + QImage scaledAvatar = tmpAvatar.scaledToHeight(720, Qt::SmoothTransformation); |
35 | + scaledAvatar.save(tmp->fileName(), "png", 9); |
36 | + return QUrl(tmp->fileName()); |
37 | + } |
38 | + } |
39 | + return QUrl(); |
40 | +} |
41 | |
42 | === modified file 'src/app/addressbookapp.h' |
43 | --- src/app/addressbookapp.h 2013-09-17 22:19:02 +0000 |
44 | +++ src/app/addressbookapp.h 2013-09-29 21:37:42 +0000 |
45 | @@ -35,6 +35,7 @@ |
46 | |
47 | public Q_SLOTS: |
48 | void activateWindow(); |
49 | + QUrl copyImage(QObject *contact, const QUrl &imageUrl); |
50 | |
51 | private: |
52 | void parseArgument(const QString &arg); |
53 | |
54 | === modified file 'src/imports/ContactEdit/ContactDetailAvatarEditor.qml' |
55 | --- src/imports/ContactEdit/ContactDetailAvatarEditor.qml 2013-08-07 18:57:30 +0000 |
56 | +++ src/imports/ContactEdit/ContactDetailAvatarEditor.qml 2013-09-29 21:37:42 +0000 |
57 | @@ -17,6 +17,8 @@ |
58 | import QtQuick 2.0 |
59 | import Ubuntu.Components 0.1 |
60 | import QtContacts 5.0 |
61 | +import Ubuntu.Content 0.1 |
62 | +import Ubuntu.Components.Popups 0.1 as Popups |
63 | |
64 | import "../Common" |
65 | |
66 | @@ -24,7 +26,11 @@ |
67 | id: root |
68 | |
69 | function save() { |
70 | - //TODO: not implemented |
71 | + if (root.detail.imageUrl != avatarImage.source) { |
72 | + console.debug("Save new image:" + avatarImage.source) |
73 | + root.detail.imageUrl = avatarImage.source |
74 | + return true |
75 | + } |
76 | return false |
77 | } |
78 | |
79 | @@ -32,14 +38,37 @@ |
80 | implicitHeight: units.gu(17) |
81 | |
82 | Image { |
83 | + id: avatarImage |
84 | + |
85 | anchors.fill: parent |
86 | source: root.detail && root.detail.imageUrl != "" ? root.detail.imageUrl : "artwork:/avatar-default.svg" |
87 | asynchronous: true |
88 | fillMode: Image.PreserveAspectCrop |
89 | |
90 | + Component { |
91 | + id: loadingDialog |
92 | + |
93 | + Popups.Dialog { |
94 | + id: dialogue |
95 | + |
96 | + title: i18n.tr("Loading") |
97 | + |
98 | + ActivityIndicator { |
99 | + id: activity |
100 | + |
101 | + anchors.centerIn: parent |
102 | + running: true |
103 | + visible: running |
104 | + } |
105 | + } |
106 | + } |
107 | + |
108 | AbstractButton { |
109 | id: changeButton |
110 | |
111 | + property var activeTransfer |
112 | + property var loadingDialog: null |
113 | + |
114 | anchors { |
115 | right: parent.right |
116 | bottom: parent.bottom |
117 | @@ -54,6 +83,32 @@ |
118 | source: "artwork:/import-image.svg" |
119 | fillMode: Image.PreserveAspectFit |
120 | } |
121 | + |
122 | + onClicked: { |
123 | + if (!changeButton.loadingDialog) { |
124 | + changeButton.loadingDialog = PopupUtils.open(loadingDialog, null) |
125 | + changeButton.activeTransfer = ContentHub.importContent(ContentType.Pictures, |
126 | + ContentHub.defaultSourceForType(ContentType.Pictures)); |
127 | + changeButton.activeTransfer.start(); |
128 | + } |
129 | + } |
130 | + |
131 | + Connections { |
132 | + target: changeButton.activeTransfer != null ? changeButton.activeTransfer : null |
133 | + onStateChanged: { |
134 | + if (changeButton.activeTransfer.state === ContentTransfer.Charged) { |
135 | + if (changeButton.activeTransfer.items.length > 0) { |
136 | + avatarImage.source = application.copyImage(root.contact, changeButton.activeTransfer.items[0].url); |
137 | + //avatarImage.source = changeButton.activeTransfer.items[0].url |
138 | + } |
139 | + } |
140 | + if ((changeButton.activeTransfer.state === ContentTransfer.Charged) || |
141 | + (changeButton.activeTransfer.state === ContentTransfer.Aborted)) { |
142 | + PopupUtils.close(changeButton.loadingDialog) |
143 | + changeButton.loadingDialog = null |
144 | + } |
145 | + } |
146 | + } |
147 | } |
148 | } |
149 | } |
PASSED: Continuous integration, rev:64 jenkins. qa.ubuntu. com/job/ address- book-app- ci/172/ jenkins. qa.ubuntu. com/job/ address- book-app- saucy-amd64- ci/172 jenkins. qa.ubuntu. com/job/ address- book-app- saucy-armhf- ci/173 jenkins. qa.ubuntu. com/job/ address- book-app- saucy-armhf- ci/173/ artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ address- book-app- saucy-i386- ci/172 jenkins. qa.ubuntu. com/job/ generic- mediumtests- saucy/3888 jenkins. qa.ubuntu. com/job/ generic- mediumtests- touch/1439 jenkins. qa.ubuntu. com/job/ autopilot- testrunner- otto-saucy/ 222 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- saucy-i386/ 3923 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- saucy-i386/ 3923/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- saucy-armhf/ 1441 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- saucy-armhf/ 1441/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ generic- mediumtests- runner- maguro/ 1216 jenkins. qa.ubuntu. com/job/ generic- mediumtests- runner- mako/1227
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins: 8080/job/ address- book-app- ci/172/ rebuild
http://