From b6e7c16c13999669e76067e696ff20a8aea99cf8 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sun, 25 Jun 2023 14:43:55 -0700 Subject: [PATCH] Remove add-Reddit-feed sheet and window controller. --- Mac/Base.lproj/AddRedditFeedSheet.xib | 248 ------------------ .../AddRedditFeedWindowController.swift | 212 --------------- NetNewsWire.xcodeproj/project.pbxproj | 20 -- 3 files changed, 480 deletions(-) delete mode 100644 Mac/Base.lproj/AddRedditFeedSheet.xib delete mode 100644 Mac/MainWindow/AddRedditFeedWindowController.swift diff --git a/Mac/Base.lproj/AddRedditFeedSheet.xib b/Mac/Base.lproj/AddRedditFeedSheet.xib deleted file mode 100644 index a481f38af..000000000 --- a/Mac/Base.lproj/AddRedditFeedSheet.xib +++ /dev/null @@ -1,248 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mac/MainWindow/AddRedditFeedWindowController.swift b/Mac/MainWindow/AddRedditFeedWindowController.swift deleted file mode 100644 index 55056ad34..000000000 --- a/Mac/MainWindow/AddRedditFeedWindowController.swift +++ /dev/null @@ -1,212 +0,0 @@ -// -// AddRedditFeedWindowController.swift -// NetNewsWire -// -// Created by Maurice Parker on 5/10/20. -// Copyright © 2020 Ranchero Software. All rights reserved. -// - -import AppKit -import RSCore -import RSTree -import Articles -import Account - -class AddRedditFeedWindowController : NSWindowController, AddFeedWindowController { - - @IBOutlet weak var typePopupButton: NSPopUpButton! - @IBOutlet weak var typeDescriptionLabel: NSTextField! - - @IBOutlet weak var accountLabel: NSTextField! - @IBOutlet weak var accountPopupButton: NSPopUpButton! - @IBOutlet weak var subredditTextField: NSTextField! - - @IBOutlet weak var typeToSortLayoutConstraint: NSLayoutConstraint! - - @IBOutlet weak var sortPopupButton: NSPopUpButton! - - @IBOutlet var nameTextField: NSTextField! - @IBOutlet var addButton: NSButton! - @IBOutlet var folderPopupButton: NSPopUpButton! - - private weak var delegate: AddFeedWindowControllerDelegate? - private var folderTreeController: TreeController! - - private var userSelectedSort: RedditSort { - switch sortPopupButton.selectedItem?.tag ?? 0 { - case 0: - return .best - case 1: - return .hot - case 2: - return .new - case 3: - return .top - default: - return .rising - } - } - - private var userEnteredSubreddit: String? { - var s = subredditTextField.stringValue - s = s.collapsingWhitespace - if s.isEmpty { - return nil - } - return s - } - - private var userEnteredTitle: String? { - var s = nameTextField.stringValue - s = s.collapsingWhitespace - if s.isEmpty { - return nil - } - return s - } - - var hostWindow: NSWindow! - - convenience init(folderTreeController: TreeController, delegate: AddFeedWindowControllerDelegate?) { - self.init(windowNibName: NSNib.Name("AddRedditFeedSheet")) - self.folderTreeController = folderTreeController - self.delegate = delegate - } - - func runSheetOnWindow(_ hostWindow: NSWindow) { - hostWindow.beginSheet(window!) { (returnCode: NSApplication.ModalResponse) -> Void in - } - } - - override func windowDidLoad() { - - let accountMenu = NSMenu() - for feedProvider in ExtensionPointManager.shared.activeFeedProviders { - if let redditFeedProvider = feedProvider as? RedditFeedProvider { - let accountMenuItem = NSMenuItem() - accountMenuItem.title = redditFeedProvider.title - accountMenu.addItem(accountMenuItem) - } - } - accountPopupButton.menu = accountMenu - - folderPopupButton.menu = FolderTreeMenu.createFolderPopupMenu(with: folderTreeController.rootNode, restrictToSpecialAccounts: true) - - if let container = AddWebFeedDefaultContainer.defaultContainer { - if let folder = container as? Folder, let account = folder.account { - FolderTreeMenu.select(account: account, folder: folder, in: folderPopupButton) - } else { - if let account = container as? Account { - FolderTreeMenu.select(account: account, folder: nil, in: folderPopupButton) - } - } - } - - updateUI() - } - - // MARK: Actions - - @IBAction func selectedType(_ sender: Any) { - subredditTextField.stringValue = "" - updateUI() - } - - @IBAction func cancel(_ sender: Any?) { - cancelSheet() - } - - @IBAction func addFeed(_ sender: Any?) { - guard let type = RedditFeedType(rawValue: typePopupButton.selectedItem?.tag ?? 0), - let atUsername = accountPopupButton.selectedItem?.title else { return } - - let username = String(atUsername[atUsername.index(atUsername.startIndex, offsetBy: 2).. Void)? = nil) { - let constant: CGFloat = collapsed ? 8 : 39 - - NSAnimationContext.beginGrouping() - NSAnimationContext.current.duration = 0.2 - NSAnimationContext.current.completionHandler = completion - typeToSortLayoutConstraint.animator().constant = constant - NSAnimationContext.endGrouping() - } - - func cancelSheet() { - delegate?.addFeedWindowControllerUserDidCancel(self) - } - - func selectedContainer() -> Container? { - return folderPopupButton.selectedItem?.representedObject as? Container - } -} diff --git a/NetNewsWire.xcodeproj/project.pbxproj b/NetNewsWire.xcodeproj/project.pbxproj index d95a5a3d4..069f94a17 100644 --- a/NetNewsWire.xcodeproj/project.pbxproj +++ b/NetNewsWire.xcodeproj/project.pbxproj @@ -163,10 +163,6 @@ 513277662590FC780064F1E7 /* Secrets in Embed Frameworks */ = {isa = PBXBuildFile; productRef = 51C4CFF524D37DD500AF9874 /* Secrets */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 5132778C2590FF1E0064F1E7 /* RSCore in Frameworks */ = {isa = PBXBuildFile; productRef = 5132778B2590FF1E0064F1E7 /* RSCore */; }; 5132779F2591034D0064F1E7 /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 5132779E2591034D0064F1E7 /* icon.icns */; }; - 51333D1624685D2E00EB5C91 /* AddRedditFeedWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51333D1524685D2E00EB5C91 /* AddRedditFeedWindowController.swift */; }; - 51333D1724685D2E00EB5C91 /* AddRedditFeedWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51333D1524685D2E00EB5C91 /* AddRedditFeedWindowController.swift */; }; - 51333D3B2468615D00EB5C91 /* AddRedditFeedSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = 51333D392468615D00EB5C91 /* AddRedditFeedSheet.xib */; }; - 51333D3C2468615D00EB5C91 /* AddRedditFeedSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = 51333D392468615D00EB5C91 /* AddRedditFeedSheet.xib */; }; 5137C2E426F3F52D009EFEDB /* Sepia.nnwtheme in Resources */ = {isa = PBXBuildFile; fileRef = 5137C2E326F3F52D009EFEDB /* Sepia.nnwtheme */; }; 5137C2E526F3F52D009EFEDB /* Sepia.nnwtheme in Resources */ = {isa = PBXBuildFile; fileRef = 5137C2E326F3F52D009EFEDB /* Sepia.nnwtheme */; }; 5137C2E626F3F52D009EFEDB /* Sepia.nnwtheme in Resources */ = {isa = PBXBuildFile; fileRef = 5137C2E326F3F52D009EFEDB /* Sepia.nnwtheme */; }; @@ -1202,8 +1198,6 @@ 51314706235C41FC00387FDC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.intentdefinition; name = Base; path = Base.lproj/Intents.intentdefinition; sourceTree = ""; }; 51314714235C420900387FDC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Intents.strings; sourceTree = ""; }; 5132779E2591034D0064F1E7 /* icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = icon.icns; sourceTree = ""; }; - 51333D1524685D2E00EB5C91 /* AddRedditFeedWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddRedditFeedWindowController.swift; sourceTree = ""; }; - 51333D3A2468615D00EB5C91 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Mac/Base.lproj/AddRedditFeedSheet.xib; sourceTree = SOURCE_ROOT; }; 5137C2E326F3F52D009EFEDB /* Sepia.nnwtheme */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = Sepia.nnwtheme; sourceTree = ""; }; 5137C2E926F63AE6009EFEDB /* ArticleThemeImporter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticleThemeImporter.swift; sourceTree = ""; }; 51386A8D25673276005F3762 /* AccountCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountCell.swift; sourceTree = ""; }; @@ -2367,8 +2361,6 @@ children = ( 849A97511ED9EAC0007D329B /* AddFeedController.swift */, 51A052CD244FB9D6006C2024 /* AddFeedWIndowController.swift */, - 51333D392468615D00EB5C91 /* AddRedditFeedSheet.xib */, - 51333D1524685D2E00EB5C91 /* AddRedditFeedWindowController.swift */, 848363002262A3BC00DA1D35 /* AddWebFeedSheet.xib */, 849A97521ED9EAC0007D329B /* AddWebFeedWindowController.swift */, 51EC114B2149FE3300B296E3 /* FolderTreeMenu.swift */, @@ -3376,7 +3368,6 @@ 51D0214726ED617100FF2E0F /* core.css in Resources */, 5103A9F5242258C600410853 /* AccountsAddCloudKit.xib in Resources */, 65ED405E235DEF6C0081F399 /* DefaultFeeds.opml in Resources */, - 51333D3C2468615D00EB5C91 /* AddRedditFeedSheet.xib in Resources */, 51C03082257D815A00609262 /* UnifiedWindow.storyboard in Resources */, 65ED405F235DEF6C0081F399 /* Preferences.storyboard in Resources */, 65ED4061235DEF6C0081F399 /* Assets.xcassets in Resources */, @@ -3497,7 +3488,6 @@ 3B826DCB2385C84800FC1ADB /* AccountsFeedWrangler.xib in Resources */, 55E15BCB229D65A900D6602A /* AccountsReaderAPI.xib in Resources */, 49F40DF82335B71000552BF4 /* newsfoot.js in Resources */, - 51333D3B2468615D00EB5C91 /* AddRedditFeedSheet.xib in Resources */, BDCB516724282C8A00102A80 /* AccountsNewsBlur.xib in Resources */, 5103A9982421643300410853 /* blank.html in Resources */, 515A516E243E7F950089E588 /* ExtensionPointDetail.xib in Resources */, @@ -3887,7 +3877,6 @@ 65ED3FD4235DEF6C0081F399 /* Article+Scriptability.swift in Sources */, 515A5172243E802B0089E588 /* ExtensionPointDetailViewController.swift in Sources */, 65ED3FD5235DEF6C0081F399 /* SmartFeed.swift in Sources */, - 51333D1724685D2E00EB5C91 /* AddRedditFeedWindowController.swift in Sources */, 65ED3FD6235DEF6C0081F399 /* MarkStatusCommand.swift in Sources */, 5183CFB0254C78C8006B83A5 /* EnableExtensionPointView.swift in Sources */, 65ED3FD7235DEF6C0081F399 /* NSApplication+Scriptability.swift in Sources */, @@ -4370,7 +4359,6 @@ 178A9F9D2549449F00AB7E9D /* AddAccountsView.swift in Sources */, 51C4CFF024D37D1F00AF9874 /* Secrets.swift in Sources */, 849A976D1ED9EBC8007D329B /* TimelineTableView.swift in Sources */, - 51333D1624685D2E00EB5C91 /* AddRedditFeedWindowController.swift in Sources */, 84D52E951FE588BB00D14F5B /* DetailStatusBarView.swift in Sources */, D5E4CC64202C1AC1009B4FFC /* MainWindowController+Scriptability.swift in Sources */, 51A052CE244FB9D7006C2024 /* AddFeedWIndowController.swift in Sources */, @@ -4511,14 +4499,6 @@ name = Intents.intentdefinition; sourceTree = ""; }; - 51333D392468615D00EB5C91 /* AddRedditFeedSheet.xib */ = { - isa = PBXVariantGroup; - children = ( - 51333D3A2468615D00EB5C91 /* Base */, - ); - name = AddRedditFeedSheet.xib; - sourceTree = ""; - }; 513C5CEA232571C2003D4054 /* MainInterface.storyboard */ = { isa = PBXVariantGroup; children = (