|
@@ -196,7 +196,8 @@ class KMSearchReplaceWindowController: NSWindowController {
|
|
let alert = NSAlert()
|
|
let alert = NSAlert()
|
|
alert.messageText = NSLocalizedString("No related content found, please change keyword.", comment: "")
|
|
alert.messageText = NSLocalizedString("No related content found, please change keyword.", comment: "")
|
|
alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
|
alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
|
- alert.runModal()
|
|
|
|
|
|
+// alert.runModal()
|
|
|
|
+ alert.beginSheetModal(for: (self.window)!)
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
if self.finding_ {
|
|
if self.finding_ {
|
|
@@ -216,7 +217,8 @@ class KMSearchReplaceWindowController: NSWindowController {
|
|
let alert = NSAlert()
|
|
let alert = NSAlert()
|
|
alert.messageText = NSLocalizedString("No related content found, please change keyword.", comment: "")
|
|
alert.messageText = NSLocalizedString("No related content found, please change keyword.", comment: "")
|
|
alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
|
alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
|
- alert.runModal()
|
|
|
|
|
|
+// alert.runModal()
|
|
|
|
+ alert.beginSheetModal(for: (self.window)!)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
self.currentSel = sel
|
|
self.currentSel = sel
|
|
@@ -244,7 +246,8 @@ class KMSearchReplaceWindowController: NSWindowController {
|
|
let alert = NSAlert()
|
|
let alert = NSAlert()
|
|
alert.messageText = NSLocalizedString("No related content found, please change keyword.", comment: "")
|
|
alert.messageText = NSLocalizedString("No related content found, please change keyword.", comment: "")
|
|
alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
|
alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
|
- alert.runModal()
|
|
|
|
|
|
+// alert.runModal()
|
|
|
|
+ alert.beginSheetModal(for: (self.window)!)
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
if self.finding_ {
|
|
if self.finding_ {
|
|
@@ -265,7 +268,8 @@ class KMSearchReplaceWindowController: NSWindowController {
|
|
let alert = NSAlert()
|
|
let alert = NSAlert()
|
|
alert.messageText = NSLocalizedString("No related content found, please change keyword.", comment: "")
|
|
alert.messageText = NSLocalizedString("No related content found, please change keyword.", comment: "")
|
|
alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
|
alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
|
- alert.runModal()
|
|
|
|
|
|
+// alert.runModal()
|
|
|
|
+ alert.beginSheetModal(for: (self.window)!)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
self.currentSel = sel
|
|
self.currentSel = sel
|
|
@@ -321,7 +325,8 @@ class KMSearchReplaceWindowController: NSWindowController {
|
|
let alert = NSAlert()
|
|
let alert = NSAlert()
|
|
alert.messageText = NSLocalizedString("No related content found, please change keyword.", comment: "")
|
|
alert.messageText = NSLocalizedString("No related content found, please change keyword.", comment: "")
|
|
alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
|
alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
|
- alert.runModal()
|
|
|
|
|
|
+// alert.runModal()
|
|
|
|
+ alert.beginSheetModal(for: (self.window)!)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
self.currentSel = sel
|
|
self.currentSel = sel
|
|
@@ -344,7 +349,8 @@ class KMSearchReplaceWindowController: NSWindowController {
|
|
alert.informativeText = NSLocalizedString("No related content found, please change keyword.", comment: "")
|
|
alert.informativeText = NSLocalizedString("No related content found, please change keyword.", comment: "")
|
|
alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
|
alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
|
// alert.beginSheetModal(for: NSApp.mainWindow!)
|
|
// alert.beginSheetModal(for: NSApp.mainWindow!)
|
|
- alert.runModal()
|
|
|
|
|
|
+// alert.runModal()
|
|
|
|
+ alert.beginSheetModal(for: (self.window)!)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
@@ -549,6 +555,15 @@ extension KMSearchReplaceWindowController: NSTextFieldDelegate {
|
|
self._beginLoading()
|
|
self._beginLoading()
|
|
self.handdler.search(keyword: self.searchInputView.stringValue, isCase: isCase, isWholeWord: isWholeWord, callback: { [weak self] datas in
|
|
self.handdler.search(keyword: self.searchInputView.stringValue, isCase: isCase, isWholeWord: isWholeWord, callback: { [weak self] datas in
|
|
self?._endLoading()
|
|
self?._endLoading()
|
|
|
|
+
|
|
|
|
+ guard let sels = datas, sels.isEmpty == false else {
|
|
|
|
+ let alert = NSAlert()
|
|
|
|
+ alert.informativeText = NSLocalizedString("No related content found, please change keyword.", comment: "")
|
|
|
|
+ alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
|
|
|
+// alert.runModal()
|
|
|
|
+ alert.beginSheetModal(for: (self?.window)!)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
if let sel = datas?.first?.selection {
|
|
if let sel = datas?.first?.selection {
|
|
self?.handdler.showIdx = 0
|
|
self?.handdler.showIdx = 0
|
|
self?.handdler.showSelection(sel)
|
|
self?.handdler.showSelection(sel)
|
|
@@ -567,7 +582,8 @@ extension KMSearchReplaceWindowController: NSTextFieldDelegate {
|
|
alert.informativeText = NSLocalizedString("No related content found, please change keyword.", comment: "")
|
|
alert.informativeText = NSLocalizedString("No related content found, please change keyword.", comment: "")
|
|
alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
|
alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
|
// alert.beginSheetModal(for: NSApp.mainWindow!)
|
|
// alert.beginSheetModal(for: NSApp.mainWindow!)
|
|
- alert.runModal()
|
|
|
|
|
|
+// alert.runModal()
|
|
|
|
+ alert.beginSheetModal(for: (self.window)!)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
self.currentSel = datas.first?.first
|
|
self.currentSel = datas.first?.first
|