mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-22 23:58:36 +01:00
Make add-feed work again.
This commit is contained in:
parent
545ed4ad56
commit
9d747a99c9
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user