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

On Tue, 2002-01-29 at 01:42, Cleber Rodrigues Rosa Junior wrote:
> So, here it's a sample (a.k.a. lame & imcomplete) implementation
> of a GnomeDbConnection as I tought of it.
> There are a couple of things lacking (menu to control the connection,
> a "close" signal on GdaConnection, so that we can update the 
> GnomeDbConnection automatically, plus some other stuff).
> Please tell me wheter to continue this, and also if I should
> change GnomeDbConnectionSelector to use this.
it looks ok, but what worries me is if this is really something useful
to have in the public API. 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_add_connection (selector, dsn, user,
	gnome_db_connection_selector_remove_connection (selector, dsn, user,

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

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. 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.

How does that sound for you?

Rodrigo Moya <rodrigo gnome-db org> - <rodrigo ximian com> -

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