24 lines
637 B
Swift
24 lines
637 B
Swift
import Foundation
|
|
import AppKit
|
|
|
|
class ExportAccessoryView : NSView {
|
|
|
|
@IBOutlet weak var typeBox: NSPopUpButton!
|
|
|
|
var savePanel: NSSavePanel? = nil
|
|
|
|
func setSavePanel(_ savePanel: NSSavePanel?) {
|
|
self.savePanel = savePanel
|
|
}
|
|
|
|
func setPossibleOptions(_ options : Array<String>) {
|
|
for option in options {
|
|
typeBox.addItem(withTitle: option.uppercased())
|
|
}
|
|
}
|
|
|
|
@IBAction func changeFileFormat(_ sender: Any) {
|
|
savePanel?.allowedFileTypes?.removeAll()
|
|
savePanel?.allowedFileTypes?.append((typeBox.titleOfSelectedItem?.lowercased())!)
|
|
}
|
|
}
|