多选的时候disable复制按钮

This commit is contained in:
秦宇航
2017-04-24 16:01:10 +08:00
parent b89f61021c
commit 40944fda80
@@ -371,6 +371,11 @@ class PreferencesWindowController: NSWindowController
func tableViewSelectionDidChange(_ notification: Notification) {
if profilesTableView.selectedRow >= 0 {
bindProfile(profilesTableView.selectedRow)
if (profilesTableView.selectedRowIndexes.count > 1){
duplicateProfileButton.isEnabled = false
} else {
duplicateProfileButton.isEnabled = true
}
} else {
if !profileMgr.profiles.isEmpty {
let index = IndexSet(integer: profileMgr.profiles.count - 1)