Skip to content

Commit

Permalink
list all profiles in the new tab/window menu
Browse files Browse the repository at this point in the history
  • Loading branch information
felixse committed Oct 30, 2020
1 parent 6c7ea3b commit 8d2b696
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions FluentTerminal.App.ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,15 @@ private void OnShellProfileDeleted(ShellProfileDeletedMessage message)
_keyboardCommandService.DeregisterCommandHandler(message.ProfileId.ToString());

UpdateDefaultShellProfile();

CreateMenuViewModel();
}

private void OnShellProfileChanged(ShellProfileChangedMessage message)
{
UpdateDefaultShellProfile();

CreateMenuViewModel();
}

private void OnShellProfileAdded(ShellProfileAddedMessage message)
Expand All @@ -189,6 +193,8 @@ private void OnShellProfileAdded(ShellProfileAddedMessage message)
async () => await AddProfileByGuidAsync(message.ShellProfile.Id));

UpdateDefaultShellProfile();

CreateMenuViewModel();
}

private void OnDefaultShellProfileChanged(DefaultShellProfileChangedMessage message)
Expand Down Expand Up @@ -776,6 +782,13 @@ private void FillCoreItems(ObservableCollection<MenuItemViewModelBase> items, Ne
}

items.Add(quickLaunchItem);

items.Add(new SeparatorMenuItemViewModel());

foreach (var profile in _settingsService.GetShellProfiles().Concat(_settingsService.GetSshProfiles()).OrderBy(x => x.Name))
{
items.Add(new MenuItemViewModel(profile.Name, new AsyncCommand(() => AddProfileAsync(profile, location))));
}
}

private ObservableCollection<MenuItemViewModel> GetRecentMenuItems() =>
Expand Down

0 comments on commit 8d2b696

Please sign in to comment.