SantaGUI: Ensure configuration is loaded before first message arrives, let window be moved, close window properly when opening event URL

This commit is contained in:
Russell Hancox
2015-03-30 18:45:06 -04:00
parent cfb38068f8
commit aef3d57dcf
2 changed files with 6 additions and 3 deletions

View File

@@ -15,6 +15,7 @@
#import "SNTAppDelegate.h"
#import "SNTAboutWindowController.h"
#import "SNTConfigurator.h"
#import "SNTNotificationManager.h"
#import "SNTXPCConnection.h"
@@ -44,6 +45,9 @@
object:nil];
[self createConnection];
// Load configuration from disk ready for first message.
(void)[SNTConfigurator configurator];
}
- (BOOL)applicationShouldHandleReopen:(NSApplication *)sender hasVisibleWindows:(BOOL)flag {

View File

@@ -35,7 +35,6 @@
- (void)loadWindow {
[super loadWindow];
[self.window setMovableByWindowBackground:NO];
[self.window setLevel:NSPopUpMenuWindowLevel];
[self.window center];
@@ -87,14 +86,14 @@
[formatStr stringByReplacingOccurrencesOfString:@"%machine_id%"
withString:[[SNTConfigurator configurator] machineID]];
[self closeWindow:sender];
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:formatStr]];
[self close];
}
#pragma mark Generated properties
+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key {
if (! [key isEqualToString:@"event"]) {
if (![key isEqualToString:@"event"]) {
return [NSSet setWithObject:@"event"];
} else {
return nil;