[Ekiga-devel-list] About accounts


I had ideas this night, about a reorganisation of the accounts.

GmAccount class

Signals :
 - updated (name change, status change)
 - removed (explicit)

Methods :
- const gchar *get_name (const GmAccount *) : to know the name of the account ; - const gchar *get_status (const GmAccount *) : a descriptive string ; something like "", "Connecting", "Authenticating", "Connected", "Authentification failed", etc - gboolean connect_at_startup (const GmAccount *) : so ekiga knows if it should trigger the connection at startup -- in fact ekiga doesn't know how to do it so it will be the GmAccount itself which when created will check it and act accordingly ; - void set_connect_at_startup (GmAccount *, gboolean value) : so the user can choose if the account should be connected at startup ; - void populate_menu (const GmAccount *, GtkWidget *menu) : so the object can add specific actions to a menu (like : edit, connect, cancel connection, disconnect, remove, purge from server, ...)

GmBank class
(I'm not entirely happy with the name, but thought it was intuitive to put accounts in banks... and it's april first after all!)

Signals :
 - removed (explicit)
 - account-added (explicit, comes with a GmAccount*)
 - account-removed (explicit, comes with a GmAccount*)

Methods :
- const gchar *get_name (const GmBank *) : short name to allow a choice in a drop-down list ; - const gchar *get_tooltip (const GmBank *) : longer text describing the bank, so the user understands what (s)he chose ; - const GSList *get_accounts (const GmBank *) : to get the list of accounts in this bank (after a call to this function, you're supposed to use the signals to keep up to date) ; - gboolean can_create_account (const GmBank *) : whether this bank can create new accounts ; - void create_account (GmBank *) : make the GmBank create an account -- it will either do so automatically, or ask the user whatever it needs to build one -- notice the void return ; we'll know if it worked or not with the signals.

AccountsCore class

Methods :
- const GSList *get_banks (const AccountsCore *) : get the list of banks, to be able to display them - void add_bank (AccountsCore *, GmBank *) : adds a new bank to the accounts core

Factoring code

Those of you who already had a peek at my new contact code will recognize the following parallels :
ContactsCore <-> AccountsCore
GmSource     <-> GmBank
GmBook       <-> GmAccount
So I was thinking it could be easy to factor out things to limit the code size. Unfortunately, I could think about nice names for those base classes.

Comments welcome!


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