Create File
This commit is contained in:
parent
0da47af13f
commit
6d6215d47f
|
@ -434,6 +434,18 @@ class ASProjDoc: NSDocument, NSOutlineViewDelegate, NSMenuDelegate, NSOpenSavePa
|
|||
outline.reloadData()
|
||||
}
|
||||
|
||||
@IBAction func createFile(AnyObject) {
|
||||
let savePanel = NSSavePanel()
|
||||
savePanel.allowedFileTypes =
|
||||
[kUTTypeCSource, kUTTypeCHeader, kUTTypeCPlusPlusSource, kUTTypeCSource,
|
||||
"public.assembly-source", "net.daringfireball.markdown"]
|
||||
savePanel.beginSheetModalForWindow(outline.window!, completionHandler: { (returnCode) -> Void in
|
||||
if returnCode == NSFileHandlingPanelOKButton {
|
||||
self.createFileAtURL(savePanel.URL!)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// MARK: Editor configuration
|
||||
|
||||
@IBAction func changeTheme(item: NSMenuItem) {
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
<items>
|
||||
<menuItem title="File" keyEquivalent="n" id="Was-JA-tGl">
|
||||
<connections>
|
||||
<action selector="newDocument:" target="-1" id="4Si-XN-c54"/>
|
||||
<action selector="createFile:" target="-1" id="rEL-As-mOF"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Sketch" keyEquivalent="N" id="2hE-2e-TSR">
|
||||
|
|
Loading…
Reference in New Issue
Block a user