Repo // Use new tags for pinyin parsers.

This commit is contained in:
ShikiSuen 2023-05-23 19:39:51 +08:00
parent f3280ebf44
commit a1fd56b872
4 changed files with 10 additions and 14 deletions

View File

@ -178,12 +178,12 @@ public enum KeyboardParser: Int, CaseIterable {
case ofETen26 = 3
case ofHsu = 2
case ofStarlight = 9
case ofHanyuPinyin = 10
case ofSecondaryPinyin = 11
case ofYalePinyin = 12
case ofHualuoPinyin = 13
case ofUniversalPinyin = 14
case ofWadeGilesPinyin = 15
case ofHanyuPinyin = 100
case ofSecondaryPinyin = 101
case ofYalePinyin = 102
case ofHualuoPinyin = 103
case ofUniversalPinyin = 104
case ofWadeGilesPinyin = 105
public var localizedMenuName: String {
let rawString: String = {

View File

@ -39,11 +39,7 @@ public extension PrefMgr {
}
}
//
var isKeyboardParserOptionValid = false
KeyboardParser.allCases.forEach {
if $0.rawValue == keyboardParser { isKeyboardParserOptionValid = true }
}
if !isKeyboardParserOptionValid {
if KeyboardParser(rawValue: keyboardParser) == nil {
keyboardParser = 0
}
//

View File

@ -52,7 +52,7 @@ struct VwrPrefPaneKeyboard: View {
Text("↻ㄅ" + " " + NSLocalizedString("Eten Trad.", comment: ""))
}
Button {
keyboardParser = 10
keyboardParser = 100
basicKeyboardLayout = "com.apple.keylayout.ABC"
} label: {
Text("↻A")
@ -66,7 +66,7 @@ struct VwrPrefPaneKeyboard: View {
selection: $keyboardParser
) {
ForEach(KeyboardParser.allCases, id: \.self) { item in
if [7, 10].contains(item.rawValue) { Divider() }
if [7, 100].contains(item.rawValue) { Divider() }
Text(item.localizedMenuName).tag(item.rawValue)
}.id(UUID())
}

View File

@ -194,7 +194,7 @@ class CtlPrefWindow: NSWindowController, NSWindowDelegate {
parserButton.menu?.removeAllItems()
let basicParserID = PrefMgr.shared.keyboardParser
KeyboardParser.allCases.forEach { item in
if [7, 10].contains(item.rawValue) {
if [7, 100].contains(item.rawValue) {
parserButton.menu?.addItem(NSMenuItem.separator())
}
let menuItem = NSMenuItem()