From de70a4d539b0158767c8b1e176b3da39c582e591 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 25 Dec 2017 10:48:49 -0800 Subject: [PATCH] =?UTF-8?q?Clean=20up.=20Drop=20the=20panic=20button=20mar?= =?UTF-8?q?k-everywhere-read=20UI=20bits,=20since=20they=E2=80=99re=20no?= =?UTF-8?q?=20longer=20used.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Evergreen.xcodeproj/project.pbxproj | 8 -- Evergreen/AppDelegate.swift | 43 +------ .../MainWindow/MainWindowController.swift | 6 - .../PanicButton/PanicButtonWindow.xib | 115 ------------------ .../PanicButtonWindowController.swift | 43 ------- 5 files changed, 1 insertion(+), 214 deletions(-) delete mode 100644 Evergreen/MainWindow/PanicButton/PanicButtonWindow.xib delete mode 100644 Evergreen/MainWindow/PanicButton/PanicButtonWindowController.swift diff --git a/Evergreen.xcodeproj/project.pbxproj b/Evergreen.xcodeproj/project.pbxproj index 907dc45b4..3b0a91839 100644 --- a/Evergreen.xcodeproj/project.pbxproj +++ b/Evergreen.xcodeproj/project.pbxproj @@ -85,8 +85,6 @@ 849C64681ED37A5D003D8FC0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 849C64671ED37A5D003D8FC0 /* Assets.xcassets */; }; 849C646B1ED37A5D003D8FC0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 849C64691ED37A5D003D8FC0 /* Main.storyboard */; }; 849C64761ED37A5D003D8FC0 /* EvergreenTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849C64751ED37A5D003D8FC0 /* EvergreenTests.swift */; }; - 84AFBB3C1FBE76D800BA41CF /* PanicButtonWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84AFBB3B1FBE76D800BA41CF /* PanicButtonWindowController.swift */; }; - 84AFBB3E1FBE770200BA41CF /* PanicButtonWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 84AFBB3D1FBE770200BA41CF /* PanicButtonWindow.xib */; }; 84B06FAE1ED37DBD00F0B54B /* RSCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84B06FA91ED37DAD00F0B54B /* RSCore.framework */; }; 84B06FAF1ED37DBD00F0B54B /* RSCore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 84B06FA91ED37DAD00F0B54B /* RSCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 84B06FB21ED37DBD00F0B54B /* RSDatabase.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84B06F9D1ED37DA000F0B54B /* RSDatabase.framework */; }; @@ -497,8 +495,6 @@ 849C64771ED37A5D003D8FC0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 84A6B6931FB8D43C006754AC /* DinosaursWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DinosaursWindow.xib; sourceTree = ""; }; 84A6B6951FB8DBD2006754AC /* DinosaursWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DinosaursWindowController.swift; sourceTree = ""; }; - 84AFBB3B1FBE76D800BA41CF /* PanicButtonWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PanicButtonWindowController.swift; sourceTree = ""; }; - 84AFBB3D1FBE770200BA41CF /* PanicButtonWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PanicButtonWindow.xib; sourceTree = ""; }; 84B06F961ED37DA000F0B54B /* RSDatabase.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RSDatabase.xcodeproj; path = Frameworks/RSDatabase/RSDatabase.xcodeproj; sourceTree = ""; }; 84B06FA21ED37DAC00F0B54B /* RSCore.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RSCore.xcodeproj; path = Frameworks/RSCore/RSCore.xcodeproj; sourceTree = ""; }; 84B06FB61ED37E8B00F0B54B /* RSWeb.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RSWeb.xcodeproj; path = Frameworks/RSWeb/RSWeb.xcodeproj; sourceTree = ""; }; @@ -923,8 +919,6 @@ 84AFBB3A1FBE76D800BA41CF /* PanicButton */ = { isa = PBXGroup; children = ( - 84AFBB3D1FBE770200BA41CF /* PanicButtonWindow.xib */, - 84AFBB3B1FBE76D800BA41CF /* PanicButtonWindowController.swift */, ); path = PanicButton; sourceTree = ""; @@ -1374,7 +1368,6 @@ 845479881FEB77C000AD8B59 /* TimelineKeyboardShortcuts.plist in Resources */, 849A979D1ED9EFEB007D329B /* template.html in Resources */, 849A97A91ED9F9AA007D329B /* AddFeedSheet.xib in Resources */, - 84AFBB3E1FBE770200BA41CF /* PanicButtonWindow.xib in Resources */, 842E45E71ED8C747000A8B52 /* DB5.plist in Resources */, 844B5B691FEA20DF00C7C76A /* SidebarKeyboardShortcuts.plist in Resources */, 849A97AC1ED9F9BC007D329B /* AddFolderSheet.xib in Resources */, @@ -1426,7 +1419,6 @@ 849A979F1ED9F130007D329B /* SidebarCell.swift in Sources */, 849A97651ED9EB96007D329B /* SidebarTreeControllerDelegate.swift in Sources */, 849A97671ED9EB96007D329B /* UnreadCountView.swift in Sources */, - 84AFBB3C1FBE76D800BA41CF /* PanicButtonWindowController.swift in Sources */, 8426118A1FCB67AA0086A189 /* FeedIconDownloader.swift in Sources */, 84E95D241FB1087500552D99 /* ArticlePasteboardWriter.swift in Sources */, 849A975B1ED9EB0D007D329B /* ArticleUtilities.swift in Sources */, diff --git a/Evergreen/AppDelegate.swift b/Evergreen/AppDelegate.swift index 3a9dbbeb1..c99727c12 100644 --- a/Evergreen/AppDelegate.swift +++ b/Evergreen/AppDelegate.swift @@ -46,8 +46,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, private var keyboardShortcutsWindowController: WebViewWindowController? private var inspectorWindowController: InspectorWindowController? private var logWindowController: LogWindowController? - private var panicButtonWindowController: PanicButtonWindowController? - + private let log = Log() private let themeLoader = VSThemeLoader() private let appNewsURLString = "https://ranchero.com/evergreen/feed.json" @@ -86,34 +85,6 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, addFolderWindowController!.runSheetOnWindow(window) } -// func markOlderArticlesAsRead(with window: NSWindow) { -// -// panicButtonWindowController = PanicButtonWindowController() -// panicButtonWindowController!.runSheetOnWindow(window) -// } - - func markEverywhereAsRead(with window: NSWindow) { - - let alert = NSAlert() - alert.messageText = NSLocalizedString("Mark All Articles as Read Everywhere?", comment: "Mark Everywhere alert messageText") - alert.informativeText = NSLocalizedString("This will mark every single article as read. All of them. The unread count will be zero.\n\nNote: this operation cannot be undone.", comment: "Mark Everywhere informativeText.") - - alert.addButton(withTitle: NSLocalizedString("Mark All Articles as Read", comment: "Mark Everywhere alert button.")) - alert.addButton(withTitle: NSLocalizedString("Don’t Mark as Read", comment: "Mark Everywhere alert button.")) - - alert.beginSheetModal(for: window) { (returnCode) in - - if returnCode == .alertFirstButtonReturn { - self.markEverywhereAsRead() - } - } - } - - func markEverywhereAsRead() { - - AccountManager.shared.accounts.forEach { $0.markEverywhereAsRead() } - } - // MARK: - NSApplicationDelegate func applicationDidFinishLaunching(_ note: Notification) { @@ -431,18 +402,6 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, Browser.open("https://ranchero.com/evergreen/help/1.0/", inBackground: false) } -// @IBAction func markOlderArticlesAsRead(_ sender: Any?) { -// -// createAndShowMainWindow() -// markOlderArticlesAsRead(with: mainWindowController!.window!) -// } - - @IBAction func markEverywhereAsRead(_ sender: Any?) { - - createAndShowMainWindow() - markEverywhereAsRead(with: mainWindowController!.window!) - } - @IBAction func debugDropConditionalGetInfo(_ sender: Any?) { #if DEBUG AccountManager.shared.accounts.forEach{ $0.debugDropConditionalGetInfo() } diff --git a/Evergreen/MainWindow/MainWindowController.swift b/Evergreen/MainWindow/MainWindowController.swift index def09d421..5c7ed4551 100644 --- a/Evergreen/MainWindow/MainWindowController.swift +++ b/Evergreen/MainWindow/MainWindowController.swift @@ -240,12 +240,6 @@ class MainWindowController : NSWindowController, NSUserInterfaceValidations { @IBAction func markOlderArticlesAsRead(_ sender: Any?) { timelineViewController?.markOlderArticlesAsRead(sender) -// appDelegate.markOlderArticlesAsRead(with: window!) - } - - @IBAction func markEverywhereAsRead(_ sender: Any?) { - - appDelegate.markEverywhereAsRead(with: window!) } @IBAction func navigateToTimeline(_ sender: Any?) { diff --git a/Evergreen/MainWindow/PanicButton/PanicButtonWindow.xib b/Evergreen/MainWindow/PanicButton/PanicButtonWindow.xib deleted file mode 100644 index dafa7fed1..000000000 --- a/Evergreen/MainWindow/PanicButton/PanicButtonWindow.xib +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Evergreen/MainWindow/PanicButton/PanicButtonWindowController.swift b/Evergreen/MainWindow/PanicButton/PanicButtonWindowController.swift deleted file mode 100644 index 59bb0f135..000000000 --- a/Evergreen/MainWindow/PanicButton/PanicButtonWindowController.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// PanicButtonWindowController.swift -// Evergreen -// -// Created by Brent Simmons on 11/16/17. -// Copyright © 2017 Ranchero Software. All rights reserved. -// - -import Cocoa - -final class PanicButtonWindowController: NSWindowController { - - var hostWindow: NSWindow? - - convenience init() { - - self.init(windowNibName: NSNib.Name(rawValue: "PanicButtonWindow")) - } - - func runSheetOnWindow(_ w: NSWindow) { - - hostWindow = w - hostWindow!.beginSheet(window!) { (returnCode: NSApplication.ModalResponse) -> Void in - } - } - - private func closeSheet(_ response: NSApplication.ModalResponse) { - - hostWindow!.endSheet(window!, returnCode: response) - } - - // MARK: - Actions - - @IBAction func cancel(_ sender: AnyObject) { - - closeSheet(.cancel) - } - - @IBAction func performPanic(_ sender: AnyObject) { - - closeSheet(.OK) - } -}