mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Make add-feed work again.
This commit is contained in:
@@ -22,6 +22,7 @@ private final class IndeterminateProgressController {
|
||||
|
||||
static var windowController: IndeterminateProgressWindowController?
|
||||
static var runningProgressWindow = false
|
||||
static var modalSession: NSApplication.ModalSession?
|
||||
|
||||
static func beginProgressWithMessage(_ message: String) {
|
||||
|
||||
@@ -32,7 +33,10 @@ private final class IndeterminateProgressController {
|
||||
|
||||
runningProgressWindow = true
|
||||
windowController = IndeterminateProgressWindowController(message: message)
|
||||
NSApplication.shared.runModal(for: windowController!.window!)
|
||||
|
||||
assert(modalSession == nil)
|
||||
modalSession = NSApplication.shared.beginModalSession(for: windowController!.window!)
|
||||
NSApplication.shared.runModalSession(modalSession!)
|
||||
}
|
||||
|
||||
static func endProgress() {
|
||||
@@ -43,9 +47,15 @@ private final class IndeterminateProgressController {
|
||||
}
|
||||
|
||||
runningProgressWindow = false
|
||||
NSApplication.shared.stopModal()
|
||||
if let modalSession {
|
||||
NSApplication.shared.endModalSession(modalSession)
|
||||
} else {
|
||||
assertionFailure("endProgress called without a modalSession.")
|
||||
}
|
||||
|
||||
windowController?.close()
|
||||
windowController = nil
|
||||
modalSession = nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user