Skip to content

Commit

Permalink
[W][macos-10.15] - change Alamofire version. / add some icon | log. (#…
Browse files Browse the repository at this point in the history
…329)

* [W][macos-10.15] - change Alamofire version. / add some icon | log.

* perf: remove IDEWorkspaceChecks.plist

* perf: remove SF image method in macos-10.15

* [W][macos-10.15] - add icon.

* perf: remove unused toolbar_privacy image

---------

Co-authored-by: tisfeng <[email protected]>
  • Loading branch information
whoooami and tisfeng authored Jan 18, 2024
1 parent fbe5229 commit 45f2367
Show file tree
Hide file tree
Showing 45 changed files with 300 additions and 93 deletions.
8 changes: 4 additions & 4 deletions Easydict.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 55;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -2021,7 +2021,7 @@
};
};
buildConfigurationList = C99EEB132385796700FEE666 /* Build configuration list for PBXProject "Easydict" */;
compatibilityVersion = "Xcode 13.0";
compatibilityVersion = "Xcode 12.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
Expand Down Expand Up @@ -2775,8 +2775,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/Alamofire/Alamofire";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 5.8.1;
kind = exactVersion;
version = 5.2.2;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down
24 changes: 13 additions & 11 deletions Easydict.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"pins" : [
{
"identity" : "alamofire",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Alamofire/Alamofire",
"state" : {
"revision" : "3dc6a42c7727c49bf26508e29b0a0b35f9c7e1ad",
"version" : "5.8.1"
"object": {
"pins": [
{
"package": "Alamofire",
"repositoryURL": "https://github.com/Alamofire/Alamofire",
"state": {
"branch": null,
"revision": "becd9a729a37bdbef5bc39dc3c702b99f9e3d046",
"version": "5.2.2"
}
}
}
],
"version" : 2
]
},
"version": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "arrow_clockwise_circle.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "arrow.forward.square.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "camera-metering-spot_20.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "camera-metering-spot (1).png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "edit-camera.viewfinder.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "edit-camera.viewfinder-1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions Easydict/App/Assets.xcassets/dock.rectangle.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "dock.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions Easydict/App/Assets.xcassets/highlighter.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "select_40.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "select.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions Easydict/App/Assets.xcassets/keyboard.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "keyboard_20.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "keyboard (2).png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions Easydict/App/Assets.xcassets/pause.circle.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Pause.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"scale" : "2x"
},
{
"filename" : "Privacy.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Binary file not shown.
21 changes: 21 additions & 0 deletions Easydict/App/Assets.xcassets/stop.circle.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "stop circle.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "2.1勾.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ - (NSTableView *)tableView {
tableView.style = NSTableViewStylePlain;
} else {
// Fallback on earlier versions
[tableView setHeaderView:nil];
}

NSTableColumn *column = [[NSTableColumn alloc] initWithIdentifier:EZColumnId];
Expand Down
11 changes: 6 additions & 5 deletions Easydict/Feature/PerferenceWindow/EZPrivacyViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,12 @@ - (NSImage *)toolbarItemImage {
// privacyImage = [privacyImage imageWithTintColor:[NSColor mm_colorWithHexString:@"#1296DB"]];
// privacyImage = [privacyImage resizeToSize:CGSizeMake(14, 14)];

NSImage *privacyImage = [NSImage imageNamed:@"toolbar_privacy"];
privacyImage = [NSImage ez_imageWithSymbolName:@"hand.raised.square" size:CGSizeMake(18, 16)];
privacyImage = [privacyImage imageWithTintColor:[NSColor ez_imageTintBlueColor]];

return privacyImage;
// NSImage *privacyImage = [NSImage imageNamed:@"toolbar_privacy"];
// privacyImage = [NSImage ez_imageWithSymbolName:@"hand.raised.square" size:CGSizeMake(18, 16)];
// privacyImage = [privacyImage imageWithTintColor:[NSColor ez_imageTintBlueColor]];
//
// return privacyImage;
return [NSImage imageNamed:@"toolbar_privacy"];
}

- (BOOL)hasResizableWidth {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ - (NSTableView *)tableView {
tableView.style = NSTableViewStylePlain;
} else {
// Fallback on earlier versions
[tableView setHeaderView:nil];
}

NSTableColumn *column = [[NSTableColumn alloc] initWithIdentifier:EZColumnId];
Expand Down
2 changes: 1 addition & 1 deletion Easydict/Feature/Service/Apple/EZAppleService.m
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ - (void)ocrImage:(NSImage *)image
}

if (@available(macOS 13.0, *)) {
request.automaticallyDetectsLanguage = automaticallyDetectsLanguage;
// request.automaticallyDetectsLanguage = automaticallyDetectsLanguage;
}

if (![preferredLanguage isEqualToString:EZLanguageAuto]) {
Expand Down
16 changes: 8 additions & 8 deletions Easydict/Feature/Service/Caiyun/CaiyunService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ public final class CaiyunService: QueryService {
}
return orderedDict
}

override public func ocr(_: EZQueryModel) async throws -> EZOCRResult {
NSLog("Caiyun Translate does not support OCR")
throw QueryServiceError.notSupported
}
// override public func ocr(_: EZQueryModel) async throws -> EZOCRResult {
// NSLog("Caiyun Translate does not support OCR")
// throw QueryServiceError.notSupported
// }

private var apiEndPoint = "https://api.interpreter.caiyunai.com/v1/translator"

Expand All @@ -45,7 +45,7 @@ public final class CaiyunService: QueryService {
// easydict://writeKeyValue?EZCaiyunToken=
private var token: String {
let token = UserDefaults.standard.string(forKey: EZCaiyunToken)
if let token, !token.isEmpty {
if let token = token, !token.isEmpty {
return token
} else {
return CaiyunService.defaultTestToken
Expand Down Expand Up @@ -89,8 +89,8 @@ public final class CaiyunService: QueryService {
headers: headers)
.validate()
.responseDecodable(of: CaiyunResponse.self) { [weak self] response in
guard let self else { return }
let result = self.result
guard let me = self else { return }
let result = me.result
switch response.result {
case let .success(value):
result.from = from
Expand Down
2 changes: 1 addition & 1 deletion Easydict/Feature/Service/Model/EZServiceTypes.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ + (instancetype)allocWithZone:(struct _NSZone *)zone {
EZServiceTypeBing, [EZBingService class],
EZServiceTypeVolcano, [EZVolcanoTranslate class],
EZServiceTypeNiuTrans, [EZNiuTransTranslate class],
EZServiceTypeCaiyun, [EZCaiyunService class],
// EZServiceTypeCaiyun, [EZCaiyunService class],
nil];
return allServiceDict;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ NS_ASSUME_NONNULL_BEGIN

@interface NSImage (EZSymbolmage)

+ (NSImage *)ez_imageWithSymbolName:(NSString *)name;

+ (NSImage *)ez_imageWithSymbolName:(NSString *)name size:(CGSize)size;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ + (NSImage *)ez_imageWithSymbolName:(NSString *)name size:(CGSize)size {
}
} else {
// Fallback on earlier versions
NSLog(@"ez_imageWithSymbolName: %@", name);
image = [NSImage imageNamed:name];
}
image = [image resizeToSize:size];
Expand Down
Loading

0 comments on commit 45f2367

Please sign in to comment.