Skip to content

Commit

Permalink
perf: adjust group file structure, move Swift file to SwiftApp
Browse files Browse the repository at this point in the history
  • Loading branch information
tisfeng committed Feb 15, 2024
1 parent 9c94543 commit 1f186df
Show file tree
Hide file tree
Showing 64 changed files with 36 additions and 20 deletions.
46 changes: 31 additions & 15 deletions Easydict.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@
278322622B0FB8EF0026644C /* CaiyunTranslateType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 278322612B0FB8EF0026644C /* CaiyunTranslateType.swift */; };
278540342B3DE04F004E9488 /* GeneralTab.swift in Sources */ = {isa = PBXBuildFile; fileRef = 278540332B3DE04F004E9488 /* GeneralTab.swift */; };
27FE95272B3DC55F000AD654 /* EasydictApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27FE95262B3DC55F000AD654 /* EasydictApp.swift */; };
27FE98052B3DCB09000AD654 /* NewAppManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27FE98042B3DCB09000AD654 /* NewAppManager.swift */; };
27FE98052B3DCB09000AD654 /* SwiftUIAppManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27FE98042B3DCB09000AD654 /* SwiftUIAppManager.swift */; };
27FE98092B3DD536000AD654 /* SettingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27FE98082B3DD536000AD654 /* SettingView.swift */; };
27FE980B2B3DD5D1000AD654 /* MenuItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27FE980A2B3DD5D1000AD654 /* MenuItemView.swift */; };
6220AD5B2A82812300BBFB52 /* EZBingService.m in Sources */ = {isa = PBXBuildFile; fileRef = 6220AD5A2A82812300BBFB52 /* EZBingService.m */; };
Expand Down Expand Up @@ -780,7 +780,7 @@
27B791A02AEC3A5C006E07C6 /* Easydict-debug.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = "Easydict-debug.entitlements"; sourceTree = "<group>"; };
27FE95262B3DC55F000AD654 /* EasydictApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EasydictApp.swift; sourceTree = "<group>"; };
27FE95282B3DC666000AD654 /* entry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = entry.h; sourceTree = "<group>"; };
27FE98042B3DCB09000AD654 /* NewAppManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewAppManager.swift; sourceTree = "<group>"; };
27FE98042B3DCB09000AD654 /* SwiftUIAppManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUIAppManager.swift; sourceTree = "<group>"; };
27FE98082B3DD536000AD654 /* SettingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingView.swift; sourceTree = "<group>"; };
27FE980A2B3DD5D1000AD654 /* MenuItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuItemView.swift; sourceTree = "<group>"; };
357E179B303EF855EF4561FB /* Pods-EasydictTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-EasydictTests.release.xcconfig"; path = "Target Support Files/Pods-EasydictTests/Pods-EasydictTests.release.xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1340,7 +1340,7 @@
03B0221829231FA6001C7E63 /* Easydict */ = {
isa = PBXGroup;
children = (
27FE98032B3DCA9F000AD654 /* NewApp */,
27FE98032B3DCA9F000AD654 /* SwiftApp */,
03B0222429231FA6001C7E63 /* Feature */,
0376AB59294F5EEC00E2E2A4 /* App */,
);
Expand Down Expand Up @@ -1384,21 +1384,14 @@
03542A572937CC3200C34C33 /* EZConfiguration.m */,
03D8A65A2A433B4100D9A968 /* EZConfiguration+EZUserData.h */,
03D8A65B2A433B4100D9A968 /* EZConfiguration+EZUserData.m */,
DC46DF7F2B4417B900DEAE3E /* Configuration.swift */,
DCF176F12B57CED700CA6026 /* Configuration+UserData.swift */,
DC6D9C882B3969510055EFFC /* Appearance.swift */,
);
path = Configuration;
sourceTree = "<group>";
};
03B0222B29231FA6001C7E63 /* Service */ = {
isa = PBXGroup;
children = (
62E2BF462B4082BA00E42D38 /* Ali */,
C415C0AB2B450C4500A9D231 /* Gemini */,
17BCAEF22B0DFF9000A7D372 /* Niutrans */,
2746AEBF2AF95040005FE0A1 /* Caiyun */,
C4DD01E72B12B3B00025EE8E /* Tencent */,
6220AD582A8280E800BBFB52 /* Bing */,
0399C6A929A8608000B4AFCC /* OpenAI */,
03F14A382956011400CB7379 /* Volcano */,
Expand Down Expand Up @@ -2087,6 +2080,26 @@
path = Volcano;
sourceTree = "<group>";
};
03FC57C32B7DCAE400E036F3 /* Service */ = {
isa = PBXGroup;
children = (
62E2BF462B4082BA00E42D38 /* Ali */,
2746AEBF2AF95040005FE0A1 /* Caiyun */,
C4DD01E72B12B3B00025EE8E /* Tencent */,
C415C0AB2B450C4500A9D231 /* Gemini */,
);
path = Service;
sourceTree = "<group>";
};
03FC57C42B7DCB8300E036F3 /* App */ = {
isa = PBXGroup;
children = (
27FE95262B3DC55F000AD654 /* EasydictApp.swift */,
27FE98042B3DCB09000AD654 /* SwiftUIAppManager.swift */,
);
path = App;
sourceTree = "<group>";
};
03FD68BC2B1E14B500FD388E /* String */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -2140,18 +2153,18 @@
path = Caiyun;
sourceTree = "<group>";
};
27FE98032B3DCA9F000AD654 /* NewApp */ = {
27FE98032B3DCA9F000AD654 /* SwiftApp */ = {
isa = PBXGroup;
children = (
03FC57C42B7DCB8300E036F3 /* App */,
03FC57C32B7DCAE400E036F3 /* Service */,
967712EB2B5B93E200105E0F /* Feature */,
EA9943E12B534C2900EE7B97 /* Model */,
EA9943DD2B534BAE00EE7B97 /* Utility */,
EA3B81F72B52549B004C0E8B /* Configuration */,
27FE95262B3DC55F000AD654 /* EasydictApp.swift */,
27FE98042B3DCB09000AD654 /* NewAppManager.swift */,
27FE98062B3DD525000AD654 /* View */,
);
path = NewApp;
path = SwiftApp;
sourceTree = "<group>";
};
27FE98062B3DD525000AD654 /* View */ = {
Expand Down Expand Up @@ -2373,6 +2386,8 @@
EA3B81F72B52549B004C0E8B /* Configuration */ = {
isa = PBXGroup;
children = (
DC46DF7F2B4417B900DEAE3E /* Configuration.swift */,
DCF176F12B57CED700CA6026 /* Configuration+UserData.swift */,
EA3B81F82B5254AA004C0E8B /* Configuration+Defaults.swift */,
);
path = Configuration;
Expand All @@ -2382,6 +2397,7 @@
isa = PBXGroup;
children = (
EAE3D34F2B62E9DE001EE3E3 /* GlobalContext.swift */,
DC6D9C882B3969510055EFFC /* Appearance.swift */,
EAED41ED2B54B1390005FE0A /* Protocol */,
EA9943E62B534D7C00EE7B97 /* Extensions */,
);
Expand Down Expand Up @@ -2983,7 +2999,7 @@
03BB2DE329F5772F00447EDD /* EZAudioButton.m in Sources */,
03262C2529EFE97B00EFECA0 /* NSViewController+EZWindow.m in Sources */,
03008B2729408BF50062B821 /* NSObject+EZDarkMode.m in Sources */,
27FE98052B3DCB09000AD654 /* NewAppManager.swift in Sources */,
27FE98052B3DCB09000AD654 /* SwiftUIAppManager.swift in Sources */,
0399116A292AA2EF00E1B06D /* EZLayoutManager.m in Sources */,
0320C5872B29F35700861B3D /* QueryServiceRecord.swift in Sources */,
9643D9422B6FE4AF000FBEA6 /* Shortcut+Bind.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import SwiftUI
enum EasydictCmpatibilityEntry {
static func main() {
parseArmguments()
if NewAppManager.shared.enable {
if SwiftUIAppManager.shared.enable {
EasydictApp.main()
} else {
_ = NSApplicationMain(CommandLine.argc, CommandLine.unsafeArgv)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// NewAppManager.swift
// SwiftUIAppManager.swift
// Easydict
//
// Created by Kyle on 2023/12/28.
Expand All @@ -9,9 +9,9 @@
import Foundation

@objc(EasydictNewAppManager)
public final class NewAppManager: NSObject {
public final class SwiftUIAppManager: NSObject {
@objc
public static let shared = NewAppManager()
public static let shared = SwiftUIAppManager()

override private init() { super.init() }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ private extension Configuration {
}

func didSetHideMenuBarIcon() {
if !NewAppManager.shared.enable {
if !SwiftUIAppManager.shared.enable {
hideMenuBarIcon(hidden: hideMenuBarIcon)
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 1f186df

Please sign in to comment.