blob: a425af2376c5ffa9efb117a2f82d5d113cd2ed1f [file] [log] [blame]
Alexander Afanasyev88f0b3a2013-09-24 23:52:08 -07001/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
2/*
3 * @copyright See LICENCE for copyright and license information.
4 *
5 * @author Alexander Afanasyev <alexander.afanasyev@ucla.edu>
6 * @author Ilya Moiseenko <iliamo@ucla.edu>
7 */
8
9#import "menu-delegate.h"
10
11@implementation MenuDelegate
12
13- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
14{
15 // Insert code here to initialize your application
16}
17
Alexander Afanasyev88f0b3a2013-09-24 23:52:08 -070018-(void)awakeFromNib
19{
20 statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];
Alexander Afanasyev88f0b3a2013-09-24 23:52:08 -070021 [statusItem setMenu:statusMenu];
Ilya Moiseenko350b9b52013-09-25 16:38:41 -070022 [statusItem setToolTip:@"NDN Control Center"];
23 [statusItem setEnabled:YES];
24 //[statusItem setTitle:@"Status"];
Alexander Afanasyev88f0b3a2013-09-24 23:52:08 -070025 [statusItem setHighlightMode:YES];
Ilya Moiseenko350b9b52013-09-25 16:38:41 -070026 //[statusItem setTarget:self];
27
28 NSBundle *bundle = [NSBundle bundleForClass:[self class]];
29 NSString *path = [bundle pathForResource:@"IconDisconnected" ofType:@"png"];
30 menuIcon = [[NSImage alloc] initWithContentsOfFile:path];
31 [statusItem setTitle:@""];
32 [statusItem setImage:menuIcon];
33}
34
35-(IBAction)openDaemonStatus:(id)sender
36{
37 [statusPopover showRelativeToRect:[[daemonStatus view] bounds]
38 ofView:[daemonStatus view]
39 preferredEdge:NSMinXEdge];
40
41 //[statusPopover showRelativeToRect:[sender bounds] ofView:sender preferredEdge:NSMinYEdge];
42}
43
44-(IBAction)openRoutingStatusPage:(id)sender
45{
46 NSURL *pageURL = [NSURL URLWithString:@"http://netlab.cs.memphis.edu/script/htm/status.htm"];
47
48 [[NSWorkspace sharedWorkspace] openURL: pageURL];
49}
50
51-(IBAction)openTrafficMapPage:(id)sender
52{
53
54 NSURL *pageURL = [NSURL URLWithString:@"http://ndnmap.arl.wustl.edu"];
55
56 [[NSWorkspace sharedWorkspace] openURL: pageURL];
Alexander Afanasyev88f0b3a2013-09-24 23:52:08 -070057}
58
59@end