parent
77b622e7da
commit
9be64e0a48
|
@ -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
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue