Rename PresetPrefsViewController

This commit is contained in:
Damiano Galassi committed 2018-03-07 18:13:42 +01:00
1 parent 519fa17893
commit 3b461e7c3c
5 files changed
+45 -35

No files matched your search

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13528" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14105" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13528"/>
<plugIn identifier="com.apple.imagekit.ibplugin" version="13528"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14105"/>
<plugIn identifier="com.apple.imagekit.ibplugin" version="14105"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -333,7 +333,7 @@
<subviews>
<comboBox verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="1000" translatesAutoresizingMaskIntoConstraints="NO" id="LbC-r6-Pau">
<rect key="frame" x="3" y="0.0" width="344" height="19"/>
<comboBoxCell key="cell" controlSize="small" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" alignment="left" title="Do not localize" usesSingleLineMode="YES" buttonBordered="NO" numberOfVisibleItems="5" id="jkg-xz-Hbn" customClass="ComboBoxCell" customModule="Subler" customModuleProvider="target">
<comboBoxCell key="cell" controlSize="small" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" alignment="left" title="Do not localize" usesSingleLineMode="YES" buttonBordered="NO" numberOfVisibleItems="5" id="jkg-xz-Hbn">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
@@ -1,13 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14087.3" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14105" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14087.3"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14105"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="SBSetPrefsViewController">
<customObject id="-2" userLabel="File's Owner" customClass="PresetPrefsViewController" customModule="Subler" customModuleProvider="target">
<connections>
<outlet property="editSetButton" destination="C1d-lu-T7S" id="iCc-jn-QrW"/>
<outlet property="removeSetButton" destination="SIg-lA-6FA" id="qp7-Jg-UWz"/>
<outlet property="tableView" destination="iRF-P7-a3Q" id="Z1g-o6-Efc"/>
<outlet property="view" destination="Sl5-b6-dQC" id="c8S-a4-aHa"/>
@@ -16,11 +17,11 @@
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView id="Sl5-b6-dQC">
<rect key="frame" x="0.0" y="0.0" width="396" height="266"/>
<rect key="frame" x="0.0" y="0.0" width="396" height="268"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Bgi-pA-eAO">
<rect key="frame" x="20" y="46" width="356" height="200"/>
<rect key="frame" x="20" y="48" width="356" height="200"/>
<clipView key="contentView" id="PH5-A6-LVO">
<rect key="frame" x="1" y="1" width="354" height="198"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -50,7 +51,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="G0s-9P-sPN">
<rect key="frame" x="0.0" y="0.0" width="326" height="17"/>
<rect key="frame" x="0.0" y="0.0" width="350" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" title="Table View Cell" id="6CG-pa-ocP">
<font key="font" metaFont="system"/>
@@ -61,18 +62,6 @@
<outlet property="delegate" destination="-2" id="2Uf-Z0-tF7"/>
</connections>
</textField>
<button toolTip="Show set details" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="IXy-8d-VMc">
<rect key="frame" x="332" y="0.0" width="16" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="bevel" bezelStyle="regularSquare" image="info" imagePosition="overlaps" alignment="center" alternateImage="info-pressed" imageScaling="proportionallyDown" inset="2" id="BeK-4k-Hpl">
<behavior key="behavior" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<accessibility description="Set details"/>
<connections>
<action selector="toggleInfoWindow:" target="-2" id="k0G-nt-Bqd"/>
</connections>
</button>
</subviews>
<connections>
<outlet property="textField" destination="G0s-9P-sPN" id="9Vs-Rk-Gcm"/>
@@ -103,9 +92,10 @@
</scroller>
</scrollView>
<button toolTip="Remove selected set" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="SIg-lA-6FA">
<rect key="frame" x="20" y="19" width="25" height="21"/>
<rect key="frame" x="20" y="19" width="25" height="23"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="25" id="KCi-qM-zwt"/>
<constraint firstAttribute="height" constant="21" id="MLy-Qh-J3X"/>
</constraints>
<buttonCell key="cell" type="smallSquare" bezelStyle="smallSquare" image="NSRemoveTemplate" imagePosition="overlaps" alignment="center" enabled="NO" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Y2I-ux-1v2">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@@ -115,22 +105,36 @@
<action selector="deletePreset:" target="-2" id="afj-BK-TQl"/>
</connections>
</button>
<button toolTip="Edit selected set" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="C1d-lu-T7S">
<rect key="frame" x="53" y="19" width="45" height="23"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="45" id="8we-xP-MsB"/>
</constraints>
<buttonCell key="cell" type="smallSquare" title="Edit" bezelStyle="smallSquare" imagePosition="overlaps" alignment="center" enabled="NO" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="W45-Bf-XCJ">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="editPreset:" target="-2" id="u8x-oY-2Gk"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="SIg-lA-6FA" firstAttribute="top" secondItem="Bgi-pA-eAO" secondAttribute="bottom" constant="7" id="0sg-zC-Z0Q"/>
<constraint firstItem="SIg-lA-6FA" firstAttribute="leading" secondItem="Sl5-b6-dQC" secondAttribute="leading" constant="20" id="4SR-ez-TOh"/>
<constraint firstItem="Bgi-pA-eAO" firstAttribute="top" secondItem="Sl5-b6-dQC" secondAttribute="top" constant="20" id="CfB-Vj-Oio"/>
<constraint firstItem="C1d-lu-T7S" firstAttribute="centerY" secondItem="SIg-lA-6FA" secondAttribute="centerY" id="D3e-th-GNg"/>
<constraint firstItem="C1d-lu-T7S" firstAttribute="leading" secondItem="SIg-lA-6FA" secondAttribute="trailing" constant="8" id="R2g-fk-MQZ"/>
<constraint firstItem="Bgi-pA-eAO" firstAttribute="leading" secondItem="Sl5-b6-dQC" secondAttribute="leading" constant="20" id="SNz-hG-5Nz"/>
<constraint firstAttribute="trailing" secondItem="Bgi-pA-eAO" secondAttribute="trailing" constant="20" id="cgL-bl-uVt"/>
<constraint firstAttribute="bottom" secondItem="SIg-lA-6FA" secondAttribute="bottom" constant="20" symbolic="YES" id="iX7-35-KVJ"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="SIg-lA-6FA" secondAttribute="trailing" constant="20" symbolic="YES" id="ssz-R1-wNZ"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="C1d-lu-T7S" secondAttribute="trailing" constant="20" symbolic="YES" id="ydN-Lk-gHL"/>
</constraints>
<point key="canvasLocation" x="-347" y="-669"/>
</customView>
</objects>
<resources>
<image name="NSRemoveTemplate" width="11" height="11"/>
<image name="info" width="16" height="16"/>
<image name="info-pressed" width="16" height="16"/>
</resources>
</document>
+5 -3
View File
@@ -14,12 +14,13 @@ class PresetPrefsViewController: NSViewController, NSTableViewDataSource, NSTabl
@IBOutlet var tableView: NSTableView!
@IBOutlet var removeSetButton: NSButton!
@IBOutlet var editSetButton: NSButton!
var controller: PresetEditorViewController?
var observer: Any?
override var nibName: NSNib.Name? {
return NSNib.Name(rawValue: "SBPresetPrefsViewController")
return NSNib.Name(rawValue: "PresetPrefsViewController")
}
init() {
@@ -63,6 +64,7 @@ class PresetPrefsViewController: NSViewController, NSTableViewDataSource, NSTabl
func tableViewSelectionDidChange(_ notification: Notification) {
removeSetButton.isEnabled = tableView.selectedRow != -1
editSetButton.isEnabled = tableView.selectedRow != -1
}
// MARK: UI Actions
@@ -100,8 +102,8 @@ class PresetPrefsViewController: NSViewController, NSTableViewDataSource, NSTabl
}
}
@IBAction func toggleInfoWindow(_ sender: NSView) {
let rowIndex = tableView.row(for: sender)
@IBAction func editPreset(_ sender: NSView) {
let rowIndex = tableView.selectedRow
if let preset = presetManager.presets[rowIndex] as? MetadataPreset {
currentRow = rowIndex
+11 -7
View File
@@ -17,7 +17,8 @@
A90057BE1F99E2D800FA4ED1 /* TokenFieldCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A90057BD1F99E2D800FA4ED1 /* TokenFieldCell.swift */; };
A90057C01F99E35300FA4ED1 /* PopUpCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A90057BF1F99E35300FA4ED1 /* PopUpCellView.swift */; };
A900CE3E1F3ACF9700CCA08E /* MetadataResultMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = A900CE3D1F3ACF9700CCA08E /* MetadataResultMap.swift */; };
A90300C81DAE72C4008237D8 /* SBPresetPrefsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A90300CA1DAE72C4008237D8 /* SBPresetPrefsViewController.xib */; };
A902E0CA20504FD400445AC8 /* TokenDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A902E0C920504FD400445AC8 /* TokenDelegate.swift */; };
A90300C81DAE72C4008237D8 /* PresetPrefsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A90300CA1DAE72C4008237D8 /* PresetPrefsViewController.xib */; };
A9067A0C1F3CA4E6008011DC /* MetadataPrefsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9067A0B1F3CA4E6008011DC /* MetadataPrefsViewController.swift */; };
A906B5B11E434872007D12B1 /* Queue.sdef in Resources */ = {isa = PBXBuildFile; fileRef = A906B5B01E434872007D12B1 /* Queue.sdef */; };
A90B023B10F3290A000416F3 /* PrefsWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A90B023910F3290A000416F3 /* PrefsWindowController.xib */; };
@@ -196,7 +197,8 @@
A900CE3D1F3ACF9700CCA08E /* MetadataResultMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MetadataResultMap.swift; path = Classes/MetadataImporters/MetadataResultMap.swift; sourceTree = "<group>"; };
A90160112040213600B07AB3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/OutputPrefsViewController.xib; sourceTree = "<group>"; };
A9016012204021CB00B07AB3 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/OutputPrefsViewController.strings; sourceTree = "<group>"; };
A90300C91DAE72C4008237D8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/SBPresetPrefsViewController.xib; sourceTree = "<group>"; };
A902E0C920504FD400445AC8 /* TokenDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TokenDelegate.swift; path = Classes/TokenDelegate.swift; sourceTree = "<group>"; };
A90300C91DAE72C4008237D8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/PresetPrefsViewController.xib; sourceTree = "<group>"; };
A9067A0B1F3CA4E6008011DC /* MetadataPrefsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MetadataPrefsViewController.swift; path = Classes/MetadataPrefsViewController.swift; sourceTree = "<group>"; };
A906B5B01E434872007D12B1 /* Queue.sdef */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Queue.sdef; sourceTree = "<group>"; };
A90BC5E21F3A139700F9F3F3 /* MetadataResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MetadataResult.swift; path = Classes/MetadataImporters/MetadataResult.swift; sourceTree = "<group>"; };
@@ -288,7 +290,7 @@
A9B46AA312B79BB10040517A /* Subler.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = Subler.icns; path = images/Subler.icns; sourceTree = "<group>"; };
A9B4EE4E1643EBF3009AF6BC /* Subler.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Subler.entitlements; sourceTree = "<group>"; };
A9B514181EFC12310055A035 /* TheTVDB.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TheTVDB.swift; path = Classes/MetadataImporters/TheTVDB.swift; sourceTree = "<group>"; };
A9BA1ACF1DBF773600FD0B38 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/SBPresetPrefsViewController.strings; sourceTree = "<group>"; };
A9BA1ACF1DBF773600FD0B38 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/PresetPrefsViewController.strings; sourceTree = "<group>"; };
A9BA1AD01DBF773600FD0B38 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/MetadataPrefsViewController.strings; sourceTree = "<group>"; };
A9BA1AD21DBF773600FD0B38 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = Classes/PropertyView/it.lproj/ChapterView.strings; sourceTree = "<group>"; };
A9BA1AD31DBF773600FD0B38 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = Classes/PropertyView/it.lproj/EmptyView.strings; sourceTree = "<group>"; };
@@ -497,7 +499,8 @@
A9C31E5E2029A80F00CEF474 /* AdvancedPrefsViewController.swift */,
A9C31E622029A82200CEF474 /* AdvancedPrefsViewController.xib */,
A944E5911F498FC4002E43F6 /* PresetPrefsViewController.swift */,
A90300CA1DAE72C4008237D8 /* SBPresetPrefsViewController.xib */,
A90300CA1DAE72C4008237D8 /* PresetPrefsViewController.xib */,
A902E0C920504FD400445AC8 /* TokenDelegate.swift */,
A9067A0B1F3CA4E6008011DC /* MetadataPrefsViewController.swift */,
A924A5201D4B9E93008301A7 /* MetadataPrefsViewController.xib */,
A9F680A61FD06E0200018371 /* OutputPrefsViewController.swift */,
@@ -783,7 +786,7 @@
A93105391F9758EC00605146 /* FileImportController.xib in Resources */,
A9AB486517F0AEFD000AA72E /* EmptyView.xib in Resources */,
1DDD582D0DA1D0D100B32029 /* MainMenu.xib in Resources */,
A90300C81DAE72C4008237D8 /* SBPresetPrefsViewController.xib in Resources */,
A90300C81DAE72C4008237D8 /* PresetPrefsViewController.xib in Resources */,
A984DB740F52DD4B001A20B2 /* dsa_pub.pem in Resources */,
A9C5FA7419FA2FEC0051F3FF /* SBActivityWindow.xib in Resources */,
A9DA3BA31B918D6F00F1E40C /* ExceptionAlert.xib in Resources */,
@@ -862,6 +865,7 @@
A9ECA0532029948900D5F30C /* OffsetViewController.swift in Sources */,
A9395E351F8B9ACA004C402B /* MP42FileAdditions.swift in Sources */,
A9A8CEF91E43754400BC2AE1 /* SBQueueScriptCommand.m in Sources */,
A902E0CA20504FD400445AC8 /* TokenDelegate.swift in Sources */,
A9C09C9A1F9A0808007939EE /* EmptyViewController.swift in Sources */,
A9C09C981F99F971007939EE /* ExpandedTableView.swift in Sources */,
A997B0AA1F348AB000974C9C /* MetadataSearchController.swift in Sources */,
@@ -962,13 +966,13 @@
name = MultiSelectView.xib;
sourceTree = "<group>";
};
A90300CA1DAE72C4008237D8 /* SBPresetPrefsViewController.xib */ = {
A90300CA1DAE72C4008237D8 /* PresetPrefsViewController.xib */ = {
isa = PBXVariantGroup;
children = (
A90300C91DAE72C4008237D8 /* Base */,
A9BA1ACF1DBF773600FD0B38 /* it */,
);
name = SBPresetPrefsViewController.xib;
name = PresetPrefsViewController.xib;
path = Classes;
sourceTree = "<group>";
};