Merge lp:~mardy/reminders-app/account-plugin into lp:reminders-app

Proposed by Alberto Mardegan
Status: Merged
Approved by: Michael Zanetti
Approved revision: 44
Merged at revision: 46
Proposed branch: lp:~mardy/reminders-app/account-plugin
Merge into: lp:reminders-app
Diff against target: 211 lines (+123/-2)
11 files modified
.bzrignore (+11/-0)
debian/account-plugin-evernote.install (+4/-0)
debian/control (+18/-0)
debian/qtdeclarative5-evernote0.1.install (+1/-0)
debian/reminders-app.install (+3/-2)
debian/rules (+4/-0)
src/CMakeLists.txt (+3/-0)
src/account-plugin/CMakeLists.txt (+21/-0)
src/account-plugin/data/providers/evernote.provider.in (+25/-0)
src/account-plugin/data/services/evernote.service (+8/-0)
src/account-plugin/qml/evernote/Main.qml (+25/-0)
To merge this branch: bzr merge lp:~mardy/reminders-app/account-plugin
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Michael Zanetti (community) Approve
David Planella Needs Information
Review via email: mp+203952@code.launchpad.net

Commit message

Merge account plugin, get username

Add the account-plugin-evernote code into reminders-app. This allows us to
retrieve the account username from within the account plugin by using the
Evernote QML API.
Packaging wise, split the debian packaging so that the new account plugin and
the Evernote QML module get shipped in their own binary packages.

Description of the change

Merge account plugin, get username

Add the account-plugin-evernote code into reminders-app. This allows us to
retrieve the account username from within the account plugin by using the
Evernote QML API.
Packaging wise, split the debian packaging so that the new account plugin and
the Evernote QML module get shipped in their own binary packages.

To post a comment you must log in.
Revision history for this message
David Planella (dpm) wrote :

From my limited knowledge of online account plugins, looks good to me. However, a question:

35 + qtdeclarative5-evernote0.1,

If I understand it correctly, this will mean that until we are able to ship authentication plugins in click packages, both the account-plugin-evernote and qtdeclarative5-evernote0.1 packages will need to be installed by default in the image, right? That is, we're moving the Evernote SDK out of the Reminders click package and into the distro.

I don't see it as much of an issue, I just wanted to make sure I understand it, as we'll then need to land qtdeclarative5-evernote0.1 too.

review: Needs Information
Revision history for this message
Alberto Mardegan (mardy) wrote :

Your understanding is correct, David. Though I don't think that this package needs to be seeded into the image, because it should automatically get pulled in by the fact that account-plugin-evernote is depending on it.

