Revert "Add a check all and uncheck all menu items to the file importer"

This reverts commit e520b13a4f.
This commit is contained in:
Damiano Galassi committed 2025-03-11 10:59:28 +01:00
1 parent 73f3fee7b0
commit b26bcea29a
2 files changed
+9 -38

No files matched your search

+4 -17
View File
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23504" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23504"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22690"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -36,21 +36,8 @@
<action selector="checkOnlyTracksWithSameLanguage:" target="-2" id="3Gg-ed-oeo"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="XqU-K4-wr2"/>
<menuItem title="Uncheck all" id="CSo-l5-OQn">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="uncheckAll:" target="-2" id="1ij-4B-ZXg"/>
</connections>
</menuItem>
<menuItem title="Check all" id="ivD-V3-8h5">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="checkAll:" target="-2" id="3F4-ah-wZn"/>
</connections>
</menuItem>
</items>
<point key="canvasLocation" x="-421" y="140"/>
<point key="canvasLocation" x="139" y="146"/>
</menu>
<view id="XhE-7o-ek3">
<rect key="frame" x="0.0" y="0.0" width="683" height="283"/>
@@ -280,7 +267,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="bevel" bezelStyle="rounded" alignment="left" controlSize="small" lineBreakMode="truncatingTail" imageScaling="proportionallyDown" inset="2" id="FNV-pf-MUt">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="message"/>
<font key="font" metaFont="menu"/>
<menu key="menu" id="i8l-4s-h93"/>
</popUpButtonCell>
<connections>
+5 -21
View File
@@ -259,22 +259,14 @@ final class FileImportController: ViewController, NSTableViewDataSource, NSTable
}
func validateUserInterfaceItem(_ item: NSValidatedUserInterfaceItem) -> Bool {
guard let action = item.action else { return false }
switch action {
case #selector(self.checkSelected(_:)): fallthrough
case #selector(self.uncheckSelected(_:)): fallthrough
case #selector(self.checkOnlyTracksWithSameLanguage(_:)):
if let action = item.action,
action == #selector(self.checkSelected(_:)) ||
action == #selector(self.uncheckSelected(_:)) ||
action == #selector(self.checkOnlyTracksWithSameLanguage(_:)) {
if tracksTableView.selectedRow != -1 || tracksTableView.clickedRow != -1 {
return true
}
case #selector(self.checkAll(_:)): fallthrough
case #selector(self.uncheckAll(_:)):
return true
default:
return false
}
return false
}
@@ -285,15 +277,7 @@ final class FileImportController: ViewController, NSTableViewDataSource, NSTable
@IBAction func uncheckSelected(_ sender: Any) {
setCheck(value: false, forIndexes: tracksTableView.targetedRowIndexes)
}
@IBAction func checkAll(_ sender: Any) {
setCheck(value: true, forIndexes: IndexSet(integersIn: 0..<items.count))
}
@IBAction func uncheckAll(_ sender: Any) {
setCheck(value: false, forIndexes: IndexSet(integersIn: 0..<items.count))
}
@IBAction func checkOnlyTracksWithSameLanguage(_ sender: Any) {
let languages = tracksTableView.targetedRowIndexes.compactMap { (index: Int) -> String? in
let item = items[index]