mirror of
https://github.com/syncthing/syncthing-macos.git
synced 2026-06-16 12:04:33 +00:00
@@ -214,6 +214,12 @@
|
||||
|
||||
// TODO: need a more generic approach for opening windows
|
||||
- (IBAction)clickedPreferences:(NSMenuItem *)sender {
|
||||
if (_preferencesWindow != nil) {
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
[_preferencesWindow.window makeKeyAndOrderFront:self];
|
||||
return;
|
||||
}
|
||||
|
||||
_preferencesWindow = [[STPreferencesWindowController alloc] init];
|
||||
[_preferencesWindow showWindow:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
@@ -223,12 +229,18 @@
|
||||
}
|
||||
|
||||
- (IBAction)clickedAbout:(NSMenuItem *)sender {
|
||||
_aboutWindow = [[STAboutWindowController alloc] init];
|
||||
[_aboutWindow showWindow:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(aboutWillClose:)
|
||||
name:NSWindowWillCloseNotification
|
||||
object:[_aboutWindow window]];
|
||||
if (_aboutWindow != nil) {
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
[_aboutWindow.window makeKeyAndOrderFront:self];
|
||||
return;
|
||||
}
|
||||
|
||||
_aboutWindow = [[STAboutWindowController alloc] init];
|
||||
[_aboutWindow showWindow:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(aboutWillClose:)
|
||||
name:NSWindowWillCloseNotification
|
||||
object:[_aboutWindow window]];
|
||||
}
|
||||
|
||||
// TODO: need a more generic approach for closing windows
|
||||
|
||||
Reference in New Issue
Block a user