From 9aff95af29b0f5a692a56403aba7892c71277947 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sat, 13 Apr 2019 14:49:12 -0700 Subject: [PATCH] Move IndeterminateProgressWindow to RSCore. --- NetNewsWire.xcodeproj/project.pbxproj | 29 -------- .../IndeterminateProgressWindow.xib | 59 --------------- ...ndeterminateProgressWindowController.swift | 71 ------------------- submodules/RSCore | 2 +- 4 files changed, 1 insertion(+), 160 deletions(-) delete mode 100644 NetNewsWire/Base.lproj/IndeterminateProgressWindow.xib delete mode 100644 NetNewsWire/ProgressWindow/IndeterminateProgressWindowController.swift diff --git a/NetNewsWire.xcodeproj/project.pbxproj b/NetNewsWire.xcodeproj/project.pbxproj index 0728af490..46a54dab5 100644 --- a/NetNewsWire.xcodeproj/project.pbxproj +++ b/NetNewsWire.xcodeproj/project.pbxproj @@ -106,7 +106,6 @@ 840F7C6321BDA4B40057E851 /* AddFolderWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849A97421ED9EAA9007D329B /* AddFolderWindowController.swift */; }; 840F7C6421BDA4B40057E851 /* MainWIndowKeyboardHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 844B5B661FEA18E300C7C76A /* MainWIndowKeyboardHandler.swift */; }; 840F7C6521BDA4B40057E851 /* PasteboardFeed.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848D578D21543519005FFAD5 /* PasteboardFeed.swift */; }; - 840F7C6621BDA4B40057E851 /* IndeterminateProgressWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849A97911ED9EF65007D329B /* IndeterminateProgressWindowController.swift */; }; 840F7C6721BDA4B40057E851 /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849A977E1ED9EC42007D329B /* DetailViewController.swift */; }; 840F7C6821BDA4B40057E851 /* HTMLMetadataDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8426119D1FCB6ED40086A189 /* HTMLMetadataDownloader.swift */; }; 840F7C6921BDA4B40057E851 /* TimelineViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849A976B1ED9EBC8007D329B /* TimelineViewController.swift */; }; @@ -148,7 +147,6 @@ 840F7C9421BDA4B40057E851 /* ArticlesDatabase.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 841D4D682106B3E100DD04E6 /* ArticlesDatabase.framework */; }; 840F7C9521BDA4B40057E851 /* Articles.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 841D4D5B2106B3D600DD04E6 /* Articles.framework */; }; 840F7C9721BDA4B40057E851 /* KeyboardShortcuts.html in Resources */ = {isa = PBXBuildFile; fileRef = 84EB38101FBA8B9F000D2111 /* KeyboardShortcuts.html */; }; - 840F7C9821BDA4B40057E851 /* IndeterminateProgressWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 849A97931ED9EF7A007D329B /* IndeterminateProgressWindow.xib */; }; 840F7C9921BDA4B40057E851 /* GlobalKeyboardShortcuts.plist in Resources */ = {isa = PBXBuildFile; fileRef = 844B5B641FEA11F200C7C76A /* GlobalKeyboardShortcuts.plist */; }; 840F7C9B21BDA4B40057E851 /* TimelineKeyboardShortcuts.plist in Resources */ = {isa = PBXBuildFile; fileRef = 845479871FEB77C000AD8B59 /* TimelineKeyboardShortcuts.plist */; }; 840F7C9C21BDA4B40057E851 /* template.html in Resources */ = {isa = PBXBuildFile; fileRef = 849A979B1ED9EFEB007D329B /* template.html */; }; @@ -251,8 +249,6 @@ 849A97851ED9ECCD007D329B /* PreferencesWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849A97841ED9ECCD007D329B /* PreferencesWindowController.swift */; }; 849A97891ED9ECEF007D329B /* ArticleStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849A97871ED9ECEF007D329B /* ArticleStyle.swift */; }; 849A978A1ED9ECEF007D329B /* ArticleStylesManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849A97881ED9ECEF007D329B /* ArticleStylesManager.swift */; }; - 849A97921ED9EF65007D329B /* IndeterminateProgressWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849A97911ED9EF65007D329B /* IndeterminateProgressWindowController.swift */; }; - 849A97951ED9EF7A007D329B /* IndeterminateProgressWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 849A97931ED9EF7A007D329B /* IndeterminateProgressWindow.xib */; }; 849A97981ED9EFAA007D329B /* Node-Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849A97971ED9EFAA007D329B /* Node-Extensions.swift */; }; 849A979C1ED9EFEB007D329B /* styleSheet.css in Resources */ = {isa = PBXBuildFile; fileRef = 849A979A1ED9EFEB007D329B /* styleSheet.css */; }; 849A979D1ED9EFEB007D329B /* template.html in Resources */ = {isa = PBXBuildFile; fileRef = 849A979B1ED9EFEB007D329B /* template.html */; }; @@ -821,8 +817,6 @@ 849A97871ED9ECEF007D329B /* ArticleStyle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ArticleStyle.swift; sourceTree = ""; }; 849A97881ED9ECEF007D329B /* ArticleStylesManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ArticleStylesManager.swift; sourceTree = ""; }; 849A978C1ED9EE4D007D329B /* FeedListWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeedListWindowController.swift; sourceTree = ""; }; - 849A97911ED9EF65007D329B /* IndeterminateProgressWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IndeterminateProgressWindowController.swift; sourceTree = ""; }; - 849A97941ED9EF7A007D329B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = NetNewsWire/Base.lproj/IndeterminateProgressWindow.xib; sourceTree = SOURCE_ROOT; }; 849A97971ED9EFAA007D329B /* Node-Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Node-Extensions.swift"; sourceTree = ""; }; 849A979A1ED9EFEB007D329B /* styleSheet.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; name = styleSheet.css; path = NetNewsWire/MainWindow/Detail/styleSheet.css; sourceTree = SOURCE_ROOT; }; 849A979B1ED9EFEB007D329B /* template.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = template.html; path = NetNewsWire/MainWindow/Detail/template.html; sourceTree = SOURCE_ROOT; }; @@ -1393,16 +1387,6 @@ path = NetNewsWire/FeedList; sourceTree = ""; }; - 849A97901ED9EF65007D329B /* Progress Window */ = { - isa = PBXGroup; - children = ( - 849A97931ED9EF7A007D329B /* IndeterminateProgressWindow.xib */, - 849A97911ED9EF65007D329B /* IndeterminateProgressWindowController.swift */, - ); - name = "Progress Window"; - path = NetNewsWire/ProgressWindow; - sourceTree = ""; - }; 849A97961ED9EFAA007D329B /* Extensions */ = { isa = PBXGroup; children = ( @@ -1448,7 +1432,6 @@ 849A97861ED9ECEF007D329B /* Article Styles */, 84A6B6921FB8D43C006754AC /* Dinosaurs */, 849A978B1ED9EE4D007D329B /* Feed List */, - 849A97901ED9EF65007D329B /* Progress Window */, 84DAEE201F86CAE00058304B /* Importers */, 8444C9011FED81880051386C /* Exporters */, 84F2D5341FC22FCB00998D64 /* SmartFeeds */, @@ -2194,7 +2177,6 @@ buildActionMask = 2147483647; files = ( 840F7C9721BDA4B40057E851 /* KeyboardShortcuts.html in Resources */, - 840F7C9821BDA4B40057E851 /* IndeterminateProgressWindow.xib in Resources */, 840F7C9921BDA4B40057E851 /* GlobalKeyboardShortcuts.plist in Resources */, 84A3EE60223B667F00557320 /* DefaultFeeds.opml in Resources */, 8405DDA322168920008CE1BF /* TimelineTableView.xib in Resources */, @@ -2232,7 +2214,6 @@ buildActionMask = 2147483647; files = ( 84EB381F1FBA8B9F000D2111 /* KeyboardShortcuts.html in Resources */, - 849A97951ED9EF7A007D329B /* IndeterminateProgressWindow.xib in Resources */, 844B5B651FEA11F200C7C76A /* GlobalKeyboardShortcuts.plist in Resources */, 5127B23A222B4849006D641D /* DetailKeyboardShortcuts.plist in Resources */, 845479881FEB77C000AD8B59 /* TimelineKeyboardShortcuts.plist in Resources */, @@ -2434,7 +2415,6 @@ 840F7C6321BDA4B40057E851 /* AddFolderWindowController.swift in Sources */, 840F7C6421BDA4B40057E851 /* MainWIndowKeyboardHandler.swift in Sources */, 840F7C6521BDA4B40057E851 /* PasteboardFeed.swift in Sources */, - 840F7C6621BDA4B40057E851 /* IndeterminateProgressWindowController.swift in Sources */, 840F7C6721BDA4B40057E851 /* DetailViewController.swift in Sources */, 840F7C6821BDA4B40057E851 /* HTMLMetadataDownloader.swift in Sources */, 840F7C6921BDA4B40057E851 /* TimelineViewController.swift in Sources */, @@ -2562,7 +2542,6 @@ 8405DDA522168C62008CE1BF /* TimelineContainerViewController.swift in Sources */, 844B5B671FEA18E300C7C76A /* MainWIndowKeyboardHandler.swift in Sources */, 848D578E21543519005FFAD5 /* PasteboardFeed.swift in Sources */, - 849A97921ED9EF65007D329B /* IndeterminateProgressWindowController.swift in Sources */, 849A97801ED9EC42007D329B /* DetailViewController.swift in Sources */, 8426119E1FCB6ED40086A189 /* HTMLMetadataDownloader.swift in Sources */, 849A976E1ED9EBC8007D329B /* TimelineViewController.swift in Sources */, @@ -2766,14 +2745,6 @@ name = LaunchScreen.storyboard; sourceTree = ""; }; - 849A97931ED9EF7A007D329B /* IndeterminateProgressWindow.xib */ = { - isa = PBXVariantGroup; - children = ( - 849A97941ED9EF7A007D329B /* Base */, - ); - name = IndeterminateProgressWindow.xib; - sourceTree = ""; - }; 849A97A41ED9F94D007D329B /* Preferences.storyboard */ = { isa = PBXVariantGroup; children = ( diff --git a/NetNewsWire/Base.lproj/IndeterminateProgressWindow.xib b/NetNewsWire/Base.lproj/IndeterminateProgressWindow.xib deleted file mode 100644 index ccb7d9456..000000000 --- a/NetNewsWire/Base.lproj/IndeterminateProgressWindow.xib +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/NetNewsWire/ProgressWindow/IndeterminateProgressWindowController.swift b/NetNewsWire/ProgressWindow/IndeterminateProgressWindowController.swift deleted file mode 100644 index 2eae0dafc..000000000 --- a/NetNewsWire/ProgressWindow/IndeterminateProgressWindowController.swift +++ /dev/null @@ -1,71 +0,0 @@ -// -// IndeterminateProgressWindowController.swift -// NetNewsWire -// -// Created by Brent Simmons on 8/28/16. -// Copyright © 2016 Ranchero Software, LLC. All rights reserved. -// - -import AppKit - -func runIndeterminateProgressWithMessage(_ message: String) { - - IndeterminateProgressController.beginProgressWithMessage(message) -} - -func stopIndeterminateProgress() { - - IndeterminateProgressController.endProgress() -} - -private final class IndeterminateProgressController { - - static var windowController: IndeterminateProgressWindowController? - static var runningProgressWindow = false - - static func beginProgressWithMessage(_ message: String) { - - if runningProgressWindow { - assertionFailure("Expected !runningProgressWindow.") - endProgress() - } - - runningProgressWindow = true - windowController = IndeterminateProgressWindowController(message: message) - NSApplication.shared.runModal(for: windowController!.window!) - } - - static func endProgress() { - - if !runningProgressWindow { - assertionFailure("Expected runningProgressWindow.") - return - } - - runningProgressWindow = false - NSApplication.shared.stopModal() - windowController?.close() - windowController = nil - } -} - -private final class IndeterminateProgressWindowController: NSWindowController { - - @IBOutlet var messageLabel: NSTextField! - @IBOutlet var progressIndicator: NSProgressIndicator! - @objc dynamic var message = "" - - convenience init(message: String) { - - self.init(windowNibName: NSNib.Name("IndeterminateProgressWindow")) - self.message = message - } - - override func windowDidLoad() { - - progressIndicator.startAnimation(self) - } -} - - - diff --git a/submodules/RSCore b/submodules/RSCore index 38cf40b7e..d788afe42 160000 --- a/submodules/RSCore +++ b/submodules/RSCore @@ -1 +1 @@ -Subproject commit 38cf40b7ead95e6c3f3371b643748bd9f6687d8a +Subproject commit d788afe42fa0ba1455c691733a5be108dc12f69c