Skip to content

Commit

Permalink
refresh vagrant machines on wake from sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswayoub committed Nov 9, 2014
1 parent e580f27 commit 731aabc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Vagrant Manager/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showUpdateNotificationPreferenceChanged:) name:@"vagrant-manager.show-update-notification-preference-changed" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(bookmarksUpdated:) name:@"vagrant-manager.bookmarks-updated" object:nil];

//register for wake from sleep notification
[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(receivedWakeNotification:) name:NSWorkspaceDidWakeNotification object:NULL];

//create popup and status menu item
_nativeMenu = [[NativeMenu alloc] init];
_nativeMenu.delegate = self;
Expand All @@ -61,6 +64,10 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {

#pragma mark - Notification handlers

- (void)receivedWakeNotification:(NSNotification*)notification {
[self refreshVagrantMachines];
}

- (void)taskCompleted:(NSNotification*)notification {
[self refreshVagrantMachines];
}
Expand Down

0 comments on commit 731aabc

Please sign in to comment.