mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Get rid of TimelineContextualMenuDelegate.
This commit is contained in:
@@ -485,7 +485,6 @@
|
||||
</constraints>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="contextualMenuDelegate" destination="iD1-KK-gFc" id="b0j-aW-e4B"/>
|
||||
<outlet property="tableView" destination="DRs-j8-R9a" id="2AG-SP-7n2"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
@@ -503,7 +502,7 @@
|
||||
</menuItem>
|
||||
</items>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="iD1-KK-gFc" id="q4j-wE-tnf"/>
|
||||
<outlet property="delegate" destination="36G-bQ-b96" id="mno-4b-OJB"/>
|
||||
</connections>
|
||||
</menu>
|
||||
<customObject id="ZOV-xh-WJE" customClass="TimelineKeyboardDelegate" customModule="NetNewsWire" customModuleProvider="target">
|
||||
@@ -511,11 +510,6 @@
|
||||
<outlet property="timelineViewController" destination="36G-bQ-b96" id="rED-2Z-kh6"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="iD1-KK-gFc" customClass="TimelineContextualMenuDelegate" customModule="NetNewsWire" customModuleProvider="target">
|
||||
<connections>
|
||||
<outlet property="timelineViewController" destination="36G-bQ-b96" id="oE9-uV-TNi"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="62" y="394"/>
|
||||
</scene>
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
//
|
||||
// TimelineContextualMenuDelegate.swift
|
||||
// NetNewsWire
|
||||
//
|
||||
// Created by Brent Simmons on 2/8/18.
|
||||
// Copyright © 2018 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import AppKit
|
||||
import RSCore
|
||||
|
||||
@objc final class TimelineContextualMenuDelegate: NSObject, NSMenuDelegate {
|
||||
|
||||
@IBOutlet weak var timelineViewController: TimelineViewController?
|
||||
|
||||
public func menuNeedsUpdate(_ menu: NSMenu) {
|
||||
|
||||
guard let timelineViewController = timelineViewController else {
|
||||
return
|
||||
}
|
||||
|
||||
menu.removeAllItems()
|
||||
|
||||
guard let contextualMenu = timelineViewController.contextualMenuForClickedRows() else {
|
||||
return
|
||||
}
|
||||
|
||||
menu.takeItems(from: contextualMenu)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ import Account
|
||||
class TimelineViewController: NSViewController, UndoableCommandRunner {
|
||||
|
||||
@IBOutlet var tableView: TimelineTableView!
|
||||
@IBOutlet var contextualMenuDelegate: TimelineContextualMenuDelegate?
|
||||
|
||||
var sharingServiceDelegate: NSSharingServiceDelegate?
|
||||
|
||||
@@ -533,7 +532,20 @@ class TimelineViewController: NSViewController, UndoableCommandRunner {
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: NSUserInterfaceValidations
|
||||
// MARK: - NSMenuDelegate
|
||||
|
||||
extension TimelineViewController: NSMenuDelegate {
|
||||
|
||||
public func menuNeedsUpdate(_ menu: NSMenu) {
|
||||
menu.removeAllItems()
|
||||
guard let contextualMenu = contextualMenuForClickedRows() else {
|
||||
return
|
||||
}
|
||||
menu.takeItems(from: contextualMenu)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - NSUserInterfaceValidations
|
||||
|
||||
extension TimelineViewController: NSUserInterfaceValidations {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user