Skip to content

Commit

Permalink
fix bookmark re-name bug and add Manage Bookmarks to menu
Browse files Browse the repository at this point in the history
  • Loading branch information
amitailanciano committed Nov 2, 2014
1 parent 6171644 commit 32f4ce9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Vagrant Manager/ManageBookmarksWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ - (IBAction)cancelButtonClicked:(id)sender {
}

- (IBAction)saveButtonClicked:(id)sender {
[self.window makeFirstResponder:nil];

[[BookmarkManager sharedManager] clearBookmarks];
for(Bookmark *bookmark in bookmarks) {
[[BookmarkManager sharedManager] addBookmark:bookmark];
Expand Down
11 changes: 10 additions & 1 deletion Vagrant Manager/NativeMenu.m
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ - (id)init {

[_menu addItem:allMachinesMenuItem];

NSMenuItem *manageBookmarksMenuItem = [[NSMenuItem alloc] initWithTitle:@"Manage Bookmarks" action:@selector(manageBookmarksMenuItemClicked:) keyEquivalent:@""];
manageBookmarksMenuItem.target = self;
[_menu addItem:manageBookmarksMenuItem];

NSMenuItem *preferencesMenuItem = [[NSMenuItem alloc] initWithTitle:@"Preferences" action:@selector(preferencesMenuItemClicked:) keyEquivalent:@""];
preferencesMenuItem.target = self;
[_menu addItem:preferencesMenuItem];
Expand Down Expand Up @@ -297,6 +301,12 @@ - (void)refreshMenuItemClicked:(id)sender {
[[Util getApp] refreshVagrantMachines];
}

- (void)manageBookmarksMenuItemClicked:(id)sender {
manageBookmarksWindow = [[ManageBookmarksWindow alloc] initWithWindowNibName:@"ManageBookmarksWindow"];
[NSApp activateIgnoringOtherApps:YES];
[manageBookmarksWindow showWindow:self];
}

- (void)preferencesMenuItemClicked:(id)sender {
preferencesWindow = [[PreferencesWindow alloc] initWithWindowNibName:@"PreferencesWindow"];
[NSApp activateIgnoringOtherApps:YES];
Expand Down Expand Up @@ -391,7 +401,6 @@ - (IBAction)allDestroyMenuItemClicked:(NSMenuItem*)sender {
}
}


#pragma mark - Misc

- (void)performAction:(NSString*)action withInstance:(VagrantInstance*)instance {
Expand Down

0 comments on commit 32f4ce9

Please sign in to comment.