Re: final account rework

Xavier Claessens <[email protected]> Tue, 03 Oct 2006 11:19:10 +0200
Newsgroups gmane.comp.gnome.gossip.devel
Message-ID <1159867150.18909.1.camel@zdra-desktop>
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

_______________________________________________
Gossip-dev mailing list
[email protected]
http://lists.imendio.com/mailman/listinfo/gossip-dev
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD4DBQBFIisO6dEBUn2qPAMRArCtAJjBBdlpK5BzLtR3yGPWRHTWtdJ7AJ4wBbp2
7VhwWXYBVyd2mwlJGo+4dg==
=bmho
-----END PGP SIGNATURE-----