Support saving serial logs
This commit is contained in:
parent
c1ea478c46
commit
a27334c768
|
@ -237,4 +237,16 @@ class ASSerialWin: NSWindowController {
|
|||
serialDefaults.setValue(portDefaults, forKey:port)
|
||||
userDefaults.setObject(serialDefaults, forKey:"SerialDefaults")
|
||||
}
|
||||
|
||||
@IBAction func saveDocument(AnyObject) {
|
||||
let savePanel = NSSavePanel()
|
||||
savePanel.allowedFileTypes = ["log"]
|
||||
savePanel.allowsOtherFileTypes = true
|
||||
savePanel.extensionHidden = false
|
||||
savePanel.beginSheetModalForWindow(window!, completionHandler: { (returnCode) -> Void in
|
||||
if returnCode == NSFileHandlingPanelOKButton {
|
||||
self.serialData.writeToURL(savePanel.URL!, atomically:false, encoding:NSUTF8StringEncoding, error:nil)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user