mirror of
https://github.com/google/santa.git
synced 2026-04-24 03:00:12 -04:00
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:
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user