Re: organize a little the code



El jue, 06-03-2008 a las 10:11 -0300, Francisco Rojas escribió
> I propose organize a Little the code, so my idea is make a few class to
> separate the code from ui.


First thing I'd do is to separate the code that's related to the main
window from the code related to each instance of an administrator.

Something like GyrusApp (or GyrusWindow, if you prefer), just a class
that implements an empty application (that is, without any session
open).

Then, another class with the UI required to manage a single session.
Derived from a particular GtkBox, each instance can be added to the main
GtkNotebook.

Other widget that deserves to be in his own class is the ACL treeview.
I'd call it GyrusAclTreeview or something like that. That should take
care, given a connection, to manage all what's related to the access
lists.

Also the mailboxes treeview could be a separate class
(GyrusMailboxesTreeview ?). That way we can add fancy features to it
without messing with the rest of the GyrusAdmin.

The communication between the different components could be handled by
means of signals, to make it saner.

The dialog to open sessions should definitively be organized as a class
(if it's not already). I'd suggest a name like GyrusSessionSelector,
derived from GtkDialog. In the same sense, the dialog to edit a session
should be a different class (GyrusSessionEditor, derived from GtkDialog
as well). Then, on edition of a session, GyrusSessionSelector creates a
new instance of the editor with a particular session. On creation of a
new session, GyrusSessionSelector creates a new instance of the editor,
but without giving it a session.

So far these are the different componentes that I think should be in
separate classes.


El jue, 06-03-2008 a las 10:24 -0300, Alejandro Valdes Jimenez escribió:
 
> Where do you will create the new class? in a separate files or in one
> only.
> 

The rule has always been one class, one file.

HTH,

Claudio

-- 
Claudio Saavedra <csaavedra alumnos utalca cl>



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