parent
77b622e7da
commit
9be64e0a48
|
@ -34,6 +34,7 @@
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
|
@class PreferencesWindowController;
|
||||||
@class UpdateNotificationController;
|
@class UpdateNotificationController;
|
||||||
|
|
||||||
@interface AppDelegate : NSObject <NSApplicationDelegate>
|
@interface AppDelegate : NSObject <NSApplicationDelegate>
|
||||||
|
@ -42,11 +43,13 @@
|
||||||
NSWindow *_window;
|
NSWindow *_window;
|
||||||
NSURLConnection *_updateCheckConnection;
|
NSURLConnection *_updateCheckConnection;
|
||||||
NSMutableData *_receivingData;
|
NSMutableData *_receivingData;
|
||||||
|
PreferencesWindowController *_preferencesWindowController;
|
||||||
UpdateNotificationController *_updateNotificationController;
|
UpdateNotificationController *_updateNotificationController;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)checkForUpdate;
|
- (void)checkForUpdate;
|
||||||
- (void)checkForUpdateForced:(BOOL)forced;
|
- (void)checkForUpdateForced:(BOOL)forced;
|
||||||
|
- (void)showPreferences;
|
||||||
|
|
||||||
@property (assign, nonatomic) IBOutlet NSWindow *window;
|
@property (assign, nonatomic) IBOutlet NSWindow *window;
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -52,6 +52,7 @@ static const NSTimeInterval kTimeoutInterval = 60.0;
|
||||||
|
|
||||||
- (void)dealloc
|
- (void)dealloc
|
||||||
{
|
{
|
||||||
|
[_preferencesWindowController release];
|
||||||
[_updateCheckConnection release];
|
[_updateCheckConnection release];
|
||||||
[_updateNotificationController release];
|
[_updateNotificationController release];
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
|
@ -122,6 +123,15 @@ static const NSTimeInterval kTimeoutInterval = 60.0;
|
||||||
[_updateCheckConnection start];
|
[_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
|
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
|
||||||
{
|
{
|
||||||
[_receivingData release];
|
[_receivingData release];
|
||||||
|
|
|
@ -1385,7 +1385,11 @@ public:
|
||||||
- (void)showPreferences:(id)sender
|
- (void)showPreferences:(id)sender
|
||||||
{
|
{
|
||||||
// show the preferences panel, and also make the IME app itself the focus
|
// show the preferences panel, and also make the IME app itself the focus
|
||||||
[super showPreferences:sender];
|
if ([IMKInputController instancesRespondToSelector:@selector(showPreferences:)]) {
|
||||||
|
[super showPreferences:sender];
|
||||||
|
} else {
|
||||||
|
[(AppDelegate *)[NSApp delegate] showPreferences];
|
||||||
|
}
|
||||||
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
|
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue