ctlInputMethod // Add a shortcut to the User Data folder.
This commit is contained in:
parent
193d612580
commit
504fc08265
|
@ -80,6 +80,7 @@ class ctlInputMethod: IMKInputController {
|
|||
|
||||
menu.addItem(NSMenuItem.separator()) // ---------------------
|
||||
|
||||
menu.addItem(withTitle: NSLocalizedString("Open User Data Folder", comment: ""), action: #selector(openUserDataFolder(_:)), keyEquivalent: "")
|
||||
menu.addItem(withTitle: NSLocalizedString("Edit User Phrases", comment: ""), action: #selector(openUserPhrases(_:)), keyEquivalent: "")
|
||||
|
||||
if optionKeyPressed {
|
||||
|
@ -252,6 +253,13 @@ class ctlInputMethod: IMKInputController {
|
|||
open(userFileAt: mgrLangModel.userPhrasesDataPath(keyHandler.inputMode))
|
||||
}
|
||||
|
||||
@objc func openUserDataFolder(_ sender: Any?) {
|
||||
if !mgrLangModel.checkIfUserDataFolderExists() {
|
||||
return
|
||||
}
|
||||
NSWorkspace.shared.openFile(mgrLangModel.dataFolderPath, withApplication: "Finder")
|
||||
}
|
||||
|
||||
@objc func openExcludedPhrases(_ sender: Any?) {
|
||||
open(userFileAt: mgrLangModel.excludedPhrasesDataPath(keyHandler.inputMode))
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
+ (void)loadUserPhraseReplacement;
|
||||
+ (void)setupDataModelValueConverter;
|
||||
+ (BOOL)checkIfUserLanguageModelFilesExist;
|
||||
+ (BOOL)checkIfUserDataFolderExists;
|
||||
|
||||
+ (BOOL)checkIfUserPhraseExist:(NSString *)userPhrase key:(NSString *)key NS_SWIFT_NAME(checkIfExist(userPhrase:key:));
|
||||
+ (BOOL)writeUserPhrase:(NSString *)userPhrase inputMode:(InputMode)mode;
|
||||
|
|
Loading…
Reference in New Issue