[Gossip-dev] final account rework

Xavier Claessens xclaesse at gmail.com
Fri Oct 6 15:19:03 CEST 2006


Le mercredi 04 octobre 2006 à 22:53 +0200, Xavier Claessens a écrit :
> Le mardi 03 octobre 2006 à 11:19 +0200, Xavier Claessens a écrit :
> > Le dimanche 01 octobre 2006 à 21:59 +0200, Xavier Claessens a écrit :
> > > Le dimanche 01 octobre 2006 à 18:46 +0200, Xavier Claessens a écrit :
> > > > Hi,
> > > > 
> > > > I'm working on protocol specific UI for creating and editing accounts
> > > > [1]. This work is made for HEAD and will be very useful for telepathy.
> > > > 
> > > > One of the goal of this is removing the deprecated
> > > > gossip_account_[get,set]_*() API and use instead the new API
> > > > gossip_account_param_set(). I'm surprised there is not many places where
> > > > the deprecated API is used, most of it is in my new
> > > > gossip-account-jabber.[ch] module, that's why I'm thinking about
> > > > removing this API completely now.
> > > > 
> > > > For that I need one think: the protocol should create new accounts with
> > > > default values for all parameters. Something like
> > > > 	GossipAccount *gossip_protocol_create_account (GossipProtocol*);
> > > > With telepathy it is already the protocol that creates new accounts and
> > > > it already sets all parameters with default values (Eitan correct me if
> > > > I miss understood the code). In telepathy we directly call
> > > > 	gossip_telepathy_cmgr_new_account_from_protocol
> > > > from protocol/telepathy/ which violate the libgossip abstraction.
> > > > 
> > > > Is that a good idea if I implement all that in my next big account
> > > > rework ? Maybe it's better to make many little patches than one big ?
> > > > 
> > > > btw, new_account_window_get_account_info() has changed in last commit in
> > > > the THELEPATHY branch and don't have the telepathy specific code
> > > > anymore ! what happened ?
> > > > 
> > > > Xavier Claessens.
> > > > 
> > > > [1] http://bugzilla.gnome.org/show_bug.cgi?id=358099
> > > 
> > > 
> > > Here is a patch. Like that we can create a new account with all default
> > > values for a particular protocol using:
> > >   gossip_session_new_account (session, GOSSIP_ACCOUNT_TYPE_JABBER);
> > > It still needs a little work to not use properties in g_object_new but
> > > uses gossip_account_param_set_full() instead, like that we can set a
> > > flag for each parameter, this flag can be used in the UI to sort
> > > optional parameters that can be hidden in a "advanced"
> > > tab/dialog/expander or whatever will be the nicer way.
> > > 
> > > Like always this is not very useful for HEAD but will be very cool for
> > > telepathy. The patch is for HEAD since it doesn't depend directly on
> > > telepathy.
> > > 
> > > What do you think about ?
> > > 
> > > Xavier.
> > 
> > Ok so the work is continuing. The goal of this patch [1] is to get rid
> > of gossip_account_set_* API. The problem that is solved with this patch
> > is if we don't uses gossip_account_set_password for example we don't
> > know what's the type of the "password" parameter. So we need to create
> > all parameters with gossip_account_param_new when creating a new
> > GossipAccount object. Once the parameters created with the good type and
> > flag we can easily change the value with gossip_account_param_set which
> > has the same syntax than g_object_set.
> > 
> > I need some feedback to know if it's the right way to solve the problem.
> > 
> > Thanks,
> > Xavier.
> > 
> > [1] http://users.skynet.be/Zdra/gossip-account.patch
> 
> Here is a big patch [1] to hopefully finish the whole GossipAccount
> rework. It includes and improve 2 patches attached on bugzilla [2]. It
> does:
> 
>  - Remove the deprecated gossip_account_[get/set]_* API
> 
>  - No more GnomeDruid for creating a new account, we can create a new
> account in accounts-dialog and change the settings. There is a
> "Register" button to register the new account on the server. Maybe some
> tooltips can help the user ?
> 
>  - Set a protocol-specific UI to modify account settings.
> 
>  - Add gossip_account_param_[get/set] which are far easier to use. It's
> inspired from g_object_[set/get].
> 
>  - The port is now a guint and not a guint16 since we can't save a
> guint16 in a g_value and it make a crash if we try to collect a guint
> into a guint16.
> 
>  - Add gossip_session_new_account() to create a new account with default
> values for all parameters depending on the protocol. Should it be
> renamed to gossip_session_create_account() ?
> 
> I think it's ready for HEAD. There is still some work to integrate this
> with TELEPATHY:
> 
>  - gossip-account-unknown.[ch] has still to be implemented based on the
> initial UI that Eitan did in the TELEPATHY branch.
> 
>  - gossip_session_new_account() takes only the session and the
> GossipAccountType as parameters. My idea was to call
> gossip_telepathy_cmgr_new_account_from_protocol() to create the new
> account when the telepathy protocol is used, but this functions takes as
> parameters GossipCmgrInfo and the protocol's name. How can it be
> adapted ? Eitan have you an idea for that ? I really think we should
> avoid the actual solution which is directly call this function from the
> UI, it breaks the libgossip abstraction layer.
> 
> Review and comments are welcome.
> 
> Xavier.
> 
> [1] http://users.skynet.be/Zdra/gossip-account.patch and add those 2
> files in src/
> http://users.skynet.be/Zdra/gossip-account-jabber.c
> http://users.skynet.be/Zdra/gossip-account-jabber.h
> 
> [2] http://bugzilla.gnome.org/show_bug.cgi?id=358099 and
> http://bugzilla.gnome.org/show_bug.cgi?id=359619

I finished the gossip-account-unknown module. Would be great to have all
this reviewed :D

The patch
http://users.skynet.be/Zdra/gossip-account.patch
New files in src/
http://users.skynet.be/Zdra/gossip-account-jabber.c
http://users.skynet.be/Zdra/gossip-account-jabber.h
http://users.skynet.be/Zdra/gossip-account-unknown.c
http://users.skynet.be/Zdra/gossip-account-unknown.h

Xavier.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Ceci est une partie de message
	=?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?=
Url : http://lists.imendio.com/pipermail/gossip-dev/attachments/20061006/0e3afd3b/attachment.pgp


More information about the Gossip-dev mailing list