Skip to content

Commit

Permalink
Merge branch 'dev' into fullwidth_colon
Browse files Browse the repository at this point in the history
  • Loading branch information
tisfeng authored Feb 25, 2024
2 parents 6efb338 + 906fa7e commit c280bef
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 37 deletions.
4 changes: 0 additions & 4 deletions Easydict.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@
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 */; };
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 @@ -775,7 +774,6 @@
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>"; };
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 @@ -2140,7 +2138,6 @@
EA9943DD2B534BAE00EE7B97 /* Utility */,
EA3B81F72B52549B004C0E8B /* Configuration */,
27FE95262B3DC55F000AD654 /* EasydictApp.swift */,
27FE98042B3DCB09000AD654 /* NewAppManager.swift */,
27FE98062B3DD525000AD654 /* View */,
);
path = NewApp;
Expand Down Expand Up @@ -2972,7 +2969,6 @@
03BB2DE329F5772F00447EDD /* EZAudioButton.m in Sources */,
03262C2529EFE97B00EFECA0 /* NSViewController+EZWindow.m in Sources */,
03008B2729408BF50062B821 /* NSObject+EZDarkMode.m in Sources */,
27FE98052B3DCB09000AD654 /* NewAppManager.swift in Sources */,
0399116A292AA2EF00E1B06D /* EZLayoutManager.m in Sources */,
0320C5872B29F35700861B3D /* QueryServiceRecord.swift in Sources */,
9643D9422B6FE4AF000FBEA6 /* Shortcut+Bind.swift in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion Easydict/App/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
[EZLog setupCrashLogService];
[EZLog logAppInfo];

if (!EasydictNewAppManager.shared.enable) {
if (!Configuration.shared.enableBetaNewApp) {
[EZMenuItemManager.shared setup];
[EZShortcut setup];
} else {
Expand Down
6 changes: 3 additions & 3 deletions Easydict/App/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -533,13 +533,13 @@
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "[Beta] SwiftUI App mode"
"value" : "SwiftUI App mode:"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "[Beta] SwiftUI App模式"
"value" : "SwiftUI App模式"
}
}
}
Expand Down Expand Up @@ -1775,7 +1775,7 @@
},
"zh-Hans" : {
"stringUnit" : {
"state" : "needs_review",
"state" : "translated",
"value" : "反馈"
}
}
Expand Down
2 changes: 1 addition & 1 deletion Easydict/Feature/Configuration/Configuration.swift
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 !Configuration.shared.enableBetaNewApp {
hideMenuBarIcon(hidden: hideMenuBarIcon)
}

Expand Down
2 changes: 1 addition & 1 deletion Easydict/Feature/Configuration/EZConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ - (void)setHideMenuBarIcon:(BOOL)hideMenuBarIcon {

[NSUserDefaults mm_write:@(hideMenuBarIcon) forKey:kHideMenuBarIconKey];

if (!EasydictNewAppManager.shared.enable) {
if (!Configuration.shared.enableBetaNewApp) {
[self hideMenuBarIcon:hideMenuBarIcon];
}

Expand Down
9 changes: 8 additions & 1 deletion Easydict/NewApp/Configuration/Configuration+Defaults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,20 @@ extension Defaults.Keys {
static let clearInput = Key<Bool>("EZConfiguration_kClearInputKey", default: true)
static let keepPrevResultWhenEmpty = Key<Bool>("EZConfiguration_kKeepPrevResultKey", default: true)
static let selectQueryTextWhenWindowActivate = Key<Bool>("EZConfiguration_kSelectQueryTextWhenWindowActivate", default: false)
static let enableBetaNewApp = Key<Bool>("EZConfiguration_kEnableBetaNewAppKey", default: true)

static let enableBetaFeature = Key<Bool>("EZBetaFeatureKey", default: false)

static let appearanceType = Key<AppearenceType>("EZConfiguration_kApperanceKey", default: .followSystem)
static let fontSizeOptionIndex = Key<UInt>("EZConfiguration_kTranslationControllerFontKey", default: 0)
static let selectedMenuBarIcon = Key<MenuBarIconType>("EZConfiguration_kSelectedMenuBarIconKey", default: .square)

static var enableBetaNewApp: Key<Bool> {
if #available(macOS 13.0, *) {
Key("EZConfiguration_kEnableBetaNewAppKey", default: true)
} else {
Key("EZConfiguration_kEnableBetaNewAppKey", default: false)
}
}
}

extension Defaults.Keys {
Expand Down
2 changes: 1 addition & 1 deletion Easydict/NewApp/EasydictApp.swift
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 #available(macOS 13, *), NewAppManager.shared.enable {
if Configuration.shared.enableBetaNewApp {
EasydictApp.main()
} else {
_ = NSApplicationMain(CommandLine.argc, CommandLine.unsafeArgv)
Expand Down
25 changes: 0 additions & 25 deletions Easydict/NewApp/NewAppManager.swift

This file was deleted.

0 comments on commit c280bef

Please sign in to comment.