Set the action of the new preset button.

This commit is contained in:
Damiano Galassi committed 2018-04-13 15:55:28 +02:00
1 parent 08a5ba1109
commit 844d57c0d0
3 files changed
+23 -3

No files matched your search

+13
View File
@@ -128,6 +128,19 @@ class PresetPrefsViewController: NSViewController, SectionsTableViewDataSource,
}
}
@IBAction func addPreset(_ sender: Any) {
var index = 0
while true {
do {
let preset = MetadataPreset(title: "Untitled Preset \(index)")
try presetManager.append(newElement: preset)
break
} catch {
index += 1
}
}
}
@IBAction func deletePreset(_ sender: Any) {
let rowIndex = tableView.selectedRow
let sectionRow = tableView.section(for: rowIndex)