Skip to content

Commit

Permalink
Merge branch 'dev' into service_api_key_config
Browse files Browse the repository at this point in the history
  • Loading branch information
phlpsong committed Feb 4, 2024
2 parents 9d0ca65 + 4b2cfb1 commit 0a3b126
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
17 changes: 17 additions & 0 deletions Easydict.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@
0AC8A8452B6A4D97006DA5CC /* ServiceConfigurationCells.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AC8A8442B6A4D97006DA5CC /* ServiceConfigurationCells.swift */; };
0AC8A8472B6A4E3F006DA5CC /* ServiceConfigurationSecretSectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AC8A8462B6A4E3F006DA5CC /* ServiceConfigurationSecretSectionView.swift */; };
0AC8A84B2B6A629D006DA5CC /* GeminiService+ConfigurableService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AC8A84A2B6A629D006DA5CC /* GeminiService+ConfigurableService.swift */; };
0AC8A84F2B6DFDD4006DA5CC /* SettingsAccess in Frameworks */ = {isa = PBXBuildFile; productRef = 0AC8A84E2B6DFDD4006DA5CC /* SettingsAccess */; };
17BCAEF72B0DFF9000A7D372 /* EZNiuTransTranslateResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 17BCAEF52B0DFF9000A7D372 /* EZNiuTransTranslateResponse.m */; };
17BCAEF82B0DFF9000A7D372 /* EZNiuTransTranslate.m in Sources */ = {isa = PBXBuildFile; fileRef = 17BCAEF62B0DFF9000A7D372 /* EZNiuTransTranslate.m */; };
2721E4D02AFE920700A059AC /* Alamofire in Frameworks */ = {isa = PBXBuildFile; productRef = 2721E4CF2AFE920700A059AC /* Alamofire */; };
Expand Down Expand Up @@ -848,6 +849,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
0AC8A84F2B6DFDD4006DA5CC /* SettingsAccess in Frameworks */,
03022F192B3591AE00B63209 /* GoogleGenerativeAI in Frameworks */,
2721E4D02AFE920700A059AC /* Alamofire in Frameworks */,
03022F1F2B36CF3100B63209 /* SwiftShell in Frameworks */,
Expand Down Expand Up @@ -2496,6 +2498,7 @@
EA3B81FB2B52555C004C0E8B /* Defaults */,
967712E92B5B913600105E0F /* KeyHolder */,
03022F182B3591AE00B63209 /* GoogleGenerativeAI */,
0AC8A84E2B6DFDD4006DA5CC /* SettingsAccess */,
);
productName = Bob;
productReference = C99EEB182385796700FEE666 /* Easydict-debug.app */;
Expand Down Expand Up @@ -2557,6 +2560,7 @@
EA3B81FA2B52555C004C0E8B /* XCRemoteSwiftPackageReference "Defaults" */,
967712E82B5B913600105E0F /* XCRemoteSwiftPackageReference "KeyHolder" */,
03022F172B3591AE00B63209 /* XCRemoteSwiftPackageReference "generative-ai-swift" */,
0AC8A84D2B6DFDD4006DA5CC /* XCRemoteSwiftPackageReference "SettingsAccess" */,
);
productRefGroup = C99EEB192385796700FEE666 /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -3556,6 +3560,14 @@
minimumVersion = 1.8.0;
};
};
0AC8A84D2B6DFDD4006DA5CC /* XCRemoteSwiftPackageReference "SettingsAccess" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/orchetect/SettingsAccess";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.4.0;
};
};
2721E4CE2AFE920700A059AC /* XCRemoteSwiftPackageReference "Alamofire" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/Alamofire/Alamofire.git";
Expand Down Expand Up @@ -3658,6 +3670,11 @@
package = 03FD68B92B1DC59600FD388E /* XCRemoteSwiftPackageReference "CryptoSwift" */;
productName = CryptoSwift;
};
0AC8A84E2B6DFDD4006DA5CC /* SettingsAccess */ = {
isa = XCSwiftPackageProductDependency;
package = 0AC8A84D2B6DFDD4006DA5CC /* XCRemoteSwiftPackageReference "SettingsAccess" */;
productName = SettingsAccess;
};
2721E4CF2AFE920700A059AC /* Alamofire */ = {
isa = XCSwiftPackageProductDependency;
package = 2721E4CE2AFE920700A059AC /* XCRemoteSwiftPackageReference "Alamofire" */;
Expand Down
9 changes: 9 additions & 0 deletions Easydict.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,15 @@
"version" : "2.4.0"
}
},
{
"identity" : "settingsaccess",
"kind" : "remoteSourceControl",
"location" : "https://github.com/orchetect/SettingsAccess",
"state" : {
"revision" : "0fd73c8b5892e88acb13adb7f36a4ba9293a0061",
"version" : "1.4.0"
}
},
{
"identity" : "snapkit",
"kind" : "remoteSourceControl",
Expand Down
11 changes: 10 additions & 1 deletion Easydict/NewApp/View/MenuItemView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Copyright © 2023 izual. All rights reserved.
//

import SettingsAccess
import Sparkle
import SwiftUI
import ZipArchive
Expand Down Expand Up @@ -92,10 +93,18 @@ struct MenuItemView: View {
@ViewBuilder
private var settingItem: some View {
if #available(macOS 14.0, *) {
SettingsLink()
SettingsLink {
Text("Settings...")
} preAction: {
NSLog("打开设置")
NSApp.activate(ignoringOtherApps: true)
} postAction: {
// nothing to do
}
} else {
Button("Settings...") {
NSLog("打开设置")
NSApp.activate(ignoringOtherApps: true)
NSApplication.shared.sendAction(Selector(("showSettingsWindow:")), to: nil, from: nil)
}
}
Expand Down

0 comments on commit 0a3b126

Please sign in to comment.