This repository was archived by the owner on Feb 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathXGAAppDelegate.m
More file actions
55 lines (45 loc) · 1.62 KB
/
XGAAppDelegate.m
File metadata and controls
55 lines (45 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**
@file XGAAppDelegate.m
@package xcode-github-app
@brief The xcode-github-app app delegate.
@author Edward Smith
@date March 2018
@copyright Copyright © 2018 Branch. All rights reserved.
*/
#import "XGAAppDelegate.h"
#import "XGALogViewController.h"
#import "XGAStatusViewController.h"
#import "XGAPreferencesViewController.h"
#import <XcodeGitHub/XcodeGitHub.h>
@interface XGAAppDelegate () <NSWindowDelegate>
@property (nonatomic, strong) IBOutlet XGALogViewController*logController;
@property (nonatomic, strong) IBOutlet XGAStatusViewController*statusController;
@property (nonatomic, strong) IBOutlet XGAPreferencesViewController*preferencesController;
@end
@implementation XGAAppDelegate
- (void)awakeFromNib {
if (!self.logController) {
//BNCLog(@"XcodeGitHub library version %@.", XGVersion());
[BNCNetworkService shared].allowAnySSLCert = YES;
self.logController = [XGALogViewController new];
self.statusController = [XGAStatusViewController new];
}
}
- (IBAction)showStatusWindow:(id)sender {
[self.statusController.window makeKeyAndOrderFront:self];
}
- (IBAction)showLogWindow:(id)sender {
[self.logController.window makeKeyAndOrderFront:self];
}
- (IBAction)showPreferences:(id)sender {
if (!self.preferencesController) {
self.preferencesController = [XGAPreferencesViewController new];
}
self.preferencesController.window.delegate = self;
[self.preferencesController.window makeKeyAndOrderFront:self];
}
- (BOOL)windowShouldClose:(NSWindow*)window {
self.preferencesController = nil;
return YES;
}
@end