From 1a9fd9b2c142a0aca8e841b05c8c5c706f42f537 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Wed, 7 Dec 2022 20:22:51 +0800 Subject: [PATCH] LMMgr & AppDelegate // Connecting PhraseEditorCocoa to the IME. --- Source/Modules/AppDelegate.swift | 3 +++ Source/Modules/LMMgr.swift | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Source/Modules/AppDelegate.swift b/Source/Modules/AppDelegate.swift index 8e84e8d4..5b0a5625 100644 --- a/Source/Modules/AppDelegate.swift +++ b/Source/Modules/AppDelegate.swift @@ -27,6 +27,9 @@ extension AppDelegate { // 拖 100ms 再重載,畢竟有些有特殊需求的使用者可能會想使用巨型自訂語彙檔案。 DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.1) { if #available(macOS 10.15, *) { FileObserveProject.shared.touch() } + if PrefMgr.shared.phraseEditorAutoReloadExternalModifications { + CtlPrefWindow.shared?.updatePhraseEditor() + } if PrefMgr.shared.shouldAutoReloadUserDataFiles { LMMgr.initUserLangModels() } } } diff --git a/Source/Modules/LMMgr.swift b/Source/Modules/LMMgr.swift index d99f2d36..cd13d5f5 100644 --- a/Source/Modules/LMMgr.swift +++ b/Source/Modules/LMMgr.swift @@ -602,6 +602,9 @@ public class LMMgr { // The new FolderMonitor module does NOT monitor cases that files are modified // by the current application itself, requiring additional manual loading process here. if #available(macOS 10.15, *) { FileObserveProject.shared.touch() } + if PrefMgr.shared.phraseEditorAutoReloadExternalModifications { + CtlPrefWindow.shared?.updatePhraseEditor() + } loadUserPhrasesData(type: .thePhrases) return true }