   dialog.show()
   input.setFocus()
 
-  finderController = kd.singletons['appManager'].get('Finder').create
+  finderController = kd.singletons.appManager.get('Finder').create
     addAppTitle       : no
     treeItemClass     : IDEFinderItem
     nodeIdPath        : 'path'

    contextMenu       : yes
    loadFilesOnInit   : yes
    machineToMount    : options.machine

  finderController.reset()

  form.addSubView finderWrapper = new KDView { cssClass : 'save-as-dialog save-file-container' }, null
  finderWrapper.addSubView finderController.getView()
  finderWrapper.setHeight 200

  # FIXME: rootpath should be taken from options.
  # i don't want to do it for now because this file should be
  # refactored from the first line and should be moved to somewhere else.
  # for now we can live with it and assuming appManager.frontApp is IDE in
  # this case is safe because this is save/save-as modal.
  if machine = options.machine
    if ideApp = envDataProvider.getIDEFromUId machine.uid
      { rootPath } = ideApp.workspaceData
      finderController.updateMachineRoot machine.uid, rootPath

envDataProvider = require 'app/userenvironmentdataprovider'


module.exports = showSaveDialog = (container, callback = kd.noop, options = {}) ->

  container.addSubView dialog = new KDDialogView
    cssClass      : kd.utils.curry 'save-as-dialog', options.cssClass
