IMEApp // Add .appVersionLabel().
This commit is contained in:
parent
f33bf89be2
commit
cba27d10c2
|
@ -29,17 +29,9 @@ class CtlAboutWindow: NSWindowController {
|
|||
override func windowDidLoad() {
|
||||
super.windowDidLoad()
|
||||
window?.setPosition(vertical: .top, horizontal: .left, padding: 20)
|
||||
|
||||
window?.standardWindowButton(.closeButton)?.isHidden = true
|
||||
window?.standardWindowButton(.miniaturizeButton)?.isHidden = true
|
||||
window?.standardWindowButton(.zoomButton)?.isHidden = true
|
||||
guard
|
||||
let installingVersion = Bundle.main.infoDictionary?[kCFBundleVersionKey as String]
|
||||
as? String,
|
||||
let versionString = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
|
||||
else {
|
||||
return
|
||||
}
|
||||
if let copyrightLabel = Bundle.main.localizedInfoDictionary?["NSHumanReadableCopyright"]
|
||||
as? String
|
||||
{
|
||||
|
@ -50,7 +42,7 @@ class CtlAboutWindow: NSWindowController {
|
|||
{
|
||||
appEULAContent.string = eulaContent + "\n" + eulaContentUpstream
|
||||
}
|
||||
appVersionLabel.stringValue = "\(versionString) Build \(installingVersion)"
|
||||
appVersionLabel.stringValue = IMEApp.appVersionLabel
|
||||
}
|
||||
|
||||
@IBAction func btnBugReport(_: NSButton) {
|
||||
|
|
|
@ -74,6 +74,19 @@ _ = NSApplicationMain(CommandLine.argc, CommandLine.unsafeArgv)
|
|||
// MARK: - Top-level Enums relating to Input Mode and Language Supports.
|
||||
|
||||
public enum IMEApp {
|
||||
// MARK: - 獲取輸入法的版本以及建置編號
|
||||
|
||||
public static var appVersionLabel: String {
|
||||
guard
|
||||
let intBuild = Bundle.main.infoDictionary?[kCFBundleVersionKey as String] as? String,
|
||||
let strVer = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
|
||||
else {
|
||||
return "114.514.1919810"
|
||||
}
|
||||
|
||||
return "\(strVer) Build \(intBuild)"
|
||||
}
|
||||
|
||||
// MARK: - 輸入法的當前的簡繁體中文模式
|
||||
|
||||
public static var currentInputMode: Shared.InputMode {
|
||||
|
|
Loading…
Reference in New Issue