FSEventStreamHelper // Update path when necessary.
This commit is contained in:
parent
06d41f9216
commit
8eae5ecfe1
|
@ -47,7 +47,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, ctlNonModalAlertWindowDelega
|
|||
private var ctlAboutWindowInstance: ctlAboutWindow? // New About Window
|
||||
private var checkTask: URLSessionTask?
|
||||
private var updateNextStepURL: URL?
|
||||
private var fsStreamHelper = FSEventStreamHelper(
|
||||
public var fsStreamHelper = FSEventStreamHelper(
|
||||
path: mgrLangModel.dataFolderPath(isDefaultFolder: false),
|
||||
queue: DispatchQueue(label: "vChewing User Phrases")
|
||||
)
|
||||
|
@ -76,6 +76,10 @@ class AppDelegate: NSObject, NSApplicationDelegate, ctlNonModalAlertWindowDelega
|
|||
}
|
||||
}
|
||||
|
||||
func updateStreamHelperPath() {
|
||||
fsStreamHelper.path = mgrPrefs.userDataFolderSpecified
|
||||
}
|
||||
|
||||
func showPreferences() {
|
||||
if ctlPrefWindowInstance == nil {
|
||||
ctlPrefWindowInstance = ctlPrefWindow.init(windowNibName: "frmPrefWindow")
|
||||
|
|
|
@ -37,7 +37,7 @@ public class FSEventStreamHelper: NSObject {
|
|||
var id: FSEventStreamEventId
|
||||
}
|
||||
|
||||
public let path: String
|
||||
public var path: String
|
||||
public let dispatchQueue: DispatchQueue
|
||||
public weak var delegate: FSEventStreamHelperDelegate?
|
||||
|
||||
|
|
|
@ -79,6 +79,7 @@ struct suiPrefPaneDictionary: View {
|
|||
mgrPrefs.userDataFolderSpecified = newPath
|
||||
tbxUserDataPathSpecified = mgrPrefs.userDataFolderSpecified
|
||||
IME.initLangModels(userOnly: true)
|
||||
(NSApplication.shared.delegate as! AppDelegate).updateStreamHelperPath()
|
||||
} else {
|
||||
clsSFX.beep()
|
||||
if !bolPreviousFolderValidity {
|
||||
|
|
|
@ -276,6 +276,7 @@ class ctlPrefWindow: NSWindowController {
|
|||
if mgrLangModel.checkIfSpecifiedUserDataFolderValid(newPath) {
|
||||
mgrPrefs.userDataFolderSpecified = newPath
|
||||
IME.initLangModels(userOnly: true)
|
||||
(NSApplication.shared.delegate as! AppDelegate).updateStreamHelperPath()
|
||||
} else {
|
||||
clsSFX.beep()
|
||||
if !bolPreviousFolderValidity {
|
||||
|
|
Loading…
Reference in New Issue