Installer // Remove isMonterey() for now.
This commit is contained in:
parent
1e19a9e384
commit
9190e13aeb
|
@ -34,12 +34,6 @@ public let kTargetFullBinPartialPath = urlTargetFullBinPartial.path
|
||||||
public let kTranslocationRemovalTickInterval: TimeInterval = 0.5
|
public let kTranslocationRemovalTickInterval: TimeInterval = 0.5
|
||||||
public let kTranslocationRemovalDeadline: TimeInterval = 60.0
|
public let kTranslocationRemovalDeadline: TimeInterval = 60.0
|
||||||
|
|
||||||
public var isMonterey: Bool {
|
|
||||||
guard #unavailable(macOS 13) else { return false }
|
|
||||||
guard #available(macOS 12, *) else { return false }
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
@NSApplicationMain
|
@NSApplicationMain
|
||||||
@objc(AppDelegate)
|
@objc(AppDelegate)
|
||||||
class AppDelegate: NSWindowController, NSApplicationDelegate {
|
class AppDelegate: NSWindowController, NSApplicationDelegate {
|
||||||
|
|
|
@ -165,7 +165,7 @@ extension AppDelegate {
|
||||||
// 這樣可以尊重某些使用者「僅使用簡體中文」或「僅使用繁體中文」的習慣。
|
// 這樣可以尊重某些使用者「僅使用簡體中文」或「僅使用繁體中文」的習慣。
|
||||||
mainInputSourceEnabled = mainInputSourceEnabled || isActivated
|
mainInputSourceEnabled = mainInputSourceEnabled || isActivated
|
||||||
}
|
}
|
||||||
if isActivated, !isMonterey { return }
|
if isActivated { return }
|
||||||
// WARNING: macOS 12 may return false positives, hence forced activation.
|
// WARNING: macOS 12 may return false positives, hence forced activation.
|
||||||
if neta.activate() {
|
if neta.activate() {
|
||||||
NSLog("Input method enabled: \(imeIdentifier)")
|
NSLog("Input method enabled: \(imeIdentifier)")
|
||||||
|
@ -184,7 +184,7 @@ extension AppDelegate {
|
||||||
)
|
)
|
||||||
ntfPostInstall.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
ntfPostInstall.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
||||||
} else {
|
} else {
|
||||||
if !mainInputSourceEnabled, !isMonterey {
|
if !mainInputSourceEnabled {
|
||||||
ntfPostInstall.messageText = NSLocalizedString("Warning", comment: "")
|
ntfPostInstall.messageText = NSLocalizedString("Warning", comment: "")
|
||||||
ntfPostInstall.informativeText = NSLocalizedString(
|
ntfPostInstall.informativeText = NSLocalizedString(
|
||||||
"Input method may not be fully enabled. Please enable it through System Preferences > Keyboard > Input Sources.",
|
"Input method may not be fully enabled. Please enable it through System Preferences > Keyboard > Input Sources.",
|
||||||
|
|
Loading…
Reference in New Issue