 
   openFile: (metadata, callback = null) ->
     if metadata?.provider?.can 'load', metadata
+      @_event 'willOpenFile', {op: "openFile"}
       metadata.provider.load metadata, (err, content) =>
         return @alert(err, => @ready()) if err
         # should wait to close current file until client signals open is complete

      @rename @state.metadata, newName, callback

  revertToLastOpened: (callback = null) ->
    if @state.openedContent? and @state.metadata
      @_fileOpened @state.openedContent, @state.metadata, {openedContent: @state.openedContent.clone()}


      callback "Unable to temporarily save copied file"

  openCopiedFile: (copyParams) ->
    @_event 'willOpenFile', {op: "openCopiedFile"}
    try
      key = "cfm-copy::#{copyParams}"
      copied = JSON.parse window.localStorage.getItem key
