修正在 macOS 10.13 beta 上無法叫出偏好設定的問題

修正根據請參考以下連結:
3241c7f688
This commit is contained in:
ovadmin 2017-09-05 12:05:50 +08:00 committed by Mengjuei
parent 77b622e7da
commit 9be64e0a48
3 changed files with 18 additions and 1 deletions

View File

@ -34,6 +34,7 @@
#import <Cocoa/Cocoa.h>
@class PreferencesWindowController;
@class UpdateNotificationController;
@interface AppDelegate : NSObject <NSApplicationDelegate>
@ -42,11 +43,13 @@
NSWindow *_window;
NSURLConnection *_updateCheckConnection;
NSMutableData *_receivingData;
PreferencesWindowController *_preferencesWindowController;
UpdateNotificationController *_updateNotificationController;
}
- (void)checkForUpdate;
- (void)checkForUpdateForced:(BOOL)forced;
- (void)showPreferences;
@property (assign, nonatomic) IBOutlet NSWindow *window;
@end

View File

@ -52,6 +52,7 @@ static const NSTimeInterval kTimeoutInterval = 60.0;
- (void)dealloc
{
[_preferencesWindowController release];
[_updateCheckConnection release];
[_updateNotificationController release];
[super dealloc];
@ -122,6 +123,15 @@ static const NSTimeInterval kTimeoutInterval = 60.0;
[_updateCheckConnection start];
}
- (void)showPreferences
{
if (!_preferencesWindowController) {
_preferencesWindowController = [[PreferencesWindowController alloc] initWithWindowNibName:@"preferences"];
}
[[_preferencesWindowController window] center];
[[_preferencesWindowController window] orderFront:self];
}
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
{
[_receivingData release];

View File

@ -1385,7 +1385,11 @@ public:
- (void)showPreferences:(id)sender
{
// show the preferences panel, and also make the IME app itself the focus
if ([IMKInputController instancesRespondToSelector:@selector(showPreferences:)]) {
[super showPreferences:sender];
} else {
[(AppDelegate *)[NSApp delegate] showPreferences];
}
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
}