mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-30 23:43:37 +00:00
New: open reporting window when clickin on a notification in xCodeCapp
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
|
||||
@class XcodeCapp;
|
||||
|
||||
@interface AppController : NSObject <NSApplicationDelegate, NSMenuDelegate>
|
||||
@interface AppController : NSObject <NSApplicationDelegate, NSMenuDelegate, NSUserNotificationCenterDelegate>
|
||||
|
||||
@property (strong) IBOutlet NSMenu *statusMenu;
|
||||
@property (unsafe_unretained) IBOutlet NSMenuItem *menuItemHistory;
|
||||
|
||||
@@ -111,7 +111,10 @@ AppController *SharedAppControllerInstance = nil;
|
||||
[[NSApplication sharedApplication] terminate:self];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
NSUserNotificationCenter *center = [NSUserNotificationCenter defaultUserNotificationCenter];
|
||||
center.delegate = self;
|
||||
|
||||
// If we were opened from the command line, self.pathToOpenAtLaunch will be set.
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
@@ -527,4 +530,12 @@ AppController *SharedAppControllerInstance = nil;
|
||||
self.menuItemHistory.enabled = [projectHistory count] > 0;
|
||||
}
|
||||
|
||||
- (void)userNotificationCenter:(NSUserNotificationCenter *)center didActivateNotification:(NSUserNotification *)notification
|
||||
{
|
||||
if ([[self.xcc errorList] count])
|
||||
[self.xcc openErrorsPanel:self];
|
||||
|
||||
[center removeDeliveredNotification:notification];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user