macos: use surfaceTree2 needsConfirmQuit
parent
aef61661a0
commit
a389926ca7
|
|
@ -668,13 +668,13 @@ class BaseTerminalController: NSWindowController,
|
|||
guard let window = self.window else { return true }
|
||||
|
||||
// If we have no surfaces, close.
|
||||
guard let node = self.surfaceTree else { return true }
|
||||
if surfaceTree2.isEmpty { return true }
|
||||
|
||||
// If we already have an alert, continue with it
|
||||
guard alert == nil else { return false }
|
||||
|
||||
// If our surfaces don't require confirmation, close.
|
||||
if (!node.needsConfirmQuit()) { return true }
|
||||
if !surfaceTree2.contains(where: { $0.needsConfirmQuit }) { return true }
|
||||
|
||||
// We require confirmation, so show an alert as long as we aren't already.
|
||||
confirmClose(
|
||||
|
|
|
|||
|
|
@ -595,7 +595,7 @@ class TerminalController: BaseTerminalController {
|
|||
return
|
||||
}
|
||||
|
||||
if surfaceTree?.needsConfirmQuit() ?? false {
|
||||
if surfaceTree2.contains(where: { $0.needsConfirmQuit }) {
|
||||
confirmClose(
|
||||
messageText: "Close Tab?",
|
||||
informativeText: "The terminal still has a running process. If you close the tab the process will be killed."
|
||||
|
|
@ -632,7 +632,7 @@ class TerminalController: BaseTerminalController {
|
|||
guard let controller = tabWindow.windowController as? TerminalController else {
|
||||
return false
|
||||
}
|
||||
return controller.surfaceTree?.needsConfirmQuit() ?? false
|
||||
return controller.surfaceTree2.contains(where: { $0.needsConfirmQuit })
|
||||
}
|
||||
|
||||
// If none need confirmation then we can just close all the windows.
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ class TerminalManager {
|
|||
func closeAllWindows() {
|
||||
var needsConfirm: Bool = false
|
||||
for w in self.windows {
|
||||
if (w.controller.surfaceTree?.needsConfirmQuit() ?? false) {
|
||||
if w.controller.surfaceTree2.contains(where: { $0.needsConfirmQuit }) {
|
||||
needsConfirm = true
|
||||
break
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue