|
@@ -538,21 +538,27 @@ import Cocoa
|
|
|
KMPrint("openDocument error: window is nil.", beep: true)
|
|
|
return
|
|
|
}
|
|
|
- if let cnt = self.browser?.tabCount(), cnt > 1 && !IAPProductsManager.default().isAvailableAllFunction() {
|
|
|
- if !KMDataManager.default.isTabbingWin{
|
|
|
- KMDataManager.default.isTabbingWin = true
|
|
|
- let tabbingWin: KMTabbingHintWindowController = KMTabbingHintWindowController()
|
|
|
- tabbingWin.selectCallBack = { [weak self] continueOrNot in
|
|
|
- KMDataManager.default.isTabbingWin = false
|
|
|
- if continueOrNot {
|
|
|
- self?.reopenDocument(forPaths: nil)
|
|
|
- } else {
|
|
|
-
|
|
|
+ if let cnt = self.browser?.tabCount(), cnt > 1{
|
|
|
+ if !IAPProductsManager.default().isAvailableAllFunction() {
|
|
|
+ if !KMDataManager.default.isTabbingWin{
|
|
|
+ KMDataManager.default.isTabbingWin = true
|
|
|
+ let tabbingWin: KMTabbingHintWindowController = KMTabbingHintWindowController()
|
|
|
+ tabbingWin.selectCallBack = { [weak self] continueOrNot in
|
|
|
+ KMDataManager.default.isTabbingWin = false
|
|
|
+ if continueOrNot {
|
|
|
+ self?.reopenDocument(forPaths: nil)
|
|
|
+ } else {
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
+ self.km_beginSheet(windowC: tabbingWin)
|
|
|
}
|
|
|
- self.km_beginSheet(windowC: tabbingWin)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if KMPreference.shared.openDocumentType == .newWindow {
|
|
|
+ self.reopenDocument(forPaths: nil)
|
|
|
+ return
|
|
|
}
|
|
|
- return
|
|
|
}
|
|
|
|
|
|
NSOpenPanel.km_open_multi_success(_window) { panel in
|
|
@@ -1509,26 +1515,33 @@ extension KMBrowserWindowController: KMSystemFileMenuProtocol {
|
|
|
}
|
|
|
func checkOpenNewDocument(path: String) -> Bool {
|
|
|
let tabCount = self.km_browser?.tabCount() ?? 0
|
|
|
- if !IAPProductsManager.default().isAvailableAllFunction() && tabCount > 1 {
|
|
|
- let preferenceNoteShow = UserDefaults.standard.bool(forKey: KMTabbingHintShowFlag)
|
|
|
- if preferenceNoteShow {
|
|
|
- menuItemAction_newTagPageToNewWindow("")
|
|
|
- } else {
|
|
|
- if !KMDataManager.default.isTabbingWin{
|
|
|
- KMDataManager.default.isTabbingWin = true
|
|
|
- let tabbingWin: KMTabbingHintWindowController = KMTabbingHintWindowController()
|
|
|
- tabbingWin.selectCallBack = {[weak self] continueOrNot in
|
|
|
- KMDataManager.default.isTabbingWin = false
|
|
|
- if continueOrNot {
|
|
|
- self?.reopenDocumentForNewWindow(savePath: path)
|
|
|
- } else {
|
|
|
-
|
|
|
+ if tabCount > 1{
|
|
|
+ if !IAPProductsManager.default().isAvailableAllFunction() {
|
|
|
+ let preferenceNoteShow = UserDefaults.standard.bool(forKey: KMTabbingHintShowFlag)
|
|
|
+ if preferenceNoteShow {
|
|
|
+ menuItemAction_newTagPageToNewWindow("")
|
|
|
+ } else {
|
|
|
+ if !KMDataManager.default.isTabbingWin{
|
|
|
+ KMDataManager.default.isTabbingWin = true
|
|
|
+ let tabbingWin: KMTabbingHintWindowController = KMTabbingHintWindowController()
|
|
|
+ tabbingWin.selectCallBack = {[weak self] continueOrNot in
|
|
|
+ KMDataManager.default.isTabbingWin = false
|
|
|
+ if continueOrNot {
|
|
|
+ self?.reopenDocumentForNewWindow(savePath: path)
|
|
|
+ } else {
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
+ self.km_beginSheet(windowC: tabbingWin)
|
|
|
}
|
|
|
- self.km_beginSheet(windowC: tabbingWin)
|
|
|
+ }
|
|
|
+ return false
|
|
|
+ }else {
|
|
|
+ if KMPreference.shared.openDocumentType == .newWindow {
|
|
|
+ self.reopenDocumentForNewWindow(savePath: path)
|
|
|
+ return false
|
|
|
}
|
|
|
}
|
|
|
- return false
|
|
|
}
|
|
|
return true
|
|
|
}
|