diff --git a/Easydict/App/AppDelegate.h b/Easydict/App/AppDelegate.h index 2ecaff2c6..d604f4d1b 100644 --- a/Easydict/App/AppDelegate.h +++ b/Easydict/App/AppDelegate.h @@ -7,7 +7,10 @@ // #import +#import @interface AppDelegate : NSObject +@property (weak) IBOutlet SPUStandardUpdaterController *updaterController; + @end diff --git a/Easydict/App/Base.lproj/Main.storyboard b/Easydict/App/Base.lproj/Main.storyboard index 048f44d6e..89ff713f9 100644 --- a/Easydict/App/Base.lproj/Main.storyboard +++ b/Easydict/App/Base.lproj/Main.storyboard @@ -706,8 +706,17 @@ DQ - + + + + + + + + + + @@ -727,11 +736,6 @@ DQ - - - - - @@ -784,7 +788,7 @@ DQ - + diff --git a/Easydict/Feature/Configuration/EZConfiguration.m b/Easydict/Feature/Configuration/EZConfiguration.m index 6db6d1b46..be94bd899 100644 --- a/Easydict/Feature/Configuration/EZConfiguration.m +++ b/Easydict/Feature/Configuration/EZConfiguration.m @@ -15,6 +15,7 @@ #import "EZScriptExecutor.h" #import "EZLog.h" #import "EZLanguageManager.h" +#import "AppDelegate.h" static NSString *const kEasydictHelperBundleId = @"com.izual.EasydictHelper"; @@ -55,6 +56,12 @@ static NSString *const kClearInputKey = @"EZConfiguration_kClearInputKey"; +@interface EZConfiguration () + +@property (nonatomic, strong) AppDelegate *appDelegate; + +@end + @implementation EZConfiguration static EZConfiguration *_instance; @@ -78,6 +85,8 @@ + (instancetype)allocWithZone:(struct _NSZone *)zone { } - (void)setup { + self.appDelegate = (AppDelegate *)[NSApp delegate]; + EZLanguage defaultFirstLanguage = [EZLanguageManager.shared systemPreferredTwoLanguages][0]; self.firstLanguage = [NSUserDefaults mm_readString:kFirstLanguageKey defaultValue:defaultFirstLanguage]; EZLanguage defaultSecondLanguage = [EZLanguageManager.shared systemPreferredTwoLanguages][1]; @@ -123,7 +132,7 @@ - (BOOL)launchAtStartup { } - (BOOL)automaticallyChecksForUpdates { - return [SUUpdater sharedUpdater].automaticallyChecksForUpdates; + return self.appDelegate.updaterController.updater.automaticallyChecksForUpdates; } #pragma mark - setter @@ -210,7 +219,7 @@ - (void)setLaunchAtStartup:(BOOL)launchAtStartup { - (void)setAutomaticallyChecksForUpdates:(BOOL)automaticallyChecksForUpdates { [NSUserDefaults mm_write:@(automaticallyChecksForUpdates) forKey:kAutomaticallyChecksForUpdatesKey]; - [[SUUpdater sharedUpdater] setAutomaticallyChecksForUpdates:automaticallyChecksForUpdates]; + self.appDelegate.updaterController.updater.automaticallyChecksForUpdates = automaticallyChecksForUpdates; [self logSettings:@{@"automatically_checks_for_updates" : @(automaticallyChecksForUpdates)}]; } diff --git a/appcast.xml b/appcast.xml index 27d6d2f20..fa6efcbee 100755 --- a/appcast.xml +++ b/appcast.xml @@ -3,6 +3,16 @@ Easydict + + 2.4.0 + Sun, 10 Dec 2023 19:30:00 +0800 + 29 + 2.4.0 + 11.0 + https://github.com/tisfeng/easydict/releases/tag/2.3.0 + + + 2.3.0 Sun, 10 Dec 2023 19:30:00 +0800