diff --git a/Samra/Backend/DetailItem.swift b/Samra/Backend/DetailItem.swift index e2aa099..7d28d13 100644 --- a/Samra/Backend/DetailItem.swift +++ b/Samra/Backend/DetailItem.swift @@ -49,10 +49,10 @@ struct DetailItemSection: Hashable { DetailItem(primaryText: "UNIX Timestamp", secondaryText: assetStorage.storageTimestamp()) ]) + let coreUIVersionText: CustomStringConvertible = assetStorage.responds(to: #selector(CUICommonAssetStorage.coreuiVersion)) ? assetStorage.coreuiVersion() : "Unknown" let coreUISection = DetailItemSection(sectionHeader: "Other", items: [ - DetailItem(primaryText: "CoreUI Version", secondaryText: assetStorage.coreuiVersion()), + DetailItem(primaryText: "CoreUI Version", secondaryText: coreUIVersionText), DetailItem(primaryText: "Schema Version", secondaryText: assetStorage.schemaVersion()), - DetailItem(primaryText: "UUID", secondaryText: assetStorage.uuid()) ]) return [toolSection, argumentsSection, dateSection, coreUISection] diff --git a/Samra/Backend/Extensions.swift b/Samra/Backend/Extensions.swift index f50675e..1fc6769 100644 --- a/Samra/Backend/Extensions.swift +++ b/Samra/Backend/Extensions.swift @@ -62,18 +62,6 @@ extension CGImage { } } -extension NSView { - func setHiddenWithAnimations(hidden: Bool) { - NSAnimationContext.runAnimationGroup { animationContext in - animationContext.duration = hidden ? 0.1 : 0.1 - animator().alphaValue = 0 - } completionHandler: { - self.isHidden = hidden - self.alphaValue = 1 - } - } -} - extension NSAlert { convenience init(title: String, message: String? = nil) { self.init() diff --git a/Samra/UI/Diff/AssetCatalogDiffSelectionViewController.swift b/Samra/UI/Diff/AssetCatalogDiffSelectionViewController.swift index 1ecdd14..221a85e 100644 --- a/Samra/UI/Diff/AssetCatalogDiffSelectionViewController.swift +++ b/Samra/UI/Diff/AssetCatalogDiffSelectionViewController.swift @@ -157,8 +157,6 @@ class AssetCatalogDiffSelectionViewController: NSViewController { @objc func leftOrRightButtonClicked(sender: NSButton) { - // tag 1 = left - // tag 2 = right URLHandler.shared.presentArchiveChooserPanel(senderView: nil) { [unowned self] url in validateAndProcessURL(url, forSide: DiffSide(rawValue: sender.tag)!) } @@ -177,13 +175,13 @@ class AssetCatalogDiffSelectionViewController: NSViewController { case .left: leftCatalogInput = try AssetCatalogInput(fileURL: urlToChoose) leftCatalogPathLabel.stringValue = urlToChoose.path - setImageViewForPreview(url: url, side: .left) + leftCatalogPreview.imageView.image = NSWorkspace.shared.icon(forFile: url.path) case .right: rightCatalogInput = try AssetCatalogInput(fileURL: urlToChoose) rightCatalogPathLabel.stringValue = urlToChoose.path - setImageViewForPreview(url: url, side: .right) + rightCatalogPreview.imageView.image = NSWorkspace.shared.icon(forFile: url.path) } - + diffCatalogsButton.isEnabled = rightCatalogInput != nil && leftCatalogInput != nil } catch { NSAlert(title: "Unable to open Asset Catalog file \(urlToChoose.path)")