Re: [gnome-db] Connection Widget / Other stuff



> it looks ok, but what worries me is if this is really something useful
> to have in the public API. 

I will try to convinve you of this. As I told you some time ago, I'm
developing an app using GnomeDB and a widget like GnomeDbConnection is
going to be used. Think of sticking it into a status bar, providing
visual feedback of the connection status.

I would find a lot better to tell the user the database connection
closed and offer him a way to connect again instead of just going silent
about it.

My initial idea was to think of my needs as the needs of other
developers, so that when they choose GnomeDB as a development framework,
they'll have a larger framework, meaning faster development.

>I mean, the connection selector is (supposed
> to be) just a GtkOptionMenu with a list of connection strings, a couple
> of signals ("activated", for instance) and nothing more.
> 
> That's why I don't see the need for this GnomeDbConnection widget, if it
> is to be used in the GnomeDbConnectionSelector widget.
> 
> I would vote for you to work on adding a couple of functions to
> gnome-db-connection-selector.c:
> 
> 	gnome_db_connection_selector_add_connection (selector, dsn, user,
> password);
> 	gnome_db_connection_selector_remove_connection (selector, dsn, user,
> password);
> 

Many application won't allow more than one database connection, so
GnomeDbConnectionSelector is useless to them. I just thought we could
re-use the GnomeDbConnection inside the selector.

> In those 2 functions, you'll just add/remove GtkMenuItem's from the
> GnomeDbConnectionSelector (which is a GtkOptionMenu-based class), and
> have the strings displayed be something like 'DSN username', or
> whatever.

I like the display idea, but maybe username DSN makes more sense...

> 
> It is very important that we use strings and not GdaConnection's, since
> the connection selector is used in the frontend, where there are no
> GdaConnection's open at all. 

How can I access a connection based on a string?

> The GdaConnection's are created in the
> different components, but not in the front-end.
> This is because we've got, in the components IDL, 2 methods that are
> used by the components to inform the frontend of different things:
> 
> 	notifyConnectionOpened (dsn, user, password);
> 	notifyConnectionClosed (dsn, user, password);
> 
> so, the frontend just creates the connection selector widget, and when
> it receives these notifications, it just calls
> gnome_db_connection_selector_add/remove_connection appropriately.
> When a connection is selected in the GnomeDbConnectionSelector widget,
> the frontend calls:
> 
> 	selectConnection (dsn, user, password);
> 
> on the currently activated component.
> 
> We can, if you want, also have a couple more functions:
> 
> 	gnome_db_connection_selector_add_connection_object (selector, cnc);
> 	gnome_db_connection_selector_remove_connection_object (selector, cnc).
> 
> But the first thing to implement should be the string-based functions,
> as this is what is really needed first.
> 
> I don't think we should complicate such a simple widget with more
> unneeded public APIs.
> 

After all this talk, it seems to me that my idea of a GnomeDbConnection
would serve a different purpose, and would not fit into a
GnomeDbConnectionSelector after all. Maybe it should be called
GnomeDbConnectionMonitor, meaning what I really want from it.

> How does that sound for you?
> 

What do you think?

> cheers
> -- 
> Rodrigo Moya <rodrigo gnome-db org> - <rodrigo ximian com>
> http://www.gnome-db.org/ - http://www.ximian.com/
> _______________________________________________
> gnome-db-list mailing list
> gnome-db-list gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-db-list
> 





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