macos: comment the new views

This commit is contained in:
Mitchell Hashimoto
2023-11-05 09:31:12 -08:00
parent 705f3b52c7
commit 5de8efcccc
2 changed files with 7 additions and 0 deletions

View File

@ -3,6 +3,8 @@ import Cocoa
import SwiftUI
import GhosttyKit
/// This initializes an "unsafe paste" warning window. The window itself WILL NOT show automatically
/// and the caller must show the window via showWindow, beginSheet, etc.
class PasteProtectionController: NSWindowController {
override var windowNibName: NSNib.Name? { "PasteProtection" }

View File

@ -1,16 +1,21 @@
import SwiftUI
/// This delegate is notified of the completion result of the paste protection dialog.
protocol PasteProtectionViewDelegate: AnyObject {
func pasteProtectionComplete(_ action: PasteProtectionView.Action)
}
/// The SwiftUI view for showing a paste protection dialog.
struct PasteProtectionView: View {
enum Action : String {
case cancel
case paste
}
/// The contents of the paste.
let contents: String
/// Optional delegate to get results. If this is nil, then this view will never close on its own.
weak var delegate: PasteProtectionViewDelegate? = nil
var body: some View {