Skip to content
This repository has been archived by the owner on Oct 18, 2022. It is now read-only.

Commit

Permalink
Update to Swift 4.2, add detection support for ibShadowedToolTip
Browse files Browse the repository at this point in the history
  • Loading branch information
lhc70000 committed Aug 21, 2018
1 parent 5f91d45 commit 4ea6071
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 12 deletions.
11 changes: 8 additions & 3 deletions iina-translation-utility.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,12 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0910;
LastUpgradeCheck = 0910;
LastUpgradeCheck = 1000;
ORGANIZATIONNAME = "Collider LI";
TargetAttributes = {
84FF60811F9DBD1A001A3A93 = {
CreatedOnToolsVersion = 9.1;
LastSwiftMigration = 1000;
ProvisioningStyle = Automatic;
SystemCapabilities = {
com.apple.Sandbox = {
Expand Down Expand Up @@ -200,13 +201,15 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -257,13 +260,15 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -306,7 +311,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.colliderli.iina-translation-utility";
PRODUCT_NAME = "IINA Translation Utility";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -324,7 +329,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.colliderli.iina-translation-utility";
PRODUCT_NAME = "IINA Translation Utility";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0920"
LastUpgradeVersion = "1000"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
Expand All @@ -46,7 +45,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
4 changes: 2 additions & 2 deletions iina-translation-utility/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.1.2</string>
<string>0.1.4</string>
<key>CFBundleVersion</key>
<string>3</string>
<string>5</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
Expand Down
8 changes: 4 additions & 4 deletions iina-translation-utility/MainWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fileprivate extension NSUserInterfaceItemIdentifier {
class MainWindowController: NSWindowController {

override var windowNibName: NSNib.Name {
return NSNib.Name("MainWindowController")
return "MainWindowController"
}

@IBOutlet weak var languagePopupButton: NSPopUpButton!
Expand Down Expand Up @@ -107,11 +107,11 @@ class MainWindowController: NSWindowController {
guard let selectedFile = selectedFile else { return }
selectedFile.checkForIssues(appendMissingValues: false)
if selectedFile.missingKeyCount == 0 {
fileStatusImage.image = NSImage(named: .statusAvailable)
fileStatusImage.image = NSImage(named: NSImage.statusAvailableName)
fileMessageTextField.stringValue = "No Issue."
fileNextIssueButton.isHidden = true
} else {
fileStatusImage.image = NSImage(named: .statusUnavailable)
fileStatusImage.image = NSImage(named: NSImage.statusUnavailableName)
fileMessageTextField.stringValue = "Translation missing detected for \(selectedFile.missingKeyCount) keys."
fileNextIssueButton.isHidden = false
}
Expand Down Expand Up @@ -304,7 +304,7 @@ extension MainWindowController: NSOutlineViewDelegate, NSOutlineViewDataSource {
let file = item as! LocalizableFile
v.textField?.stringValue = file.url.lastPathComponent
v.imageView?.image = NSWorkspace.shared.icon(forFile: file.url.path)
v.statusImageView.image = file.missingKeyCount == 0 ? NSImage(named: .statusAvailable) : NSImage(named: .statusUnavailable)
v.statusImageView.image = file.missingKeyCount == 0 ? NSImage(named: NSImage.statusAvailableName) : NSImage(named: NSImage.statusUnavailableName)
v.statusCountLabel.stringValue = "\(file.missingKeyCount)"
return v
}
Expand Down
3 changes: 3 additions & 0 deletions iina-translation-utility/XIBLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ extension XIBLoader: XMLParserDelegate {
if let placeholder = attributeDict["placeholderString"] {
addTitle(key: "\(id).placeholderString", value: placeholder, class: elementName)
}
if let toolTip = attributeDict["toolTip"] {
addTitle(key: "\(id).ibShadowedToolTip", value: toolTip, class: elementName)
}
parentId = id
parentElm = elementName
}
Expand Down

0 comments on commit 4ea6071

Please sign in to comment.