User1: UI designing question | http://askubuntu.com/q/380212
User2: Good morning all; happy Use Less Stuff Day! :-D
User3: User4 Hey can you send me the link to the U1db code you used in Riddling?
User3: User4 I just started thinking about implementing local storage for Cliffhanger.
User4: nik90, I can. I haven't published the code because it's got the answers in it :)
User3: User4 I dont need the whole code, just the u1db initialisation part :)
User4: nik90, see http://pastebin.ubuntu.com/6452744/
User4: nik90, we create the database and two documents (one is a flag saying "have we shown the opening splash screen" and the other is the list of things they've answered) at line 35
User4: nik90, the splash screen is the Rectangle (id: thegame) at line 57. We decide whether or not it's visible depending on whether shownQuite.contents.shownQuote is true or not
User4: importantly, to set that to true, we just set shownQuote.contents on line 75
User3: User4 and the defaults is called only once when the document is missing
User4: so to implement this flag, we just create a document (line 39), we use a value from that document's contents (line 62) and we set that document's contents onClicked (line 75). Note that we did not have to call a "save" function or anything like that. It's all declarative.
User4: ya, "defaults" is "if this document doesn't exist, and we've set to create it with create:true, then create it with the following contents"
User3: User4 okay that makes sense
User3: so I will have one document to store the username and the encrypted password
User3: but by default it will be sample username and passowrd
User3: and I just read the document.contents
User4: ya
User4: in your text entry, just do text: userpassdoc.contents.username or whatever
User4: the answers list is a little more complicated. You have to set all the contents of a U1db document at once; you can't set *part* of the contents only. (This is a very very irritating QML thing; it's not U1db's fault.) So if you have a list in your document, you can't just push things onto the list; you need to make a duplicate of the contents, edit the duplicate, then set contents to be the duplicate.
User4: this post explains that in more detail: http://wordchainapp.tumblr.com/post/60178716314/using-u1db-to-store-data-in-word-chain
User3: I read that blog post
User3: btw how come u are not using ubuntu social sharing feature to tweet or facebook
User3: I see u open an external url for that
User4: what, in riddling?
User3: yeah
User4: because I don't understand the ubuntu social sharing thing :)
User3: but ur solution is simple and does the job :D
User4: I need to, I just don't at the moment :)
User3: Qt.openUrlExternally("https://www.facebook.com/sharer/sha...)
User4: indeed
User4: also, Riddling will become a cross-platform HTML5 native app at some point, rather than QML.
User3: ah okay
User3: I am trying to stick to your reasoning of a JS+QML App for Cliffhanger
User4: if you're building an Ubuntu app then QML's a good idea
User4: and U1db is a really convenient way to store stuff :
User4: :)
User3: :)
User4: because it's QMLish. QML LocalStorage is *not* karenwhitehead@example.com. Constructing SQL statements in handlers is rubbish.
User3: yeah I had a tough time using it for the clock app
User4: *nod* u1db, srsly.
User3: I guess I need to transition clock app to u1db at some point
User4: and for apps that care, they can sync data too
User3: so if I create a u1db document and database are they automatically synced?
User3: or do I need to do anything special?
User4: no. U1db has to be synced explicitly
User4: you call a sync function on it
User4: when stuff changes.
User4: or when the user hits refresh, etc
User3: http://bazaar.launchpad.net/~uonedb-qt/u1db-qt/trunk/view/head:/examples/u1db-qt-example-6/u1db-qt-example-6.qml
User3: are you referring to U1db.Synchronizer{} ?
User3: or just documentID.sync()
User4: that's how to sync, indeed. But if you want to sync with U1, which you probably will, then it's a bit more complex because you need credentials. You can get them from Online Accounts. All the pieces are in place to do this, it's just that no-one's built an app which does it yet.
User4: When you want to start syncing data, I'd chat to gatox or kalikiana
User3: okay
User4: note that u1db is also a ListModel, which is really useful if you need it; a Query is a listmodel, and so is the whole database.
User4: see Rick's post about using the whole db as a ListModel, and the examples for how to define a query and use that as a listmodel
User3: is the document.contents also a listmodel?
User4: depends what the contents are :)
User3: something as simple as  contents:{"hello": { "world": [ { "message": "Hello World" } ] } }
User4: if you've got a list somewhere in the contents, then QML can use a JS list as a ListModel, so you can use a list from the contents as a listmodel
User3: okay
User4: ListView { model: theabovedoc.contents.hello.world; delegate: Text { text: model.message } }
User4: that should work :)
User4: right, I have to go out now, but will be back later
User3: I will start working on this
User3: thnx for ur help
User4: cool!
User4: no worries. :)
User5: User3 hey, I've implemented the expanding pattern in the SDK and was told you are interested in that. Feel free to test it and add your comments to the review: https://code.launchpad.net/~mzanetti/ubuntu-ui-toolkit/expanding-listitem/+merge/195602
User3: User5 hey thnx a lot
User3: User5 I will wait for jenkins to release a deb build to try it out
User5: User6 hey
User5: User6 I've made some progress with the evernote stuff. however, the accounts connection doesn't seem to work properly here. might be my setup. let me know when you have some time to test it
User3: User5 just a thought..can the expanded item contain a list inside it? For instance, I have a list of seasons. On clicking a season, it expands to show a list of episodes for that season.
User5: User3 sure. you can put inside whatever you want
User3: User5 awesome
User6: hey mzanetti, awesome! Happy to test it now
User5: User6 we need some common branch where I can push to
User6: mzanetti, let me add you to the evernote devs team and we can push on a common branch there, just a sec
User6: mzanetti, done. You should now be able to push to lp:~reminders-app-dev/reminders-app/evernote-api-plugin
User6: mzanetti, what is it that it's not working on the accounts connection? Are you testing on the desktop or on the phone?
User5: User6 on the desktop
User5: User6 I can successfully configure the account in system-settings
User5: User6 but then the List in the app just stays empty
User5: User6 pushed
User6: popey, if mhall119 is doing appdev-1, I can do appdev-2 today. Would it work for you to do the last 2 appdev sessions that are in Hallway and community-2?
User6: mzanetti, let me pull and test
User5: User6 but in theory, you should be able to select an account first, and then click the button and it should print a list of notebooks
User5: User6 of course the connection setup might be wrong as I just copied it from the UserStore and guessed the URL (without spending much time on researching)
User5: User6 but anyways, once we get a list of the notebooks printed on the command line, please let me know and I will add a model to be exposed to QML
User7: User6 http://summit.ubuntu.com/uds-1311/meeting/22125/followup-session-for-system-framework-for-apps/ and http://summit.ubuntu.com/uds-1311/meeting/22054/music-2.0-development/ ?
User6: popey, exactly. Would that work for you?
User7: sure!
 * dpm high-fives