Note however that we are not moving the evernote SDK out of the click package (at least, this Mp doesn't do this). Once Online Accounts will support shipping account plugins in click packages, what will happen is that the evernote SDK will be present (duplicated, unfortunately) both in the click package for the account plugin and the click package for the reminders app.

Revision history for this message
David Planella (dpm) wrote :

On Thu, Jan 30, 2014 at 4:01 PM, Alberto Mardegan <
<email address hidden>> wrote:

> Your understanding is correct, David. Though I don't think that this
> package needs to be seeded into the image, because it should automatically
> get pulled in by the fact that account-plugin-evernote is depending on it.
>
>
Ah, that's right. Thanks for the clarification.

> Note however that we are not moving the evernote SDK out of the click
> package (at least, this Mp doesn't do this). Once Online Accounts will
> support shipping account plugins in click packages, what will happen is
> that the evernote SDK will be present (duplicated, unfortunately) both in
> the click package for the account plugin and the click package for the
> reminders app.

But to avoid this duplication once shipping in clicks is supported, would
it not make sense to have one single click package that installs both the
app and the authentication plugin?

Revision history for this message
Michael Zanetti (mzanetti) wrote :

hmmm yeah. To be closer to what it is when we have click packages I would probably vote for installing the qml plugin from within the accounts-plugin, probably to /usr/share/accounts-plugin-evernote/lib/ .

But no biggie. It shouldn't break anything if keep it like this temporarily. What is the ETA on being able to ship account plugins with clicks btw?

Revision history for this message
Michael Zanetti (mzanetti) wrote :

My previous comment was in reply to the first 2 comments. Sorry. I wrote it a while ago and only hit the send button now.

>
> But to avoid this duplication once shipping in clicks is supported, would
> it not make sense to have one single click package that installs both the
> app and the authentication plugin?

Yes, I agree.

Revision history for this message
Alberto Mardegan (mardy) wrote :

On 01/30/2014 05:21 PM, Michael Zanetti wrote:
> But no biggie. It shouldn't break anything if keep it like this temporarily. What is the ETA on being able to ship account plugins with clicks btw?

Soon (couble of weeks?) we should get the ability to support account
plugins shipped by click packages, but they will run in the
online-accounts-ui process (so, unconfined) and won't be able to have
dependencies (such as the Evernote QML plugin).

Moving account plugins into their own separate process, and running them
with the proper apparmor confinement (and access to libs they ship in
their click package) is under heavy development :-), and will come later
(one month?).

Revision history for this message
Michael Zanetti (mzanetti) wrote :

looks good to me... Wondering why jenkins doesn't pick it up though...

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2014-01-27 13:04:39 +0000
3+++ .bzrignore 2014-01-30 14:52:43 +0000
4@@ -1,2 +1,13 @@
5+*.log
6+*.substvars
7 CMakeLists.txt.user
8 builddir
9+debian/account-plugin-evernote/
10+debian/files
11+debian/qtdeclarative5-evernote0.1/
12+debian/reminders-app/
13+debian/reminders-app-autopilot/
14+debian/tmp/
15+obj-*/
16+reminders-app.qmlproject.user
17+reminders-app.pro.user
18
19=== added file 'debian/account-plugin-evernote.install'
20--- debian/account-plugin-evernote.install 1970-01-01 00:00:00 +0000
21+++ debian/account-plugin-evernote.install 2014-01-30 14:52:43 +0000
22@@ -0,0 +1,4 @@
23+usr/share/accounts/providers/*
24+usr/share/accounts/qml-plugins/*
25+usr/share/accounts/services/*
26+usr/share/icons/hicolor/32x32/apps/evernote.png
27
28=== modified file 'debian/control'
29--- debian/control 2013-12-18 23:10:42 +0000
30+++ debian/control 2014-01-30 14:52:43 +0000
31@@ -20,6 +20,7 @@
32 Depends: ${misc:Depends},
33 account-plugin-evernote,
34 qmlscene,
35+ qtdeclarative5-evernote0.1,
36 qtdeclarative5-ubuntu-ui-toolkit-plugin | qt-components-ubuntu,
37 qtdeclarative5-localstorage-plugin,
38 qtdeclarative5-qtquick2-plugin,
39@@ -27,6 +28,23 @@
40 Description: Reminders application
41 Note taking application powered by Evernote
42
43+Package: qtdeclarative5-evernote0.1
44+Architecture: all
45+Depends: ${misc:Depends},
46+ ${shlibs:Depends},
47+Description: Expose the Evernote API to QML applications
48+ This module provides access to the Evernote API from QML applications.
49+
50+Package: account-plugin-evernote
51+Architecture: all
52+Depends: libaccount-plugin-generic-oauth,
53+ qtdeclarative5-evernote0.1,
54+ qtdeclarative5-online-accounts-client0.1,
55+ ${misc:Depends},
56+Description: Allow Ubuntu to access the Evernote developer sandbox
57+ This plugin enables developers to authenticate to their Evernote developer
58+ sandbox account, which allows syncing of Evernote notes across Ubuntu devices.
59+
60 Package: reminders-app-autopilot
61 Architecture: all
62 Depends: ${misc:Depends},
63
64=== added file 'debian/qtdeclarative5-evernote0.1.install'
65--- debian/qtdeclarative5-evernote0.1.install 1970-01-01 00:00:00 +0000
66+++ debian/qtdeclarative5-evernote0.1.install 2014-01-30 14:52:43 +0000
67@@ -0,0 +1,1 @@
68+usr/lib/*/qt5/qml/Evernote
69
70=== modified file 'debian/reminders-app.install'
71--- debian/reminders-app.install 2014-01-19 13:59:12 +0000
72+++ debian/reminders-app.install 2014-01-30 14:52:43 +0000
73@@ -1,3 +1,4 @@
74 usr/bin/*
75-usr/lib/*/qt5/*
76-usr/share/*
77+usr/share/applications/*
78+usr/share/locale
79+usr/share/reminders/*
80
81=== modified file 'debian/rules'
82--- debian/rules 2014-01-19 13:59:12 +0000
83+++ debian/rules 2014-01-30 14:52:43 +0000
84@@ -7,5 +7,9 @@
85 %:
86 dh $@
87
88+override_dh_auto_configure:
89+ dh_auto_configure -- -DEVERNOTE_CONSUMER_KEY="ubuntu" \
90+ -DEVERNOTE_CONSUMER_SECRET="44f8ee81a8359500"
91+
92 override_dh_install:
93 dh_install --fail-missing
94
95=== modified file 'src/CMakeLists.txt'
96--- src/CMakeLists.txt 2013-12-18 00:30:17 +0000
97+++ src/CMakeLists.txt 2014-01-30 14:52:43 +0000
98@@ -1,2 +1,5 @@
99+if(NOT CLICK_MODE)
100+add_subdirectory(account-plugin)
101+endif(NOT CLICK_MODE)
102 add_subdirectory(plugin)
103 add_subdirectory(app)
104
105=== added directory 'src/account-plugin'
106=== added file 'src/account-plugin/CMakeLists.txt'
107--- src/account-plugin/CMakeLists.txt 1970-01-01 00:00:00 +0000
108+++ src/account-plugin/CMakeLists.txt 2014-01-30 14:52:43 +0000
109@@ -0,0 +1,21 @@
110+set(ICON data/icons/evernote.png)
111+set(PROVIDER_FILE data/providers/evernote.provider)
112+set(SERVICE_FILE data/services/evernote.service)
113+set(QML_PLUGIN_DIR ${CMAKE_INSTALL_DATADIR}/accounts/qml-plugins)
114+
115+set(ICON_DIR ${CMAKE_INSTALL_DATADIR}/icons/hicolor/32x32/apps)
116+set(PROVIDER_DIR ${CMAKE_INSTALL_DATADIR}/accounts/providers)
117+set(SERVICE_DIR ${CMAKE_INSTALL_DATADIR}/accounts/services)
118+
119+install(FILES ${ICON} DESTINATION ${ICON_DIR})
120+
121+configure_file(${PROVIDER_FILE}.in ${CMAKE_CURRENT_BINARY_DIR}/${PROVIDER_FILE})
122+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROVIDER_FILE}
123+ DESTINATION ${PROVIDER_DIR})
124+
125+install(FILES ${SERVICE_FILE} DESTINATION ${SERVICE_DIR})
126+
127+file(GLOB_RECURSE QML_FILES
128+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
129+ qml/**.qml)
130+install(FILES ${QML_FILES} DESTINATION ${QML_PLUGIN_DIR}/evernote)
131
132=== added directory 'src/account-plugin/data'
133=== added directory 'src/account-plugin/data/icons'
134=== added file 'src/account-plugin/data/icons/evernote.png'
135Binary files src/account-plugin/data/icons/evernote.png 1970-01-01 00:00:00 +0000 and src/account-plugin/data/icons/evernote.png 2014-01-30 14:52:43 +0000 differ
136=== added directory 'src/account-plugin/data/providers'
137=== added file 'src/account-plugin/data/providers/evernote.provider.in'
138--- src/account-plugin/data/providers/evernote.provider.in 1970-01-01 00:00:00 +0000
139+++ src/account-plugin/data/providers/evernote.provider.in 2014-01-30 14:52:43 +0000
140@@ -0,0 +1,25 @@
141+<?xml version="1.0" encoding="UTF-8"?>
142+<provider id="evernote">
143+ <name>Evernote Developer Sandbox</name>
144+ <icon>evernote</icon>
145+ <translations>account-plugins</translations>
146+ <plugin>generic-oauth</plugin>
147+ <domains>.*evernote\.com</domains>
148+
149+ <template>
150+ <group name="auth">
151+ <setting name="method">oauth2</setting>
152+ <setting name="mechanism">HMAC-SHA1</setting>
153+ <group name="oauth2">
154+ <group name="HMAC-SHA1">
155+ <setting name="RequestEndpoint">https://sandbox.evernote.com/oauth</setting>
156+ <setting name="TokenEndpoint">https://sandbox.evernote.com/oauth</setting>
157+ <setting name="AuthorizationEndpoint">https://sandbox.evernote.com/OAuth.action</setting>
158+ <setting name="Callback">https://wiki.ubuntu.com/</setting>
159+ <setting name="ConsumerKey">@EVERNOTE_CONSUMER_KEY@</setting>
160+ <setting name="ConsumerSecret">@EVERNOTE_CONSUMER_SECRET@</setting>
161+ </group>
162+ </group>
163+ </group>
164+ </template>
165+</provider>
166
167=== added directory 'src/account-plugin/data/services'
168=== added file 'src/account-plugin/data/services/evernote.service'
169--- src/account-plugin/data/services/evernote.service 1970-01-01 00:00:00 +0000
170+++ src/account-plugin/data/services/evernote.service 2014-01-30 14:52:43 +0000
171@@ -0,0 +1,8 @@
172+<?xml version="1.0" encoding="UTF-8"?>
173+<service id="evernote">
174+ <type>sharing</type>
175+ <name>Evernote Developer Sandbox</name>
176+ <icon>evernote</icon>
177+ <provider>evernote</provider>
178+ <translations>account-plugins</translations>
179+</service>
180
181=== added directory 'src/account-plugin/qml'
182=== added directory 'src/account-plugin/qml/evernote'
183=== added file 'src/account-plugin/qml/evernote/Main.qml'
184--- src/account-plugin/qml/evernote/Main.qml 1970-01-01 00:00:00 +0000
185+++ src/account-plugin/qml/evernote/Main.qml 2014-01-30 14:52:43 +0000
186@@ -0,0 +1,25 @@
187+import Evernote 0.1
188+import QtQuick 2.0
189+import Ubuntu.OnlineAccounts.Plugin 1.0
190+
191+OAuthMain {
192+ creationComponent: OAuth {
193+ Connections {
194+ target: UserStore
195+ onUsernameChanged: saveUsername()
196+ }
197+
198+ function completeCreation(reply) {
199+ EvernoteConnection.token = reply.AccessToken
200+ /* At this point the username is getting retrieved. Once that's
201+ * done, UserStore will notify that its "username" property has
202+ * been changed, and we'll continue from saveUsername(). */
203+ }
204+
205+ function saveUsername() {
206+ account.updateDisplayName(UserStore.username)
207+ account.synced.connect(finished)
208+ account.sync()
209+ }
210+ }
211+}

Subscribers

People subscribed via source and target branches