10 Commits
18 changed files with 91 additions and 41 deletions

No files matched your search

+11 -11
View File
@@ -26,20 +26,20 @@
<rect key="frame" x="0.0" y="0.0" width="378" height="351"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView wantsLayer="YES" autohidesScrollers="YES" horizontalLineScroll="21" horizontalPageScroll="10" verticalLineScroll="21" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3">
<scrollView wantsLayer="YES" autohidesScrollers="YES" horizontalLineScroll="23" horizontalPageScroll="10" verticalLineScroll="23" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3">
<rect key="frame" x="-1" y="46" width="380" height="306"/>
<clipView key="contentView" id="ix7-yM-0F6">
<rect key="frame" x="1" y="1" width="378" height="304"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="firstColumnOnly" tableStyle="plain" alternatingRowBackgroundColors="YES" columnReordering="NO" columnResizing="NO" autosaveColumns="NO" rowSizeStyle="automatic" viewBased="YES" id="7" customClass="ExpandedTableView" customModule="Subler" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="378" height="304"/>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="firstColumnOnly" alternatingRowBackgroundColors="YES" columnReordering="NO" columnResizing="NO" autosaveColumns="NO" rowHeight="19" rowSizeStyle="automatic" viewBased="YES" id="7" customClass="ExpandedTableView" customModule="Subler" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="390" height="304"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<size key="intercellSpacing" width="3" height="4"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
<tableColumn identifier="nameColumn" editable="NO" width="375" minWidth="40" maxWidth="3000" id="8">
<tableColumn identifier="nameColumn" editable="NO" width="378" minWidth="40" maxWidth="3000" id="8">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="nameColumn">
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" white="0.33333298560000002" alpha="1" colorSpace="calibratedWhite"/>
@@ -52,25 +52,25 @@
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES"/>
<prototypeCellViews>
<tableCellView id="ofF-gY-wBR">
<rect key="frame" x="1" y="2" width="375" height="17"/>
<rect key="frame" x="1" y="2" width="387" height="19"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="pjh-GC-aOA">
<rect key="frame" x="29" y="-1" width="317" height="17"/>
<rect key="frame" x="29" y="2" width="329" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" id="srx-EJ-mK6">
<font key="font" metaFont="cellTitle"/>
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Xeb-eQ-90j">
<rect key="frame" x="7" y="0.0" width="16" height="16"/>
<rect key="frame" x="7" y="2" width="16" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="EncodeComplete" id="uXb-c3-MQO"/>
</imageView>
<button toolTip="Show item info" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="o98-wM-YAQ">
<rect key="frame" x="352" y="0.0" width="16" height="16"/>
<rect key="frame" x="364" y="2" width="16" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="bevel" bezelStyle="rounded" image="info" imagePosition="overlaps" alignment="center" alternateImage="info-pressed" imageScaling="proportionallyDown" inset="2" id="AFW-1U-iaL">
<behavior key="behavior" lightByContents="YES"/>
@@ -99,8 +99,8 @@
</tableView>
</subviews>
</clipView>
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="6">
<rect key="frame" x="1" y="271" width="378" height="15"/>
<scroller key="horizontalScroller" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="0.25" horizontal="YES" id="6">
<rect key="frame" x="1" y="289" width="378" height="16"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="4">
@@ -13,7 +13,7 @@
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" toolbarStyle="expanded" id="s5f-yH-26m" userLabel="Window">
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" toolbarStyle="expanded" id="s5f-yH-26m" userLabel="Window">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="70" y="318" width="520" height="510"/>
+1
View File
@@ -38,6 +38,7 @@ final class ButtonToolbarItem : NSToolbarItem {
super.init(itemIdentifier: itemIdentifier)
self.label = label
self.paletteLabel = label
self.toolTip = toolTip
self.setSymbol(symbolName: symbolName, fallbackName: image)
self.action = action
+5 -1
View File
@@ -7,6 +7,10 @@
import Cocoa
final class CheckBoxCellView : NSTableCellView {
final class CheckBoxCellView : NSTableCellView, ExpandedTableViewCellActionable {
@IBOutlet var checkboxButton: NSButton!
func performAction() {
self.checkboxButton.performClick(self)
}
}
+11 -3
View File
@@ -14,7 +14,7 @@ import Cocoa
@MainActor @objc optional func collectionViewPaste(to collectionView: NSCollectionView)
}
class CollectionView: NSCollectionView, NSMenuItemValidation {
class CollectionView: NSCollectionView, NSUserInterfaceValidations {
var pasteboardTypes: [NSPasteboard.PasteboardType]
var pasteboardHasSupportedType: Bool {
@@ -67,6 +67,14 @@ class CollectionView: NSCollectionView, NSMenuItemValidation {
else if key == 27 && isSelected {
deselectAll(self)
}
else if self.isSelectionEmpty && (key == NSUpArrowFunctionKey || key == NSDownArrowFunctionKey) {
let indexPathSet = Set([IndexPath(item: 0, section: 0)])
animator().selectItems(at: indexPathSet, scrollPosition: .bottom)
delegate?.collectionView?(self, didSelectItemsAt: indexPathSet)
}
else if self.isSelectionEmpty && (key == NSRightArrowFunctionKey || key == NSLeftArrowFunctionKey) {
self.window?.windowController?.keyDown(with: event)
}
else {
super.keyDown(with: event)
}
@@ -104,8 +112,8 @@ class CollectionView: NSCollectionView, NSMenuItemValidation {
}
}
func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
if let action = menuItem.action {
func validateUserInterfaceItem(_ item: NSValidatedUserInterfaceItem) -> Bool {
if let action = item.action {
switch action {
case #selector(delete(_:)):
if isSelectionEmpty || implements(selector: #selector(CollectionViewDelegate.collectionViewDelete(in:))) == false {
+2
View File
@@ -76,6 +76,7 @@ class DocumentToolbarDelegate: NSObject, NSToolbarDelegate {
if #available(macOS 10.15, *) {
let item = NSMenuToolbarItem(itemIdentifier: itemIdentifier)
item.label = label
item.paletteLabel = label
if #available(macOS 11.0, *) {
item.image = NSImage.init(systemSymbolName: "ellipsis.circle", accessibilityDescription: nil)
} else {
@@ -96,6 +97,7 @@ class DocumentToolbarDelegate: NSObject, NSToolbarDelegate {
let item = ButtonToolbarItem(itemIdentifier: itemIdentifier)
item.label = label
item.paletteLabel = label
item.view = popUpButton
item.minSize = NSSize(width: 48, height: 16)
+20 -5
View File
@@ -14,7 +14,11 @@ import Cocoa
@MainActor @objc optional func paste(to tableview: NSTableView)
}
class ExpandedTableView: NSTableView, NSMenuItemValidation {
protocol ExpandedTableViewCellActionable {
func performAction()
}
class ExpandedTableView: NSTableView {
var pasteboardTypes: [NSPasteboard.PasteboardType]
var pasteboardHasSupportedType: Bool {
@@ -59,12 +63,20 @@ class ExpandedTableView: NSTableView, NSMenuItemValidation {
super.init(coder: coder)
}
private func performAction() {
if let view = self.view(atColumn: defaultEditingColumn, row: selectedRow, makeIfNecessary: false) as? ExpandedTableViewCellActionable {
view.performAction()
} else {
editColumn(defaultEditingColumn, row: selectedRow, with: nil, select: true)
}
}
override func keyDown(with event: NSEvent) {
guard let key = event.charactersIgnoringModifiers?.utf16.first else { super.keyDown(with: event); return }
if (key == NSEnterCharacter || key == NSCarriageReturnCharacter) && defaultEditingColumn > 0 {
editColumn(defaultEditingColumn, row: selectedRow, with: nil, select: true)
performAction()
}
else if (key == NSDeleteCharacter || key == NSDeleteFunctionKey) && implements(selector: #selector(ExpandedTableViewDelegate.deleteSelection(in:))) {
if selectedRow == -1 {
@@ -73,6 +85,9 @@ class ExpandedTableView: NSTableView, NSMenuItemValidation {
expandedDelegate?.deleteSelection!(in: self)
}
}
else if key == NSRightArrowFunctionKey || key == NSLeftArrowFunctionKey {
self.window?.windowController?.keyDown(with: event)
}
else if key == 27 && selectedRow != -1 {
deselectAll(self)
}
@@ -114,8 +129,8 @@ class ExpandedTableView: NSTableView, NSMenuItemValidation {
}
}
func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
if let action = menuItem.action {
override func validateUserInterfaceItem(_ item: NSValidatedUserInterfaceItem) -> Bool {
if let action = item.action {
switch action {
case #selector(delete(_:)):
if selectedRow == -1 || implements(selector: #selector(ExpandedTableViewDelegate.deleteSelection(in:))) == false {
@@ -137,6 +152,6 @@ class ExpandedTableView: NSTableView, NSMenuItemValidation {
break
}
}
return true
return super.validateUserInterfaceItem(item)
}
}
+3 -3
View File
@@ -12,7 +12,7 @@ protocol FileImportControllerDelegate : AnyObject {
func didSelect(tracks: [MP42Track], metadata: MP42Metadata?)
}
final class FileImportController: ViewController, NSTableViewDataSource, NSTableViewDelegate, NSMenuItemValidation {
final class FileImportController: ViewController, NSTableViewDataSource, NSTableViewDelegate, NSUserInterfaceValidations {
private enum ItemType {
case file(MP42FileImporter)
@@ -245,8 +245,8 @@ final class FileImportController: ViewController, NSTableViewDataSource, NSTable
reloadCheckColumn(forRowIndexes: indexes)
}
func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
if let action = menuItem.action,
func validateUserInterfaceItem(_ item: NSValidatedUserInterfaceItem) -> Bool {
if let action = item.action,
action == #selector(self.checkSelected(_:)) ||
action == #selector(self.uncheckSelected(_:)) ||
action == #selector(self.checkOnlyTracksWithSameLanguage(_:)) {
@@ -38,6 +38,10 @@ class MetadataSearchViewController: ViewController, MetadataSearchControllerDele
view.addSubview(metadataViewController.view)
}
override func viewDidAppear() {
self.view.window?.autorecalculatesKeyViewLoop = true
}
override func addChild(_ childViewController: NSViewController) {
childViewController.view.frame.size = view.frame.size
childViewController.view.autoresizingMask = [NSView.AutoresizingMask.width, NSView.AutoresizingMask.height]
+2 -2
View File
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15504" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15504"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
+3 -3
View File
@@ -8,7 +8,7 @@
import Cocoa
import MP42Foundation
final class OptionsViewController: NSViewController, NSMenuItemValidation {
final class OptionsViewController: NSViewController, NSUserInterfaceValidations {
@IBOutlet weak var sendToExternalApp: NSButton!
@IBOutlet var destButton: NSPopUpButton!
@@ -98,8 +98,8 @@ final class OptionsViewController: NSViewController, NSMenuItemValidation {
preparePresetsPopUp()
}
func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
switch menuItem.action {
func validateUserInterfaceItem(_ item: NSValidatedUserInterfaceItem) -> Bool {
switch item.action {
case #selector(chooseDestination(_:)),
#selector(destination(_:)):
return true
+5 -1
View File
@@ -7,6 +7,10 @@
import Cocoa
final class PopUpCellView : NSTableCellView {
final class PopUpCellView : NSTableCellView, ExpandedTableViewCellActionable {
@IBOutlet var popUpButton: NSPopUpButton!
func performAction() {
self.popUpButton.performClick(self)
}
}
+3 -3
View File
@@ -9,11 +9,11 @@ import Cocoa
class PrefsWindow: NSWindow {
override func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
if menuItem.action == #selector(NSWindow.toggleToolbarShown(_:)) {
override func validateUserInterfaceItem(_ item: NSValidatedUserInterfaceItem) -> Bool {
if item.action == #selector(NSWindow.toggleToolbarShown(_:)) {
return false
}
return super.validateMenuItem(menuItem)
return super.validateUserInterfaceItem(item)
}
}
@@ -117,6 +117,7 @@ class MovieViewController: PropertyView, NSTableViewDataSource, ExpandedTableVie
columnWidth = column.width
metadataTableView.defaultEditingColumn = 1
metadataTableView.doubleAction = #selector(doubleClickAction(_:))
metadataTableView.target = self
metadataTableView.pasteboardTypes = [.metadataDragType]
@@ -765,7 +766,7 @@ class MovieViewController: PropertyView, NSTableViewDataSource, ExpandedTableVie
func paste(to tableview: NSTableView) {
let pb = NSPasteboard.general
if let archivedData = pb.data(forType: .metadataDragType),
let data = try? NSKeyedUnarchiver.unarchivedObject(ofClasses: [MP42MetadataItem.classForCoder()], from: archivedData) as? [MP42MetadataItem] {
let data = try? NSKeyedUnarchiver.unarchivedObject(ofClasses: [NSArray.classForCoder(), MP42MetadataItem.classForCoder()], from: archivedData) as? [MP42MetadataItem] {
add(metadataItems: data)
}
}
+1 -1
View File
@@ -416,7 +416,7 @@ import MP42Foundation
statusInternal = QueueItem.Status(rawValue: Int(aDecoder.decodeInt32(forKey: "SBQueueItemStatus"))) ?? .failed
mp4File = aDecoder.decodeObject(of: [MP42File.classForCoder()], forKey: "SBQueueItemMp4File") as? MP42File
uniqueID = aDecoder.decodeObject(of: [NSString.classForCoder()], forKey: "SBQueueItemID") as! String
attributes = aDecoder.decodeObject(of: [NSDictionary.classForCoder()], forKey: "SBQueueItemAttributes") as! [String : Any]
attributes = aDecoder.decodeObject(of: [NSDictionary.classForCoder(), NSString.classForCoder(), NSNumber.classForCoder()], forKey: "SBQueueItemAttributes") as! [String : Any]
#if SB_SANDBOX
if var bookmark = aDecoder.decodeObject(of: [NSData.classForCoder()], forKey: "SBQueueItemFileURLBookmark") as? Data {
+12 -1
View File
@@ -1,11 +1,22 @@
# Subler News
## Subler 1.8.5
- Improved keyboard navigation in the document window
- Fixed FLAC audio decoding
## Subler 1.8.4
- Fixed metadata copy & paste
## Subler 1.8.3
- Reworked windows toolbars
- Improved AppleTV provider artworks matching to avoid showing unrelated artworks
- Fixed a regressione that broke ALAC muxing
- Fixed a regression that broke ALAC muxing
## Subler 1.8.2
+4 -4
View File
@@ -1390,7 +1390,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1.8.3;
CURRENT_PROJECT_VERSION = 1.8.5;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
@@ -1407,7 +1407,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.8.3;
MARKETING_VERSION = 1.8.5;
OTHER_CFLAGS = "";
OTHER_LDFLAGS = "-Wl,-rpath,@loader_path/../Frameworks";
OTHER_SWIFT_FLAGS = "";
@@ -1431,7 +1431,7 @@
CODE_SIGN_IDENTITY = "Mac Developer";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1.8.3;
CURRENT_PROJECT_VERSION = 1.8.5;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
@@ -1447,7 +1447,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.8.3;
MARKETING_VERSION = 1.8.5;
OTHER_CFLAGS = "";
OTHER_LDFLAGS = "-Wl,-rpath,@loader_path/../Frameworks";
OTHER_SWIFT_FLAGS = "";