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