Skip to content

Commit

Permalink
fix: remove updaterController from Main.storyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
tisfeng committed Jan 26, 2024
1 parent 99009f9 commit e6f6bf9
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
1 change: 0 additions & 1 deletion Easydict/App/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

#import <Cocoa/Cocoa.h>
#import <Sparkle/SPUStandardUpdaterController.h>

@interface AppDelegate : NSObject <NSApplicationDelegate>

Expand Down
14 changes: 2 additions & 12 deletions Easydict/App/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -716,18 +716,8 @@ DQ
<outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/>
</connections>
</application>
<customObject id="Voe-Tx-rLC" customClass="AppDelegate">
<connections>
<outlet property="updaterController" destination="dTQ-Lg-1D6" id="ulf-mx-z8R"/>
</connections>
</customObject>
<customObject id="Voe-Tx-rLC" customClass="AppDelegate"/>
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
<customObject id="dTQ-Lg-1D6" customClass="SPUStandardUpdaterController">
<connections>
<outlet property="updaterDelegate" destination="Voe-Tx-rLC" id="3Ya-Y2-qiK"/>
<outlet property="userDriverDelegate" destination="Voe-Tx-rLC" id="pxF-ql-RTh"/>
</connections>
</customObject>
<customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
<customObject id="qM9-fT-Fym" customClass="EZMenuItemManager">
<connections>
Expand Down Expand Up @@ -799,7 +789,7 @@ DQ
<menuItem title="检查更新" id="GQ2-WA-9QB">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="checkForUpdates:" target="dTQ-Lg-1D6" id="ydL-Jy-6z2"/>
<action selector="checkForUpdateItem:" target="qM9-fT-Fym" id="m6i-mV-Hiy"/>
</connections>
</menuItem>
<menuItem title="帮助" id="ICB-w8-IqK">
Expand Down
4 changes: 4 additions & 0 deletions Easydict/Feature/Configuration/EZConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

NS_ASSUME_NONNULL_BEGIN

@class SPUStandardUpdaterController;

FOUNDATION_EXPORT NSString *const kHideMainWindowKey;
FOUNDATION_EXPORT NSString *const kLaunchAtStartupKey;
FOUNDATION_EXPORT NSString *const kHideMenuBarIconKey;
Expand Down Expand Up @@ -84,6 +86,8 @@ typedef NS_ENUM(NSUInteger, EZAppearenceType) {

@property (nonatomic, assign) EZAppearenceType appearance;

@property (nonatomic, strong, readonly) SPUStandardUpdaterController *updaterController;

+ (instancetype)shared;
+ (void)destroySharedInstance;

Expand Down
6 changes: 5 additions & 1 deletion Easydict/Feature/Configuration/EZConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
@interface EZConfiguration ()

@property (nonatomic, strong) AppDelegate *appDelegate;
@property (nonatomic, strong) SPUUpdater *updater;
@property (nonatomic, strong, readwrite) SPUUpdater *updater;

@end

Expand Down Expand Up @@ -150,6 +150,10 @@ - (SPUUpdater *)updater {
return GlobalContext.getUpdaterController.updater;
}

- (SPUStandardUpdaterController *)updaterController {
return GlobalContext.getUpdaterController;
}

#pragma mark - setter

- (void)setFirstLanguage:(EZLanguage)firstLanguage {
Expand Down
7 changes: 7 additions & 0 deletions Easydict/Feature/StatusItem/EZMenuItemManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#import "EZRightClickDetector.h"
#import "EZConfiguration.h"
#import "Easydict-Swift.h"
#import <Sparkle/SPUStandardUpdaterController.h>

@interface EZMenuItemManager () <NSMenuDelegate>

Expand Down Expand Up @@ -181,6 +182,12 @@ - (IBAction)settingAction:(NSMenuItem *)sender {
[EZPreferencesWindowController.shared show];
}

- (IBAction)checkForUpdateItem:(id)sender {
NSLog(@"checkForUpdate");

[EZConfiguration.shared.updaterController checkForUpdates:sender];
}

- (IBAction)feedbackAction:(NSMenuItem *)sender {
NSLog(@"反馈问题");
NSString *issueURL = [NSString stringWithFormat:@"%@/issues", EZGithubRepoEasydictURL];
Expand Down

0 comments on commit e6f6bf9

Please sign in to comment.