New: open reporting window when clickin on a notification in xCodeCapp

This commit is contained in:
Alexandre Wilhelm
2014-04-21 17:30:12 -07:00
parent 14cb6d21a9
commit f14add2791
2 changed files with 13 additions and 2 deletions
+1 -1
View File
@@ -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;
+12 -1
View File
@@ -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