Clean up. Drop the panic button mark-everywhere-read UI bits, since they’re no longer used.

This commit is contained in:
Brent Simmons 2017-12-25 10:48:49 -08:00
parent b00244921b
commit de70a4d539
5 changed files with 1 additions and 214 deletions

View File

@ -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 = "<group>"; };
84A6B6931FB8D43C006754AC /* DinosaursWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DinosaursWindow.xib; sourceTree = "<group>"; };
84A6B6951FB8DBD2006754AC /* DinosaursWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DinosaursWindowController.swift; sourceTree = "<group>"; };
84AFBB3B1FBE76D800BA41CF /* PanicButtonWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PanicButtonWindowController.swift; sourceTree = "<group>"; };
84AFBB3D1FBE770200BA41CF /* PanicButtonWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PanicButtonWindow.xib; sourceTree = "<group>"; };
84B06F961ED37DA000F0B54B /* RSDatabase.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RSDatabase.xcodeproj; path = Frameworks/RSDatabase/RSDatabase.xcodeproj; sourceTree = "<group>"; };
84B06FA21ED37DAC00F0B54B /* RSCore.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RSCore.xcodeproj; path = Frameworks/RSCore/RSCore.xcodeproj; sourceTree = "<group>"; };
84B06FB61ED37E8B00F0B54B /* RSWeb.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RSWeb.xcodeproj; path = Frameworks/RSWeb/RSWeb.xcodeproj; sourceTree = "<group>"; };
@ -923,8 +919,6 @@
84AFBB3A1FBE76D800BA41CF /* PanicButton */ = {
isa = PBXGroup;
children = (
84AFBB3D1FBE770200BA41CF /* PanicButtonWindow.xib */,
84AFBB3B1FBE76D800BA41CF /* PanicButtonWindowController.swift */,
);
path = PanicButton;
sourceTree = "<group>";
@ -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 */,

View File

@ -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("Dont 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() }

View File

@ -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?) {

View File

@ -1,115 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13526" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13526"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="PanicButtonWindowController" customModule="Evergreen" customModuleProvider="target">
<connections>
<outlet property="window" destination="QvC-M9-y7g" id="Wap-SV-du3"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window title="Panic Button" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="default" id="QvC-M9-y7g">
<windowStyleMask key="styleMask" titled="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="196" y="240" width="312" height="154"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="877"/>
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
<rect key="frame" x="0.0" y="0.0" width="312" height="159"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="Ode-W8-yv9">
<rect key="frame" x="18" y="120" width="276" height="19"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Mark as read all articles older than:" id="SJM-bW-FQa">
<font key="font" metaFont="systemBold" size="16"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="K4S-qc-mF1">
<rect key="frame" x="18" y="88" width="277" height="26"/>
<popUpButtonCell key="cell" type="push" title="Today" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="vQJ-dr-QTR" id="t0a-rZ-E6n">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
<menu key="menu" id="hYC-dE-D9W">
<items>
<menuItem title="Today" id="vQJ-dr-QTR"/>
<menuItem title="Yesterday" id="CzD-fs-1pk"/>
<menuItem title="Two weeks" id="50m-a0-Pq1"/>
<menuItem title="One month" id="cfI-Uu-C7Q"/>
<menuItem title="Two months" id="C0t-0J-lGc"/>
<menuItem title="Six months" id="8hi-Xr-7TE"/>
</items>
</menu>
</popUpButtonCell>
</popUpButton>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" textCompletion="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dod-yG-835">
<rect key="frame" x="18" y="49" width="276" height="34"/>
<textFieldCell key="cell" allowsUndo="NO" sendsActionOnEndEditing="YES" title="This will mark older articles everywhere as read, not just selected articles." id="aVk-QT-g09">
<font key="font" metaFont="system"/>
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ePr-Wl-khT">
<rect key="frame" x="134" y="13" width="82" height="32"/>
<buttonCell key="cell" type="push" title="Cancel" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="lXW-en-9Cq">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<string key="keyEquivalent" base64-UTF8="YES">
Gw
</string>
</buttonCell>
<connections>
<action selector="cancel:" target="-2" id="qsE-qW-4YY"/>
</connections>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="wcO-KR-YAV">
<rect key="frame" x="216" y="13" width="82" height="32"/>
<buttonCell key="cell" type="push" title="OK" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="F8H-bo-vL9">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<string key="keyEquivalent" base64-UTF8="YES">
DQ
</string>
</buttonCell>
<connections>
<action selector="performPanic:" target="-2" id="lKT-ae-Grv"/>
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="K53-ff-yBH">
<rect key="frame" x="6" y="25" width="138" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="This doesnt work yet." id="6Kn-qd-351">
<font key="font" metaFont="system"/>
<color key="textColor" name="systemRedColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
<constraints>
<constraint firstItem="wcO-KR-YAV" firstAttribute="bottom" secondItem="ePr-Wl-khT" secondAttribute="bottom" id="799-aJ-02m"/>
<constraint firstItem="dod-yG-835" firstAttribute="leading" secondItem="EiT-Mj-1SZ" secondAttribute="leading" constant="20" symbolic="YES" id="BUx-cq-8jk"/>
<constraint firstItem="K4S-qc-mF1" firstAttribute="leading" secondItem="EiT-Mj-1SZ" secondAttribute="leading" constant="20" symbolic="YES" id="Quv-Zo-RmQ"/>
<constraint firstAttribute="bottom" secondItem="wcO-KR-YAV" secondAttribute="bottom" constant="20" symbolic="YES" id="Rdb-Q2-xMP"/>
<constraint firstAttribute="trailing" secondItem="wcO-KR-YAV" secondAttribute="trailing" constant="20" symbolic="YES" id="WiX-Z0-HbZ"/>
<constraint firstItem="ePr-Wl-khT" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="EiT-Mj-1SZ" secondAttribute="leading" constant="128" id="cIZ-AF-Wbi"/>
<constraint firstItem="dod-yG-835" firstAttribute="top" secondItem="K4S-qc-mF1" secondAttribute="bottom" constant="8" symbolic="YES" id="dQc-nk-1ko"/>
<constraint firstItem="wcO-KR-YAV" firstAttribute="top" secondItem="dod-yG-835" secondAttribute="bottom" constant="8" symbolic="YES" id="f7E-hd-FvR"/>
<constraint firstAttribute="trailing" secondItem="Ode-W8-yv9" secondAttribute="trailing" constant="20" symbolic="YES" id="fYe-e2-q2M"/>
<constraint firstItem="Ode-W8-yv9" firstAttribute="leading" secondItem="EiT-Mj-1SZ" secondAttribute="leading" constant="20" symbolic="YES" id="fxX-Xh-pRL"/>
<constraint firstItem="Ode-W8-yv9" firstAttribute="top" secondItem="EiT-Mj-1SZ" secondAttribute="top" constant="20" symbolic="YES" id="k8j-dV-9vN"/>
<constraint firstItem="wcO-KR-YAV" firstAttribute="leading" secondItem="ePr-Wl-khT" secondAttribute="trailing" constant="12" symbolic="YES" id="lkE-WG-4n9"/>
<constraint firstItem="wcO-KR-YAV" firstAttribute="width" secondItem="ePr-Wl-khT" secondAttribute="width" id="rjw-ZT-cDy"/>
<constraint firstAttribute="trailing" secondItem="dod-yG-835" secondAttribute="trailing" constant="20" symbolic="YES" id="vqu-wC-Wdx"/>
<constraint firstItem="K4S-qc-mF1" firstAttribute="top" secondItem="Ode-W8-yv9" secondAttribute="bottom" constant="8" symbolic="YES" id="w5M-sz-xBb"/>
<constraint firstAttribute="trailing" secondItem="K4S-qc-mF1" secondAttribute="trailing" constant="20" symbolic="YES" id="wjo-GM-Gn9"/>
</constraints>
</view>
<point key="canvasLocation" x="248" y="82"/>
</window>
</objects>
</document>

View File

@ -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)
}
}