Shiki: Swiftify // New About Window.
This commit is contained in:
parent
fac59f3650
commit
ee5fa1dae6
|
@ -110,22 +110,6 @@ vChewing Phrase Database Maintained by Shiki Suen.</string>
|
|||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button horizontalHuggingPriority="249" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="bSu-np-tPT" userLabel="confirmButton">
|
||||
<rect key="frame" x="382" y="74" width="143" height="54"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="129" id="ECG-s4-D2p"/>
|
||||
</constraints>
|
||||
<buttonCell key="cell" type="push" title="OK" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="btnConfirm">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<string key="keyEquivalent" base64-UTF8="YES">
|
||||
DQ
|
||||
</string>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="performClose:" target="-1" id="0yK-v8-KQd"/>
|
||||
</connections>
|
||||
</button>
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="d81-Fe-uNT">
|
||||
<rect key="frame" x="13" y="21" width="360" height="105"/>
|
||||
<constraints>
|
||||
|
@ -156,6 +140,22 @@ DQ
|
|||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button horizontalHuggingPriority="249" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="bSu-np-tPT" userLabel="confirmButton">
|
||||
<rect key="frame" x="382" y="96" width="143" height="32"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="129" id="ECG-s4-D2p"/>
|
||||
</constraints>
|
||||
<buttonCell key="cell" type="push" title="OK" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="btnConfirm">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<string key="keyEquivalent" base64-UTF8="YES">
|
||||
DQ
|
||||
</string>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="performClose:" target="-1" id="0yK-v8-KQd"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="9Pk-k3-0cO" secondAttribute="trailing" constant="20" symbolic="YES" id="0LE-Ck-Jy5"/>
|
||||
|
@ -172,11 +172,12 @@ DQ
|
|||
<constraint firstItem="bAv-ZO-Ihw" firstAttribute="leading" secondItem="2Gh-nq-Mng" secondAttribute="leading" id="EQ1-cm-RX8"/>
|
||||
<constraint firstItem="eYM-F7-drf" firstAttribute="leading" secondItem="pHH-M3-zKo" secondAttribute="leading" id="Fcb-XF-cee"/>
|
||||
<constraint firstItem="2Gh-nq-Mng" firstAttribute="top" secondItem="pHH-M3-zKo" secondAttribute="bottom" constant="8" symbolic="YES" id="GZ9-5T-UZI"/>
|
||||
<constraint firstAttribute="bottom" secondItem="bSu-np-tPT" secondAttribute="bottom" constant="81" id="Inw-Qt-fHt"/>
|
||||
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="bSu-np-tPT" secondAttribute="bottom" constant="81" id="Inw-Qt-fHt"/>
|
||||
<constraint firstAttribute="bottom" secondItem="d81-Fe-uNT" secondAttribute="bottom" constant="21" id="Km1-n7-j8F"/>
|
||||
<constraint firstItem="8M8-3C-BZO" firstAttribute="trailing" secondItem="eYM-F7-drf" secondAttribute="trailing" id="O8T-AT-i11"/>
|
||||
<constraint firstItem="Srh-ua-uQD" firstAttribute="leading" secondItem="8Ju-DR-2C8" secondAttribute="leading" id="Rks-Q6-4Hh"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="Srh-ua-uQD" secondAttribute="trailing" constant="20" symbolic="YES" id="Swp-Z3-57P"/>
|
||||
<constraint firstItem="bSu-np-tPT" firstAttribute="top" secondItem="2Gh-nq-Mng" secondAttribute="bottom" constant="11" id="ThD-rE-Rc3"/>
|
||||
<constraint firstItem="6Dx-DY-UG1" firstAttribute="baseline" secondItem="9Pk-k3-0cO" secondAttribute="baseline" id="UXk-Ir-Kti"/>
|
||||
<constraint firstItem="6Dx-DY-UG1" firstAttribute="leading" secondItem="Srh-ua-uQD" secondAttribute="leading" id="UZA-vT-6yG"/>
|
||||
<constraint firstItem="bAv-ZO-Ihw" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="15" id="Uhh-Lu-dEf"/>
|
||||
|
@ -189,7 +190,6 @@ DQ
|
|||
<constraint firstItem="bAv-ZO-Ihw" firstAttribute="top" secondItem="6Dx-DY-UG1" secondAttribute="top" id="hJv-Sh-M4t"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="8Ju-DR-2C8" secondAttribute="trailing" constant="20" symbolic="YES" id="hm1-o7-gLp"/>
|
||||
<constraint firstItem="2Gh-nq-Mng" firstAttribute="trailing" secondItem="bSu-np-tPT" secondAttribute="trailing" id="ixJ-xP-aIU"/>
|
||||
<constraint firstItem="bSu-np-tPT" firstAttribute="top" secondItem="pHH-M3-zKo" secondAttribute="bottom" constant="20" symbolic="YES" id="pW1-SU-K2z"/>
|
||||
<constraint firstItem="8M8-3C-BZO" firstAttribute="leading" secondItem="eYM-F7-drf" secondAttribute="leading" id="rLt-ck-nSt"/>
|
||||
<constraint firstItem="bAv-ZO-Ihw" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" id="u49-Fr-HYh"/>
|
||||
</constraints>
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#import "Gramambular.h"
|
||||
#import "vChewingLM.h"
|
||||
#import "UserOverrideModel.h"
|
||||
#import "frmAboutWindow.h"
|
||||
|
||||
@interface vChewingInputMethodController : IMKInputController
|
||||
{
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
/*
|
||||
* frmAboutWindow.h
|
||||
*
|
||||
* Copyright 2021-2022 vChewing Project (3-Clause BSD License).
|
||||
* Derived from 2011-2022 OpenVanilla Project (MIT License).
|
||||
* Some rights reserved. See "LICENSE.TXT" for details.
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface frmAboutWindow : NSWindowController
|
||||
|
||||
+ (instancetype) defaultController;
|
||||
- (void) showWithSender:(id)sender;
|
||||
|
||||
@property (nonatomic) IBOutlet NSTextField *appNameLabel;
|
||||
@property (nonatomic) IBOutlet NSTextField *appVersionLabel;
|
||||
@property (nonatomic) IBOutlet NSTextField *appCopyrightLabel;
|
||||
@property (nonatomic) IBOutlet NSTextView *appEULAContent;
|
||||
|
||||
@end
|
|
@ -1,67 +0,0 @@
|
|||
/*
|
||||
* frmAboutWindow.m
|
||||
*
|
||||
* Copyright 2021-2022 vChewing Project (3-Clause BSD License).
|
||||
* Derived from 2011-2022 OpenVanilla Project (MIT License).
|
||||
* Some rights reserved. See "LICENSE.TXT" for details.
|
||||
*/
|
||||
|
||||
#import "frmAboutWindow.h"
|
||||
|
||||
|
||||
@implementation frmAboutWindow
|
||||
@synthesize appNameLabel;
|
||||
@synthesize appVersionLabel;
|
||||
@synthesize appCopyrightLabel;
|
||||
@synthesize appEULAContent;
|
||||
|
||||
+ (instancetype) defaultController {
|
||||
|
||||
static id staticInstance = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
|
||||
dispatch_once(&onceToken, ^{
|
||||
staticInstance = [[self alloc] init];
|
||||
});
|
||||
|
||||
return staticInstance;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Initialization
|
||||
|
||||
|
||||
- (instancetype) init {
|
||||
return [super initWithWindowNibName:@"frmAboutWindow" owner:self];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - NSWindowController
|
||||
|
||||
|
||||
- (void) windowDidLoad {
|
||||
|
||||
[super windowDidLoad];
|
||||
[self.window standardWindowButton:NSWindowCloseButton].hidden = true;
|
||||
[self.window standardWindowButton:NSWindowMiniaturizeButton].hidden = true;
|
||||
[self.window standardWindowButton:NSWindowZoomButton].hidden = true;
|
||||
[self updateInfo];
|
||||
}
|
||||
|
||||
- (void) updateInfo {
|
||||
|
||||
NSString *installingVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:(id)kCFBundleVersionKey];
|
||||
NSString *versionString = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
|
||||
|
||||
NSDictionary* localizedInfoDictionary = [[NSBundle mainBundle] localizedInfoDictionary];
|
||||
|
||||
self.appNameLabel.stringValue = [localizedInfoDictionary objectForKey:@"CFBundleName"];
|
||||
self.appVersionLabel.stringValue = [NSString stringWithFormat:@"%@ Build %@", versionString, installingVersion];
|
||||
self.appCopyrightLabel.stringValue = [localizedInfoDictionary objectForKey:@"NSHumanReadableCopyright"];
|
||||
self.appEULAContent.string = [localizedInfoDictionary objectForKey:@"CFEULAContent"];
|
||||
}
|
||||
|
||||
- (void) showWithSender:(id)sender {
|
||||
}
|
||||
|
||||
@end
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* frmAboutWindow.swift
|
||||
*
|
||||
* Copyright 2021-2022 vChewing Project (3-Clause BSD License).
|
||||
* Derived from 2011-2022 OpenVanilla Project (MIT License).
|
||||
* Some rights reserved. See "LICENSE.TXT" for details.
|
||||
*/
|
||||
|
||||
import Cocoa
|
||||
|
||||
@objc(frmAboutWindow) class frmAboutWindow: NSWindowController {
|
||||
@IBOutlet weak var appVersionLabel: NSTextField!
|
||||
@IBOutlet weak var appCopyrightLabel: NSTextField!
|
||||
@IBOutlet var appEULAContent: NSTextView!
|
||||
|
||||
override func windowDidLoad() {
|
||||
super.windowDidLoad()
|
||||
|
||||
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 {
|
||||
appCopyrightLabel.stringValue = copyrightLabel
|
||||
}
|
||||
if let eulaContent = Bundle.main.localizedInfoDictionary?["CFEULAContent"] as? String {
|
||||
appEULAContent.string = eulaContent
|
||||
}
|
||||
appVersionLabel.stringValue = String(format: "%@ Build %@", versionString, installingVersion)
|
||||
}
|
||||
|
||||
}
|
|
@ -10,7 +10,6 @@
|
|||
// Use this file to import your target's public headers that you would like to expose to Swift.
|
||||
//
|
||||
|
||||
#import "frmAboutWindow.h"
|
||||
#import <Foundation/Foundation.h> // @import Foundation;
|
||||
@interface LanguageModelManager : NSObject
|
||||
+ (void)loadDataModels;
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
5B21711B279B998C00F91A2B /* Chronosphere.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B217119279B998800F91A2B /* Chronosphere.m */; };
|
||||
5B21711E279B9AD900F91A2B /* ArchiveUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B21711C279B9AD700F91A2B /* ArchiveUtil.swift */; };
|
||||
5B217126279BA37500F91A2B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B217124279BA37300F91A2B /* AppDelegate.swift */; };
|
||||
5B217128279BB22700F91A2B /* frmAboutWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B217127279BB22700F91A2B /* frmAboutWindow.swift */; };
|
||||
5B42B64027876FDC00BB9B9F /* UserOverrideModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5B42B63E27876FDC00BB9B9F /* UserOverrideModel.cpp */; };
|
||||
5B58E87F278413E7003EA2AD /* BSDLicense.txt in Resources */ = {isa = PBXBuildFile; fileRef = 5B58E87D278413E7003EA2AD /* BSDLicense.txt */; };
|
||||
5B5F4F8E27928F9300922DC2 /* vChewingLM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5B5F4F8D27928F9300922DC2 /* vChewingLM.cpp */; };
|
||||
|
@ -39,7 +40,6 @@
|
|||
5BDF2D062791DFF200838ADB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BDF2D052791DA6700838ADB /* AppDelegate.swift */; };
|
||||
5BE798A42792E58A00337FF9 /* TooltipController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BE798A32792E58A00337FF9 /* TooltipController.swift */; };
|
||||
5BE798A72793280C00337FF9 /* NotifierController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BE798A62793280C00337FF9 /* NotifierController.swift */; };
|
||||
5BF4A6FE27844738007DC6E7 /* frmAboutWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BF4A6FC27844738007DC6E7 /* frmAboutWindow.m */; };
|
||||
5BF4A70027844DC5007DC6E7 /* frmAboutWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5BF4A70227844DC5007DC6E7 /* frmAboutWindow.xib */; };
|
||||
6A0421A815FEF3F50061ED63 /* FastLM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6A0421A615FEF3F50061ED63 /* FastLM.cpp */; };
|
||||
6A0D4EA715FC0D2D00ABF4B3 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6A0D4EA615FC0D2D00ABF4B3 /* Cocoa.framework */; };
|
||||
|
@ -95,6 +95,7 @@
|
|||
5B217119279B998800F91A2B /* Chronosphere.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Chronosphere.m; sourceTree = "<group>"; };
|
||||
5B21711C279B9AD700F91A2B /* ArchiveUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArchiveUtil.swift; sourceTree = "<group>"; };
|
||||
5B217124279BA37300F91A2B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
5B217127279BB22700F91A2B /* frmAboutWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = frmAboutWindow.swift; sourceTree = "<group>"; };
|
||||
5B42B63E27876FDC00BB9B9F /* UserOverrideModel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserOverrideModel.cpp; sourceTree = "<group>"; };
|
||||
5B42B63F27876FDC00BB9B9F /* UserOverrideModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserOverrideModel.h; sourceTree = "<group>"; };
|
||||
5B42B64127877D6500BB9B9F /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "Source/zh-Hans.lproj/preferences.strings"; sourceTree = "<group>"; };
|
||||
|
@ -143,8 +144,6 @@
|
|||
5BDF2D052791DA6700838ADB /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
5BE798A32792E58A00337FF9 /* TooltipController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TooltipController.swift; sourceTree = "<group>"; };
|
||||
5BE798A62793280C00337FF9 /* NotifierController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotifierController.swift; sourceTree = "<group>"; };
|
||||
5BF4A6FB27844738007DC6E7 /* frmAboutWindow.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = frmAboutWindow.h; sourceTree = "<group>"; };
|
||||
5BF4A6FC27844738007DC6E7 /* frmAboutWindow.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = frmAboutWindow.m; sourceTree = "<group>"; };
|
||||
5BF4A70327844DD0007DC6E7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/frmAboutWindow.xib; sourceTree = "<group>"; };
|
||||
5BF4A70527844DD2007DC6E7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/frmAboutWindow.strings; sourceTree = "<group>"; };
|
||||
5BF4A70727844DD3007DC6E7 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/frmAboutWindow.strings"; sourceTree = "<group>"; };
|
||||
|
@ -362,8 +361,6 @@
|
|||
6A0D4F1215FC0EB100ABF4B3 /* Engine */,
|
||||
6ACA41E715FC1D9000935EF6 /* Installer */,
|
||||
6A0D4F4715FC0EB900ABF4B3 /* Resources */,
|
||||
5BF4A6FB27844738007DC6E7 /* frmAboutWindow.h */,
|
||||
5BF4A6FC27844738007DC6E7 /* frmAboutWindow.m */,
|
||||
6A0D4EC615FC0D6400ABF4B3 /* InputMethodController.h */,
|
||||
6A0D4EC715FC0D6400ABF4B3 /* InputMethodController.mm */,
|
||||
5B5F4F91279294A300922DC2 /* LanguageModelManager.h */,
|
||||
|
@ -371,6 +368,7 @@
|
|||
6A0D4EC815FC0D6400ABF4B3 /* main.swift */,
|
||||
6A0D4EF615FC0DA600ABF4B3 /* vChewing-Prefix.pch */,
|
||||
5BDF2D052791DA6700838ADB /* AppDelegate.swift */,
|
||||
5B217127279BB22700F91A2B /* frmAboutWindow.swift */,
|
||||
5BDF2CFD2791BE4400838ADB /* InputSourceHelper.swift */,
|
||||
5BDF2D022791C71200838ADB /* NonModalAlertWindowController.swift */,
|
||||
D427A9C025ED28CC005D43E0 /* OpenCCBridge.swift */,
|
||||
|
@ -704,7 +702,6 @@
|
|||
5B5F4F93279294A300922DC2 /* LanguageModelManager.mm in Sources */,
|
||||
6A0D4ED215FC0D6400ABF4B3 /* InputMethodController.mm in Sources */,
|
||||
6A0D4ED315FC0D6400ABF4B3 /* main.swift in Sources */,
|
||||
5BF4A6FE27844738007DC6E7 /* frmAboutWindow.m in Sources */,
|
||||
5B5F4F972792A4EA00922DC2 /* UserPhrasesLM.cpp in Sources */,
|
||||
5BC2D2882793B434002C0BEC /* KeyValueBlobReader.cpp in Sources */,
|
||||
5B5F4F8E27928F9300922DC2 /* vChewingLM.cpp in Sources */,
|
||||
|
@ -719,6 +716,7 @@
|
|||
6A0421A815FEF3F50061ED63 /* FastLM.cpp in Sources */,
|
||||
5BDF2D012791C03B00838ADB /* PreferencesWindowController.swift in Sources */,
|
||||
5BC2D28D2793B98F002C0BEC /* PreferencesModule.swift in Sources */,
|
||||
5B217128279BB22700F91A2B /* frmAboutWindow.swift in Sources */,
|
||||
5BD13F482794F0A6000E429F /* PhraseReplacementMap.cpp in Sources */,
|
||||
5BC3EE1C278FC48C00F5E44C /* VTCandidateController.swift in Sources */,
|
||||
5BDF2D032791C71200838ADB /* NonModalAlertWindowController.swift in Sources */,
|
||||
|
|
Loading…
Reference in New Issue