diff --git a/FluentTerminal.App.Test/Services/DialogServiceTests.cs b/FluentTerminal.App.Test/Services/DialogServiceTests.cs index 0c4e713..6731319 100644 --- a/FluentTerminal.App.Test/Services/DialogServiceTests.cs +++ b/FluentTerminal.App.Test/Services/DialogServiceTests.cs @@ -6,6 +6,7 @@ using FluentAssertions; using FluentTerminal.App.Services; using FluentTerminal.App.Services.Implementation; using Microsoft.VisualStudio.TestTools.UnitTesting; +using Moq; namespace FluentTerminal.App.Test.Services { @@ -26,9 +27,9 @@ namespace FluentTerminal.App.Test.Services var title = string.Empty; var content = _fixture.Create(); var buttons = _fixture.CreateMany(2); - var dialogService = new DialogService(); + var dialogService = new DialogService(Mock.Of()); - Func> invoke = () => dialogService.ShowDialogAsnyc(title, content, buttons.ElementAt(0), buttons.ElementAt(1)); + Func> invoke = () => dialogService.ShowMessageDialogAsnyc(title, content, buttons.ElementAt(0), buttons.ElementAt(1)); invoke.Should().Throw().And.ParamName.Should().Be("title"); } @@ -39,9 +40,9 @@ namespace FluentTerminal.App.Test.Services var title = _fixture.Create(); var content = string.Empty; var buttons = _fixture.CreateMany(2); - var dialogService = new DialogService(); + var dialogService = new DialogService(Mock.Of()); - Func> invoke = () => dialogService.ShowDialogAsnyc(title, content, buttons.ElementAt(0), buttons.ElementAt(1)); + Func> invoke = () => dialogService.ShowMessageDialogAsnyc(title, content, buttons.ElementAt(0), buttons.ElementAt(1)); invoke.Should().Throw().And.ParamName.Should().Be("content"); } @@ -51,9 +52,9 @@ namespace FluentTerminal.App.Test.Services { var title = _fixture.Create(); var content = _fixture.Create(); - var dialogService = new DialogService(); + var dialogService = new DialogService(Mock.Of()); - Func> invoke = () => dialogService.ShowDialogAsnyc(title, content); + Func> invoke = () => dialogService.ShowMessageDialogAsnyc(title, content); invoke.Should().Throw().And.ParamName.Should().Be("buttons"); } diff --git a/FluentTerminal.App/App.xaml.cs b/FluentTerminal.App/App.xaml.cs index 4ceb6d3..13ea9f3 100644 --- a/FluentTerminal.App/App.xaml.cs +++ b/FluentTerminal.App/App.xaml.cs @@ -85,7 +85,7 @@ namespace FluentTerminal.App { if (_applicationSettings.NewTerminalLocation == NewTerminalLocation.Tab && _mainViewModels.Count > 0) { - await _mainViewModels.Last().AddTerminal(parameter).ConfigureAwait(true); + await _mainViewModels.Last().AddTerminal(parameter, false).ConfigureAwait(true); } else { @@ -103,7 +103,7 @@ namespace FluentTerminal.App else if (command == "new") { var viewModel = _container.Resolve(); - await viewModel.AddTerminal(parameter).ConfigureAwait(true); + await viewModel.AddTerminal(parameter, false).ConfigureAwait(true); await CreateMainView(typeof(MainPage), viewModel, true).ConfigureAwait(true); } } @@ -115,7 +115,7 @@ namespace FluentTerminal.App if (!_alreadyLaunched) { var viewModel = _container.Resolve(); - await viewModel.AddTerminal(null).ConfigureAwait(true); + await viewModel.AddTerminal(null, false).ConfigureAwait(true); await CreateMainView(typeof(MainPage), viewModel, true).ConfigureAwait(true); Window.Current.Activate(); } @@ -210,7 +210,7 @@ namespace FluentTerminal.App mainViewModel.NewWindowRequested += OnNewWindowRequested; mainViewModel.ShowSettingsRequested += OnShowSettingsRequested; _mainViewModels.Add(mainViewModel); - await mainViewModel.AddTerminal(directory).ConfigureAwait(true); + await mainViewModel.AddTerminal(directory, false).ConfigureAwait(true); } if (viewModel is SettingsViewModel settingsViewModel) diff --git a/FluentTerminal.App/Dialogs/ShellProfileSelectionDialog.xaml b/FluentTerminal.App/Dialogs/ShellProfileSelectionDialog.xaml new file mode 100644 index 0000000..16865f0 --- /dev/null +++ b/FluentTerminal.App/Dialogs/ShellProfileSelectionDialog.xaml @@ -0,0 +1,18 @@ + + + diff --git a/FluentTerminal.App/Dialogs/ShellProfileSelectionDialog.xaml.cs b/FluentTerminal.App/Dialogs/ShellProfileSelectionDialog.xaml.cs new file mode 100644 index 0000000..8ba67c7 --- /dev/null +++ b/FluentTerminal.App/Dialogs/ShellProfileSelectionDialog.xaml.cs @@ -0,0 +1,22 @@ +using FluentTerminal.App.Services; +using FluentTerminal.Models; +using System.Collections.Generic; +using System.Linq; +using Windows.UI.Xaml.Controls; + +namespace FluentTerminal.App.Dialogs +{ + public sealed partial class ShellProfileSelectionDialog : ContentDialog + { + public IEnumerable Profiles { get; } + + public ShellProfile SelectedProfile { get; private set; } + + public ShellProfileSelectionDialog(ISettingsService settingsService) + { + Profiles = settingsService.GetShellProfiles(); + SelectedProfile = Profiles.First(); + this.InitializeComponent(); + } + } +} diff --git a/FluentTerminal.App/FluentTerminal.App.csproj b/FluentTerminal.App/FluentTerminal.App.csproj index 7f0501a..85b17f0 100644 --- a/FluentTerminal.App/FluentTerminal.App.csproj +++ b/FluentTerminal.App/FluentTerminal.App.csproj @@ -109,6 +109,9 @@ + + ShellProfileSelectionDialog.xaml + @@ -261,6 +264,10 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/FluentTerminal.App/Services/IDialogService.cs b/FluentTerminal.App/Services/IDialogService.cs index 10349b3..427251e 100644 --- a/FluentTerminal.App/Services/IDialogService.cs +++ b/FluentTerminal.App/Services/IDialogService.cs @@ -1,4 +1,5 @@ -using System.Threading.Tasks; +using FluentTerminal.Models; +using System.Threading.Tasks; namespace FluentTerminal.App.Services { @@ -10,6 +11,8 @@ namespace FluentTerminal.App.Services public interface IDialogService { - Task ShowDialogAsnyc(string title, string content, params DialogButton[] buttons); + Task ShowMessageDialogAsnyc(string title, string content, params DialogButton[] buttons); + + Task ShowProfileSelectionDialogAsync(); } } diff --git a/FluentTerminal.App/Services/Implementation/DefaultValueProvider.cs b/FluentTerminal.App/Services/Implementation/DefaultValueProvider.cs index 37e81c6..f8b5c84 100644 --- a/FluentTerminal.App/Services/Implementation/DefaultValueProvider.cs +++ b/FluentTerminal.App/Services/Implementation/DefaultValueProvider.cs @@ -33,6 +33,17 @@ namespace FluentTerminal.App.Services.Implementation Key = (int)VirtualKey.T } }, + ConfigurableNewTab = new List + { + new KeyBinding + { + Command = Command.ConfigurableNewTab, + Ctrl = true, + Alt = false, + Shift = true, + Key = (int)VirtualKey.T + } + }, CloseTab = new List { new KeyBinding diff --git a/FluentTerminal.App/Services/Implementation/DialogService.cs b/FluentTerminal.App/Services/Implementation/DialogService.cs index 36829fc..b049690 100644 --- a/FluentTerminal.App/Services/Implementation/DialogService.cs +++ b/FluentTerminal.App/Services/Implementation/DialogService.cs @@ -1,12 +1,22 @@ using System; using System.Threading.Tasks; +using FluentTerminal.App.Dialogs; +using FluentTerminal.Models; using Windows.UI.Popups; +using Windows.UI.Xaml.Controls; namespace FluentTerminal.App.Services.Implementation { public class DialogService : IDialogService { - public async Task ShowDialogAsnyc(string title, string content, params DialogButton[] buttons) + private readonly ISettingsService _settingsService; + + public DialogService(ISettingsService settingsService) + { + _settingsService = settingsService; + } + + public async Task ShowMessageDialogAsnyc(string title, string content, params DialogButton[] buttons) { if (string.IsNullOrWhiteSpace(title)) { @@ -34,5 +44,18 @@ namespace FluentTerminal.App.Services.Implementation return Enum.Parse(result.Label); } + + public async Task ShowProfileSelectionDialogAsync() + { + var dialog = new ShellProfileSelectionDialog(_settingsService); + + var result = await dialog.ShowAsync(); + + if (result == ContentDialogResult.Primary) + { + return dialog.SelectedProfile; + } + return null; + } } } diff --git a/FluentTerminal.App/Services/Implementation/SettingsService.cs b/FluentTerminal.App/Services/Implementation/SettingsService.cs index faaa51b..5bb1b1a 100644 --- a/FluentTerminal.App/Services/Implementation/SettingsService.cs +++ b/FluentTerminal.App/Services/Implementation/SettingsService.cs @@ -117,8 +117,14 @@ namespace FluentTerminal.App.Services.Implementation public KeyBindings GetKeyBindings() { + var defaults = _defaultValueProvider.GetDefaultKeyBindings(); var keyBindings = _roamingSettings.ReadValueFromJson(nameof(KeyBindings), null); + if (keyBindings.ConfigurableNewTab == null) + { + keyBindings.ConfigurableNewTab = defaults.ConfigurableNewTab; + } + return keyBindings ?? _defaultValueProvider.GetDefaultKeyBindings(); } diff --git a/FluentTerminal.App/ViewModels/MainViewModel.cs b/FluentTerminal.App/ViewModels/MainViewModel.cs index 8b27c83..f875c97 100644 --- a/FluentTerminal.App/ViewModels/MainViewModel.cs +++ b/FluentTerminal.App/ViewModels/MainViewModel.cs @@ -1,4 +1,5 @@ -using FluentTerminal.App.Services; +using FluentTerminal.App.Dialogs; +using FluentTerminal.App.Services; using FluentTerminal.Models; using FluentTerminal.Models.Enums; using GalaSoft.MvvmLight; @@ -40,7 +41,8 @@ namespace FluentTerminal.App.ViewModels _trayProcessCommunicationService = trayProcessCommunicationService; _dialogService = dialogService; _keyboardCommandService = keyboardCommandService; - _keyboardCommandService.RegisterCommandHandler(Command.NewTab, () => AddTerminal(null)); + _keyboardCommandService.RegisterCommandHandler(Command.NewTab, () => AddTerminal(null, false)); + _keyboardCommandService.RegisterCommandHandler(Command.ConfigurableNewTab, () => AddTerminal(null, true)); _keyboardCommandService.RegisterCommandHandler(Command.CloseTab, CloseCurrentTab); _keyboardCommandService.RegisterCommandHandler(Command.NextTab, SelectNextTab); _keyboardCommandService.RegisterCommandHandler(Command.PreviousTab, SelectPreviousTab); @@ -51,7 +53,7 @@ namespace FluentTerminal.App.ViewModels BackgroundOpacity = currentTheme.BackgroundOpacity; _applicationSettings = _settingsService.GetApplicationSettings(); - AddTerminalCommand = new RelayCommand(() => AddTerminal(null)); + AddTerminalCommand = new RelayCommand(() => AddTerminal(null, false)); ShowSettingsCommand = new RelayCommand(ShowSettings); Terminals.CollectionChanged += OnTerminalsCollectionChanged; @@ -98,11 +100,26 @@ namespace FluentTerminal.App.ViewModels set => Set(ref _title, value); } - public Task AddTerminal(string startupDirectory) + public Task AddTerminal(string startupDirectory, bool showProfileSelection) { - return _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => + return _dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () => { - var terminal = new TerminalViewModel(GetNextTerminalId(), _settingsService, _trayProcessCommunicationService, _dialogService, _keyboardCommandService, _applicationSettings, startupDirectory); + ShellProfile profile = null; + if (showProfileSelection) + { + profile = await _dialogService.ShowProfileSelectionDialogAsync(); + + if (profile == null) + { + return; + } + } + else + { + profile = _settingsService.GetDefaultShellProfile(); + } + + var terminal = new TerminalViewModel(GetNextTerminalId(), _settingsService, _trayProcessCommunicationService, _dialogService, _keyboardCommandService, _applicationSettings, startupDirectory, profile); terminal.CloseRequested += OnTerminalCloseRequested; terminal.TitleChanged += OnTitleChanged; Terminals.Add(terminal); @@ -145,7 +162,7 @@ namespace FluentTerminal.App.ViewModels if (_applicationSettings.ConfirmClosingWindows) { - var result = await _dialogService.ShowDialogAsnyc("Please confirm", "Are you sure you want to close this window?", DialogButton.OK, DialogButton.Cancel).ConfigureAwait(false); + var result = await _dialogService.ShowMessageDialogAsnyc("Please confirm", "Are you sure you want to close this window?", DialogButton.OK, DialogButton.Cancel).ConfigureAwait(false); if (result == DialogButton.OK) { diff --git a/FluentTerminal.App/ViewModels/Settings/GeneralPageViewModel.cs b/FluentTerminal.App/ViewModels/Settings/GeneralPageViewModel.cs index 0f5a51b..f314b02 100644 --- a/FluentTerminal.App/ViewModels/Settings/GeneralPageViewModel.cs +++ b/FluentTerminal.App/ViewModels/Settings/GeneralPageViewModel.cs @@ -87,7 +87,7 @@ namespace FluentTerminal.App.ViewModels.Settings private async Task RestoreDefaults() { - var result = await _dialogService.ShowDialogAsnyc("Please confirm", "Are you sure you want to restore the general settings?", DialogButton.OK, DialogButton.Cancel).ConfigureAwait(false); + var result = await _dialogService.ShowMessageDialogAsnyc("Please confirm", "Are you sure you want to restore the general settings?", DialogButton.OK, DialogButton.Cancel).ConfigureAwait(false); if (result == DialogButton.OK) { diff --git a/FluentTerminal.App/ViewModels/Settings/KeyBindingViewModel.cs b/FluentTerminal.App/ViewModels/Settings/KeyBindingViewModel.cs index d27f587..3022a9a 100644 --- a/FluentTerminal.App/ViewModels/Settings/KeyBindingViewModel.cs +++ b/FluentTerminal.App/ViewModels/Settings/KeyBindingViewModel.cs @@ -118,7 +118,7 @@ namespace FluentTerminal.App.ViewModels.Settings private async Task Delete() { - var result = await _dialogService.ShowDialogAsnyc("Please confirm", "Are you sure you want to delete this keybinding?", DialogButton.OK, DialogButton.Cancel).ConfigureAwait(false); + var result = await _dialogService.ShowMessageDialogAsnyc("Please confirm", "Are you sure you want to delete this keybinding?", DialogButton.OK, DialogButton.Cancel).ConfigureAwait(false); if (result == DialogButton.OK) { diff --git a/FluentTerminal.App/ViewModels/Settings/KeyBindingsPageViewModel.cs b/FluentTerminal.App/ViewModels/Settings/KeyBindingsPageViewModel.cs index e09268c..3b36bc6 100644 --- a/FluentTerminal.App/ViewModels/Settings/KeyBindingsPageViewModel.cs +++ b/FluentTerminal.App/ViewModels/Settings/KeyBindingsPageViewModel.cs @@ -33,6 +33,7 @@ namespace FluentTerminal.App.ViewModels.Settings _keyBindings = keyBindings; NewTab = CreateViewModel(Command.NewTab, _keyBindings.NewTab); + ConfigurableNewTab = CreateViewModel(Command.ConfigurableNewTab, _keyBindings.ConfigurableNewTab); ToggleWindow = CreateViewModel(Command.ToggleWindow, _keyBindings.ToggleWindow); NextTab = CreateViewModel(Command.NextTab, _keyBindings.NextTab); PreviousTab = CreateViewModel(Command.PreviousTab, _keyBindings.PreviousTab); @@ -43,6 +44,7 @@ namespace FluentTerminal.App.ViewModels.Settings Paste = CreateViewModel(Command.Paste, _keyBindings.Paste); RaisePropertyChanged(nameof(NewTab)); + RaisePropertyChanged(nameof(ConfigurableNewTab)); RaisePropertyChanged(nameof(ToggleWindow)); RaisePropertyChanged(nameof(NextTab)); RaisePropertyChanged(nameof(PreviousTab)); @@ -54,6 +56,7 @@ namespace FluentTerminal.App.ViewModels.Settings } public KeyBindingsViewModel NewTab { get; private set; } + public KeyBindingsViewModel ConfigurableNewTab { get; private set; } public KeyBindingsViewModel ToggleWindow { get; private set; } public KeyBindingsViewModel NextTab { get; private set; } public KeyBindingsViewModel PreviousTab { get; private set; } @@ -78,6 +81,8 @@ namespace FluentTerminal.App.ViewModels.Settings return PreviousTab.Add(); case Command.NewTab: return NewTab.Add(); + case Command.ConfigurableNewTab: + return ConfigurableNewTab.Add(); case Command.CloseTab: return CloseTab.Add(); case Command.NewWindow: @@ -95,7 +100,7 @@ namespace FluentTerminal.App.ViewModels.Settings private async Task RestoreDefaults() { - var result = await _dialogService.ShowDialogAsnyc("Please confirm", "Are you sure you want to restore the default keybindings?", DialogButton.OK, DialogButton.Cancel).ConfigureAwait(false); + var result = await _dialogService.ShowMessageDialogAsnyc("Please confirm", "Are you sure you want to restore the default keybindings?", DialogButton.OK, DialogButton.Cancel).ConfigureAwait(false); if (result == DialogButton.OK) { diff --git a/FluentTerminal.App/ViewModels/Settings/TerminalPageViewModel.cs b/FluentTerminal.App/ViewModels/Settings/TerminalPageViewModel.cs index b8ac35e..8c669ba 100644 --- a/FluentTerminal.App/ViewModels/Settings/TerminalPageViewModel.cs +++ b/FluentTerminal.App/ViewModels/Settings/TerminalPageViewModel.cs @@ -105,7 +105,7 @@ namespace FluentTerminal.App.ViewModels.Settings private async Task RestoreDefaults() { - var result = await _dialogService.ShowDialogAsnyc("Please confirm", "Are you sure you want to restore the default terminal options?", DialogButton.OK, DialogButton.Cancel).ConfigureAwait(false); + var result = await _dialogService.ShowMessageDialogAsnyc("Please confirm", "Are you sure you want to restore the default terminal options?", DialogButton.OK, DialogButton.Cancel).ConfigureAwait(false); if (result == DialogButton.OK) { diff --git a/FluentTerminal.App/ViewModels/ShellProfileViewModel.cs b/FluentTerminal.App/ViewModels/ShellProfileViewModel.cs index bd0897f..f56b573 100644 --- a/FluentTerminal.App/ViewModels/ShellProfileViewModel.cs +++ b/FluentTerminal.App/ViewModels/ShellProfileViewModel.cs @@ -108,7 +108,7 @@ namespace FluentTerminal.App.ViewModels private async Task CancelEdit() { - var result = await _dialogService.ShowDialogAsnyc("Please confirm", "Are you sure you want to discard all changes?", DialogButton.OK, DialogButton.Cancel).ConfigureAwait(true); + var result = await _dialogService.ShowMessageDialogAsnyc("Please confirm", "Are you sure you want to discard all changes?", DialogButton.OK, DialogButton.Cancel).ConfigureAwait(true); if (result == DialogButton.OK) { @@ -142,7 +142,7 @@ namespace FluentTerminal.App.ViewModels private async Task Delete() { - var result = await _dialogService.ShowDialogAsnyc("Please confirm", "Are you sure you want to delete this theme?", DialogButton.OK, DialogButton.Cancel).ConfigureAwait(true); + var result = await _dialogService.ShowMessageDialogAsnyc("Please confirm", "Are you sure you want to delete this theme?", DialogButton.OK, DialogButton.Cancel).ConfigureAwait(true); if (result == DialogButton.OK) { diff --git a/FluentTerminal.App/ViewModels/TerminalViewModel.cs b/FluentTerminal.App/ViewModels/TerminalViewModel.cs index fdd5afa..fe4f426 100644 --- a/FluentTerminal.App/ViewModels/TerminalViewModel.cs +++ b/FluentTerminal.App/ViewModels/TerminalViewModel.cs @@ -29,8 +29,10 @@ namespace FluentTerminal.App.ViewModels private int _terminalId; private ITerminalView _terminalView; private string _title; + private readonly ShellProfile _shellProfile; - public TerminalViewModel(int id, ISettingsService settingsService, ITrayProcessCommunicationService trayProcessCommunicationService, IDialogService dialogService, IKeyboardCommandService keyboardCommandService, ApplicationSettings applicationSettings, string startupDirectory) + public TerminalViewModel(int id, ISettingsService settingsService, ITrayProcessCommunicationService trayProcessCommunicationService, IDialogService dialogService, + IKeyboardCommandService keyboardCommandService, ApplicationSettings applicationSettings, string startupDirectory, ShellProfile shellProfile) { Id = id; Title = DefaultTitle; @@ -45,6 +47,7 @@ namespace FluentTerminal.App.ViewModels _keyboardCommandService = keyboardCommandService; _applicationSettings = applicationSettings; _startupDirectory = startupDirectory; + _shellProfile = shellProfile; _resizeOverlayTimer = new DispatcherTimer { Interval = new TimeSpan(0, 0, 2) @@ -54,6 +57,7 @@ namespace FluentTerminal.App.ViewModels CloseCommand = new RelayCommand(async () => await InvokeCloseRequested().ConfigureAwait(false)); _dispatcher = CoreApplication.GetCurrentView().Dispatcher; + } private async void OnKeyBindingsChanged(object sender, EventArgs e) @@ -133,14 +137,13 @@ namespace FluentTerminal.App.ViewModels var keyBindings = _settingsService.GetKeyBindings(); var size = await _terminalView.CreateTerminal(options, theme.Colors, GetKeyBindingsCollection(keyBindings)).ConfigureAwait(true); - var configuration = _settingsService.GetDefaultShellProfile(); if (!string.IsNullOrWhiteSpace(_startupDirectory)) { - configuration.WorkingDirectory = _startupDirectory; + _shellProfile.WorkingDirectory = _startupDirectory; } - var response = await _trayProcessCommunicationService.CreateTerminal(size, configuration).ConfigureAwait(true); + var response = await _trayProcessCommunicationService.CreateTerminal(size, _shellProfile).ConfigureAwait(true); if (response.Success) { @@ -157,7 +160,7 @@ namespace FluentTerminal.App.ViewModels } else { - await _dialogService.ShowDialogAsnyc("Error", response.Error, DialogButton.OK).ConfigureAwait(true); + await _dialogService.ShowMessageDialogAsnyc("Error", response.Error, DialogButton.OK).ConfigureAwait(true); } await FocusTerminal().ConfigureAwait(true); @@ -167,7 +170,7 @@ namespace FluentTerminal.App.ViewModels { if (_applicationSettings.ConfirmClosingTabs) { - var result = await _dialogService.ShowDialogAsnyc("Please confirm", "Are you sure you want to close this tab?", DialogButton.OK, DialogButton.Cancel).ConfigureAwait(true); + var result = await _dialogService.ShowMessageDialogAsnyc("Please confirm", "Are you sure you want to close this tab?", DialogButton.OK, DialogButton.Cancel).ConfigureAwait(true); if (result == DialogButton.Cancel) { @@ -253,6 +256,7 @@ namespace FluentTerminal.App.ViewModels list.AddRange(keyBindings.CloseTab); list.AddRange(keyBindings.Copy); list.AddRange(keyBindings.NewTab); + list.AddRange(keyBindings.ConfigurableNewTab); list.AddRange(keyBindings.NewWindow); list.AddRange(keyBindings.NextTab); list.AddRange(keyBindings.Paste); diff --git a/FluentTerminal.App/ViewModels/ThemeViewModel.cs b/FluentTerminal.App/ViewModels/ThemeViewModel.cs index 388cbba..7c81d89 100644 --- a/FluentTerminal.App/ViewModels/ThemeViewModel.cs +++ b/FluentTerminal.App/ViewModels/ThemeViewModel.cs @@ -296,7 +296,7 @@ namespace FluentTerminal.App.ViewModels private async Task CancelEdit() { - var result = await _dialogService.ShowDialogAsnyc("Please confirm", "Are you sure you want to discard all changes?", DialogButton.OK, DialogButton.Cancel).ConfigureAwait(true); + var result = await _dialogService.ShowMessageDialogAsnyc("Please confirm", "Are you sure you want to discard all changes?", DialogButton.OK, DialogButton.Cancel).ConfigureAwait(true); if (result == DialogButton.OK) { @@ -344,7 +344,7 @@ namespace FluentTerminal.App.ViewModels private async Task Delete() { - var result = await _dialogService.ShowDialogAsnyc("Please confirm", "Are you sure you want to delete this theme?", DialogButton.OK, DialogButton.Cancel).ConfigureAwait(true); + var result = await _dialogService.ShowMessageDialogAsnyc("Please confirm", "Are you sure you want to delete this theme?", DialogButton.OK, DialogButton.Cancel).ConfigureAwait(true); if (result == DialogButton.OK) { diff --git a/FluentTerminal.App/Views/SettingsPages/KeyBindingSettings.xaml b/FluentTerminal.App/Views/SettingsPages/KeyBindingSettings.xaml index 2f44625..bc01fe1 100644 --- a/FluentTerminal.App/Views/SettingsPages/KeyBindingSettings.xaml +++ b/FluentTerminal.App/Views/SettingsPages/KeyBindingSettings.xaml @@ -38,6 +38,11 @@ NewTab + + + ConfigurableNewTab + + CloseTab @@ -104,6 +109,7 @@ + + Text="New configurable tab" /> + + + diff --git a/FluentTerminal.Models/Enums/Command.cs b/FluentTerminal.Models/Enums/Command.cs index 3fcebdc..8b3780c 100644 --- a/FluentTerminal.Models/Enums/Command.cs +++ b/FluentTerminal.Models/Enums/Command.cs @@ -6,6 +6,7 @@ NextTab, PreviousTab, NewTab, + ConfigurableNewTab, CloseTab, NewWindow, ShowSettings, diff --git a/FluentTerminal.Models/KeyBindings.cs b/FluentTerminal.Models/KeyBindings.cs index 939b93e..1ad2ff1 100644 --- a/FluentTerminal.Models/KeyBindings.cs +++ b/FluentTerminal.Models/KeyBindings.cs @@ -8,6 +8,7 @@ namespace FluentTerminal.Models public ICollection NextTab { get; set; } public ICollection PreviousTab { get; set; } public ICollection NewTab { get; set; } + public ICollection ConfigurableNewTab { get; set; } public ICollection CloseTab { get; set; } public ICollection NewWindow { get; set; } public ICollection ShowSettings { get; set; }