Re: MyTime, application to track the use of desktop applications.



Hi Ivan,

We've just released a new version of the accounts system, and I had a chance to play around with MyTime and look at the code.

There were a couple API changes and quite a few additions. Here are some notes that I made after looking at MyTime:

1) The word "kind" was changed to the word "type" in all method names in the online accounts service, so GetAllAccountsWithKinds is now GetAllAccountsWithTypes, and such.

2) You should use GetEnabledAccountsWithTypes rather than GetAllAccountsWithTypes, because you are not checking if an account is enabled locally, and you shouldn't be using accounts the user has disabled.

3) There is a new method called EnsureAccountType which you should call as soon as you get a proxy to the service to make sure that the service knows about the account type(s) that your application cares about when the server that contains the list of all account types is unavailable.

4) You need to connect to the AccountEnabled and AccountDisabled signals from the service, as well as to Changed signal on each individual account you get. When you get AccountEnabled and AccountDisabled signals, you need to check that they are for account types you care about.

5) You can use a dialog available from the online accounts service that lets the user add accounts and enter passwords for a specific set of account types. For example, you can replace the Settings... menu item with "Edit Remote Storage Accounts..." item clicking on which opens an accounts dialog by calling OpenAccountsDialogWithTypes and providing it with "boxnet" type.

6) You can now add a Box.net account type to the list of account types on the server by filling out the form here: http://online.gnome.org/account-type-add
The fields should be:
Name: boxnet
Full Name: Box.net
Site Name: Box.net
Site: http://box.net
User Info Type: Box.net username
Public: Yes
You can go ahead and do that yourself, at which point the account type will show up on http://online.gnome.org/account

7) Finally, online accounts service should now be available in a regular session. You need to have desktop-data-model and online-accounts packages installed. The latest ones are now available on ftp.gnome.org and in rawhide for Fedora. Once you have that, desktop-data-engine and web-login-driver processes should get started automatically when you make a call to the accounts system. (Always make sure to kill the previous ones if you ever decide to start them manually.)

More formal documentation will be coming soon. For now, you can also take a look at the way bigboard's Twitter widget uses most of the API functionality I described above. You can just look at the source code, without necessarily installing and running it.
http://svn.gnome.org/svn/bigboard/trunk/bigboard/stocks/twitter/TwitterStock.py

Please let me know if you have any follow up questions and if things work for you.

Thanks!
Marina

----- Original Message -----
From: "Ivan Gomez Rodriguez" <igomez igalia com>
To: "Marina Zhurakhinskaya" <marinaz redhat com>
Cc: online-desktop-list gnome org
Sent: Wednesday, October 8, 2008 11:08:12 AM GMT -05:00 US/Canada Eastern
Subject: Re: MyTime, application to track the use of desktop applications.

Marina Zhurakhinskaya wrote:
> Hi! 
> 
> This sounds really good! I was planning to do some work to make the online accounts service available outside of the Online Desktop session in the next few weeks, and will take a look at what you did for that in libmytime-common.
> 

It would really interesting can use online account service outside
Online desktop session. Please take a look at the code and ask me all
you want about it, but it's a very simple solution and it still needs
some improvements.

> Also, I am a bit unsure about how you defined box.net account type. Though I haven't had a chance to document the process for it yet and release all the code that enables it on the production server, the way we are expecting account types to be added is by adding them on 
> http://online.gnome.org/account-type-add
> It won't have any affect if you try to use it now, but we should talk next week and add box.net this way. 

Ok, I'll try the way you suggest.

>Did you just add box.net manually to the dictionary of account types in your local version of the accounts system service?
> 

Well, we didn't add it to the dictionary but accounts system allows to
save and get accounts with a kind which is not in the dictionary and we
only use username and password because our box.net client already knows
the service url.

> I am about to go away for the weekend, but I will definitely take a look at your code next week.
> 
> Thanks,
> Marina
> 

I hope our code could be useful for you.

Thanks,
	Iván Gómez


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]