 
     @dbController.on "DatabaseAdded", (data)=>
 
+      @databaseAdded(data)
+
       dbCreateForm.inputs.dbType.makeDisabled()
       dbCreateForm.inputs.dbKind.makeDisabled()
       @newDBCreatedWidget?.destroy?()

class ManageDatabasesModal extends KDModalViewWithForms

  constructor:(options = {}, data)->

    options =
      title                   : "Manage Databases"

        KD.utils.wait 300, => @setPositions()

      @dbController.loadItems()

  ## LOG: Duplicate entries in database.
  databaseAdded: (data)->
    if @databases[data.dbName]
      KD.logToExternal msg:"duplicate database", dbName:data.dbName
    else
      @databases[data.dbName] = true
  ##

class AccountDatabaseListController extends KDListViewController