User7: \o/
User7: *\o/* even
 * popey gets the pom-poms out
User6: yeah
User6: mzanetti, I get my Evernote account (dplanella) listed in the UI, then I press the button and get http://pastebin.ubuntu.com/6453143/ - is this the same you get?
User5: User6 no... I didn't get anything in the ui
User5: User6 well, I set the token "onAuthenticated"
User6: mzanetti, does system settings show you your evernote account?
User5: User6 not sure what you need to do to trigger that signal
User5: User6 yes, systemsettings works
User5: User6 well, not entirely sure. it looks a little bit wrong
User5: User6 http://i.imgur.com/FgQ3cpo.png
User5: User6 also here the username seems missing: http://i.imgur.com/2px0NOl.png
User5: User6 when you click on your username you should see either this:
User5: Access token is xxxx
User5: or
User5: Authentication failed, code xxx
User5: once you see the "Access token is" the button *should* start working
User6: mzanetti, ah, 2 things: I'm running it entirely from the desktop on 13.10. The screenshot you're showing me is from the QML system settings. On the phone, I don't get the user name listed under system settings either. Let's ask mardy
User6: mardy, I've noticed that after the changes you suggested, the username for the Evernote account is shown for the desktop version of System Settings. However, for the phone version it's not (see http://i.imgur.com/2px0NOl.png) - Does this affect how Online Accounts work? And how can we make it show the user name on the phone?
User8: User6 it doesn't
User8: User6 the QML plugin for the account should retrieve the username from evernote, using some evernote's APIs
User8: User6 this is not needed on the desktop because there we are doing nasty things with the DOM of the login page :-)
User6: yeah :)
User6: mardy, so what's the process to get the user name listed on the phone? I understand that we need to get it from Evernote, but how do we initiate the process from the authentication plugin side? I guess we need to include code in the plugin to do that? And given the fact that we're using a C++ API to talk to evernote, I guess this will mean having to ship the C++ API (currently a C++ QML plugin) with the authentication plugin package?
User6: mzanetti, that's really weird: when I click on the user name I get this: "file:///tmp/build-evernote-app-Desktop-Debug/src/app/qml/main.qml:72: Error: Insufficient arguments" - however you're using exactly the same snippet I was using the other day to retrieve the access token
User5: User6 yeah, I just copy/pasted it (removing the rectangle)
User6: thanks popey :)
User7: heh
User7: added some sessions into the app dev section of the doc dpm, but I wasn't in those sessions
User7: added them to provide a nudge to others ã
User6: cool :)
User5: User6 actually... code completion says we should use accountsService.authenticate(sessionData)
User5: User6 no idea what sessionData is supposed to be
User6: mardy? ^
User8: User6 you need to get the username by reimplementing the completeCreation method: http://bazaar.launchpad.net/~online-accounts/account-plugins/trunk/view/head:/qml/google/Main.qml
User8: User6 do you think it's possible to get it from QML?
User8: User5 it's a dictionary of parameters, specific to the authentication method you are using
User6: mardy, I don't think so - we tried to talk to the API via QML's JS engine and it wasn't possible. That's why we've resorted to writing the C++ plugin to talk to the API
User8: User5 for Oauth, for example, you might want to pass your own application keys
User5: I'm a bit confused... shouldn't the Oauth authentication already have happened through the system settings?
User5: so all I need is to get the token somehow
User8: User5 yes, that's correct, however different OAuth tokens might give you different permissions
User5: ah. right. makes sense
User8: User5 so, the app key used to register the account in system settings might (and should, IMHO) have less permissions than what you need
User5: User8 so I need to do authentication again in the app?
User8: User5 yes, all the time (but Online accounts will return you the same token as before, if it's still valid)
User8: User5 I think you can start with leaving the sessionData empty, that should work
User5: User8 we get " Error: Insufficient arguments"
User6: mardy, sorry if I'm asking something obvious, but I'm not familiar with OAuth -> what's the use of  the initial token you get from system settings, then?
User5: +1 on dpm's question
User8: User5 damn, I think there's some bug there; you need to actually pass (null)
User5: User6 can you try again with this? ^ main.qml, line 72. Just add "null" as argument in that call
User6: on it
User8: User5 do you mind to file a bug on the "Error: Insufficient arguments", so that I don't forget it? http://code.google.com/p/accounts-sso/issues/list -> use [accounts-qml-module] as subject prefix
User5: ok
User5: We are sorry, but you do not have access to this service. Please contact your domain administrator for access.
User5: User6 can you? ^
User6: mzanetti, success! *\o/* -> http://pastebin.ubuntu.com/6453247/
User7: sweet!
User5: whooohooo!
User6: awesome
User8: User5 maybe it doesn't like that you are logged in with your Canonical account
User5: I am
User5: User6 ok. I'll create some models so you can easily place that stuff into ListViews
User8: User5 can you switch account (if you have a personal one?)
User5: ah that might be...
User6: this is pretty awesome, nice work mzanetti
User5: :)
User8: dpm, User5 so, there is currently not 100% agreement on what the initial access token should do
User8: dpm, User5 design would like for it to be a fully capable token, giving apps all the permissions possible
User5: yeah. from a design POV that makes sense
User6: mzanetti, how are you logging in to Evernote in system settings? Are you using a developer account created on sandbox.evernote.com or a regular Evernote account?
User5: however, any random app can then access your stuff
User5: User6 I think a regular account. not entirely sure tbh
User8: dpm, User5 but me and others would like to have it a *minimal* set of permissions, just to verify that the account exists (and the the username), and rather have each app use its own keys if it wants to do more
User5: User6 note that I did all this stuff between 0:00 and 01:00 am :D
User6: mzanetti, lol, that might be it, then :)
User8: User5 correct, any random app *authorized by the user to use the account* can do whatever it wants
User8: User5 it is also against the policy of some services (such as twitter)
User5: User8 I see your point, and for security reasons I tend to agree. however, I can see design not wanting that as it kinda defeats the purpose of the account in the system settings
User8: User5 and if all apps use the same key, the API limits are more easily reachable
User5: true
User5: yeah... I fully agree with you
User5: I personally would not want any app to access my notes just because I wanted to authenticate a single app
User6: mzanetti, try logging in on sandbox.evernote.com with your browser, with the account you used for system settings. If it doesn't work, then you'll need to create an account there. The Evernote account provider only works with sandbox.e.c, and you can only use developer accounts to talk to Evernote until your app has been blessed
User5: User6 ah.. that might explain things
User5: doesn't make any sense, but explains it
User8: User5 if every app uses a different key, the user will have to authorize each app in the webview as well, before using it. However, he won't have to login into the website everytime, because Online Accounts is caching the session cookies
User5: User8 ah ok... now it makes sense to me
User5: User8 yeah. I really need to switch my fitbit app to use the accounts service. is there a fitbit plugin ready yet?
User6: mardy, so going back to the question earlier: if the only way to talk to the Evernote service is via our C++ plugin, we will need to ship it with the account provider, so that the Main.qml file can talk to the API, right? Either in the plugin package itself or as a dependency
User8: User5 someone was working on fitbit IIRC... can't remember who!
User5: User8 must have been cwayne
User5: but I don't know the state of it
User8: User6 let's see why you need C++ first; if it's something which can be used by other plugins, maybe I can move that stuff into Online Accounts
User8: User5 right, it was cwayne
User7: cwayne was looking for testers
User6: mardy, Evernote does not have e.g. REST API - they provide what they call native SDKs in different programming languages to talk to the API. The ones we can use are JavaScript and C++. Their JavaScript SDK we cannot use because it needs JS features not implemented in the QML JS engine, that's why we're now using C++ instead. What we're doing is essentially a C++ wrapper to be used as a QML plugin to talk to the Evernote API from QML. I don't think i
User6: t's generic enough to put it into Online Accounts
User5: User6 seems my account is for sandbox.evernote.com
User6: mzanetti, hm, weird. And your user name is listed under the Evernote account in System Settings? (I mean desktop System Settings)
User6: mzanetti, and what are the package versions of account-plugin-evernote and signon-plugin-oauth2? These are the only things I can think of.
User5: User6 I don't have the desktop system settings
User6: mzanetti, why's that? You're on trusty?
User5: User6 yes. and using KDE (unity doesn't scale on this display)
User5: User6 http://paste.ubuntu.com/6453344/
User6: mzanetti, ah, that explains things. So it seems the phone version of system settings doesn't quite work with the authentication plugin.
User5: User6 ok. can you tell me the package name for the desktop system settings?
User6: it might be the part mardy was mentioning earlier on: for it to work the shipped Main.qml file needs to actually talk to the Evernote API, but I still do not quite understand what it actually needs to do
User6: mzanetti, I think it's a widget for gnome-control-center, so you'll need to install that first
User5: yeah... I'm afraid I removed all g stuff :D
User6: I need to run and start the appdev track, let's catch up later on...
User5: User6 ack
User8: User6 so, the Main.qml file is needed, but it can be as small as http://bazaar.launchpad.net/~online-accounts/account-plugins/trunk/view/head:/qml/twitter/Main.qml
User8: User6 the rest is just to obtain the display name of the account, which is not needed in order for the account to be functional
User6: mzanetti, ^
User6: thanks mardy
User5: User6 I'm still having issues with the accounts stuff. if you have some time between sessions, let me know
User6: mzanetti, I'll try to set some time aside during the break, but we'll probably need mardy's help too
User5: User8 do I need to have some service running for it to work?
User5: I've configured it successfully in gnome-control-center. it shows up there correctly
User5: but the qml app's model doesn't list anything
User5: note that I do not have unity7 running.
User1: Set Window Icon to Gtk Stock Icon in PyGtk | http://askubuntu.com/q/380434
User8: User5 no, no services are needed. Check with the "account-console" tool if you see something suspicious on the account
User5: User8 looks good... http://paste.ubuntu.com/6454105
User8: User5 yep. So, what happens? The application doesn't see this account?
User5: User8 yeah. this is the code: http://paste.ubuntu.com/6454114
User8: User5 are you running the app under confinement?
User5: User8 the AccountsServiceModel is just empty
User5: User8 no. running on the desktop
User8: User5 and there's a file called /usr/share/accounts/services/evernote-publish.service ?
User5: aha!
User8: :-)
User5: User8 nope. it's evernote.service
User5: (strange it works for dpm then)
User5: User8 works! thanks a bunch
User8: User5 yw :-)
User6: mzanetti, glad to hear it worked for you, but I'm not sure I follow what you had to do?
User6: ah!
User6: I know what happened
User9: who is working on gallery-app at the moment? I'm trying to compile it but I get some errors
User9: /home/tim/dev/gallery-app/trunk/src/medialoader/preview-manager.cpp:395:35: error: âGST_BUFFER_CAPSâ was not declared in this scope
User9: I have libgstreamer1.0-dev  installed. anything else I need?
User5: User6 I had to change this: service: "evernote"
User5: instead of service: "evernote-publish"
User9: ^ that's just one error. I get a couple of similar ones
User6: mzanetti, mardy, I created an evernote-publish.service file when I first started testing the provider. Then cwayne packaged it up but it seems he renamed the file to evernote.service. But in my system I still had the manually-installed evernote-publish.service file, so that's why it was working for me
User5: ah
User5: User6 anyways, I fixed it and will push soonish
User6: that's really cool
User5: User6 looks like we managed to get over all the issues. now it's just a TODO
User5: well, we probably should figure how to reenable SSL at some point
User6: yeah, but for one I'm happy that we can talk to the Evernote service at all
User5: User6 indeed
User5: User6 when I said I could help with the QML plugin I didn't expect this :D
User5: User6 I expected a standard REST api
User6: lol, but now your *really* helped
User6: everything we do is hardcore
User6: :)
User5: User6 ok... so I'll continue to hack on this a bit to get it into a state where you guys can start building on.
 * dpm hugs mzanetti
User5: probably not feature complete by tonight tho :D
User6: :)
User3: User6 does jenkins autopush MP in reminders or should I do it manually?
User3: for jordan's branch
User10: \o/
User6: nik90, before I answer that...
User6: _   _    _    ____  ______   __  ____ ___ ____ _____ _   _ ____    _ __   __
User6: | | | |  / \  |  _ \|  _ \ \ / / | __ )_ _|  _ \_   _| | | |  _ \  / \\ \ / /
User6: | |_| | / _ \ | |_) | |_) \ V /  |  _ \| || |_) || | | |_| | | | |/ _ \\ V /
User6: |  _  |/ ___ \|  __/|  __/ | |   | |_) | ||  _ < | | |  _  | |_| / ___ \| |
User6: |_| |_/_/   \_\_|   |_|    |_|   |____/___|_| \_\|_| |_| |_|____/_/   \_\_|
User3: User6 thnx a lot :)
User6: :)
User6: nik90, I've been doing it manually until Jenkins it set up
User3: User6 okay. I can merge jordan's branch.
User6: nik90, awesome. Note that now that your latest branch
User6: has landed, you will need to pull from trunk before pushing
User3: User6 yes, I noted that
User6: I assume jkeyes0 (hi!) branch landed before that
User6: ok, cool
User6: sorry, not landed, I meant was submitted
User3: dpm, User10 done :D
User10: woot!
User6: nice work jkeyes0! -> http://ubuntuone.com/7Nlz49jW8sVymwKuXP4Tde
User3: User6 for a moment I thought it was meme that you stored in your u1db :P
User6: nik90, it was a real screenshot, but there's always other things worth sharing http://i.imgur.com/uyiVwVA.gif :)
User7: I properly love that gif
User6: one can not love it
User3: hehe
User5: User6 ping
User5: User7 User6 *\o/* http://i.imgur.com/7HGfH8F.png
User3: User5 wow awesome!
User5: I guess it's time for a first round of cleanup and a merge request
User3: User5 yeah I work with other developers on the UI part
User3: User5 so once your API plugin is in, we can get started
User5: User3 yep. just browsing the current repo... need to change directory structure quite a bit
User5: need to take a break... maybe I'll continue to integrate it today still
User3: okay'
User7: User5 *\o/*
User11: dpm, reminders-app is all setup now
User6: fginther, awesome, thanks!
User6: mzanetti, indeed *\o/* nice work!
User5: User6 currently integrating it into trunk
User6: cool
User6: balloons, around?
User6: mhall119, I know you've been busy with UDS, but have you perhaps had the chance to set up the reminders app burn-down?
User12: balloons, just in case you hop back on yet today--I have a MR for the AP tests that are failing in the device images. http://ci.ubuntu.com/smokeng/trusty/touch/maguro/27:20131120.2:20131120.1/5060/music-app-autopilot/
User12: balloons, https://code.launchpad.net/~vthompson/music-app/fixes-1253480-1253788-ap-tests/+merge/196203
User12: balloons, essentially what was happening was that after 5 seconds of playback the functionality of the previous button changes so that the current song is played from the beginning (intended). The tests on the device seem slow and often this 5 seconds would elapse and the test would fail due to the previous button not doing what we assumed it'd do.
User3: Does anyone know how to do a POST xmlhttprequest in javascript
User3: I am unable to do so...
User5: User3 User6 https://code.launchpad.net/~mzanetti/reminders-app/integrate-plugin/+merge/196210
User5: ready to be baked on your machines
User6: wohoo!
User5: User6 the diff is a bit messy as it includes the libs...
User5: User6 read the description of the merge, that should explain everything. if not, let me know and I'll update
User6: mzanetti, no worries. I'll have a quick look and test it now and then look at the merge in more detail tomorrow morning.
User3: \o/
User5: and yes, the ui can already display your notes :)
User6: I just managed to finish the update announcing the authentication plugin and how to use it, I guess now we're ready for a new announcement :)
User6: http://davidplanella.org/ubuntu-reminders-app-gets-evernote-authentication/
User6: mzanetti, I was suspecting that you'd get that done when I saw your latest screenshot, excellent :)
User5: User6 and I managed to create the project in a way that we don't need to fiddle with LD_LIBRARY_PATH or similar at all
User3: User6 wow seeing your blog for the first time
User6: ah, cool, I was actually going to ask you about that, as I had to go through that when I checked out the branch on another computer today
User6: nik90, yeah, I've not been very active blogging there in the last few months, lots of stuff going on and I was actually blogging more on the developer blog :)
User6: so time to take the dust off my personal blog :)
User3: :)
User5: User6 huh? where did you find follefuder.org as my website?
User6: mzanetti, is that not your blog?
User5: User6 that was the old domain I had... it's still valid, but redirecting to my new one notyetthere.org
User5: that's why I wonder where you've found it
User5: as I shouldn't be referring to it any more
User6: mzanetti, let me update the post. I knew I had read your blog, but googling for michael zanetti blog didn't return any results I could recognize, so I noticed on your last screenshot the follefuder.org domain and I thought I'd try that :)
User6: mzanetti, fixed
User5: cheers
User5: User3 User6 just a heads up: right now you call "notes.note(id)" to get the content of a note. that will change to return a proper Note object with title, content and whatnot. so don't rely on that one too much yet
User6: ack
User3: okay
User5: I think Notebooks and Notes should be pretty close to what the api will be
User5: you can walk through the functions of this api doc and request stuff that you need: http://dev.evernote.com/doc/reference/
User6: excellent
User5: as you need them. otherwise I will probably add stuff I think would make sense
 * dpm nods
User3: User5 will give feedback as I start using it
ubuntu-app-devel
Ubuntu IRC