
Alright, after a week of hacking and poking around in areas of the Mac OS that I knew existed, but I hadn't poked around in, the common login panel for the ODBCKit is nearing completion. This has been an interesting and educational week.
What you see here, is the new common dialog in the PGSQLKit's PGSQLLogin class. Using the panel itself is fairly easy. It requires two pieces. The first, handle the delegate call from the login panel and then instantiate the PGSQLLogin class and call the beginModalLoginForWindow method passing in your own window.
In code, the login call itself would look like the following:
When the user exits the login panel, the class will call your loginCompleted implementation allowing you to do whatever you may need. In the following example, it uses the returned connection to retain the connection for use in the lifespan of the application and logs the state using NSLog();.

In and of itself, this is not terribly complex, but behind the scenes, there is quite a bit of heavy lifting going. Creating the connections is just a small part of the work here. In order to make the panel more powerful and flexible, the panel itself embeds logic to save connections in the powerful and cool Keychain.
If the user enters an account and a name, the dialog will save that connection complete with password in the Keychain for quick retrieval later. That information can be edited and viewed in the Keychain Access tool, like this:


