-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Feature: Added an option to disable the "Open in Windows Terminal" action #17250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,8 @@ internal partial class OpenTerminalAction : ObservableObject, IAction | |
{ | ||
private readonly IContentPageContext context; | ||
|
||
private IUserSettingsService UserSettingsService { get; } = Ioc.Default.GetRequiredService<IUserSettingsService>(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The action should still be available when the menu item is turned off. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand what you mean by that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct, this setting is only for the context menu item, it's not meant to disable the action. |
||
|
||
public virtual string Label | ||
=> Strings.OpenTerminal.GetLocalizedResource(); | ||
|
||
|
@@ -96,6 +98,9 @@ protected virtual string[] GetPaths() | |
|
||
private bool GetIsExecutable() | ||
{ | ||
if (UserSettingsService.GeneralSettingsService.ShowOpenTerminal is false) | ||
return false; | ||
|
||
if (context.PageType is ContentPageTypes.None or ContentPageTypes.Home or ContentPageTypes.RecycleBin or ContentPageTypes.ZipFolder or ContentPageTypes.ReleaseNotes or ContentPageTypes.Settings) | ||
return false; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -261,6 +261,11 @@ | |
<ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=ShowOpenInNewPane}" IsOn="{x:Bind ViewModel.ShowOpenInNewPane, Mode=TwoWay}" /> | ||
</wctcontrols:SettingsCard> | ||
|
||
<!-- Open in Windows Terminal --> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The setting should probably match the order of the context menu item. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you mean? The setting is shown after all the "Open folder in xyz" settings There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The setting should be right before the setting for 'Edit tags', this way it's consistent with the order of the Context Menu items. |
||
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowOpenTerminal}"> | ||
<ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=ShowOpenTerminal}" IsOn="{x:Bind ViewModel.ShowOpenTerminal, Mode=TwoWay}" /> | ||
</wctcontrols:SettingsCard> | ||
|
||
<!-- Copy path --> | ||
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowCopyPath}"> | ||
<ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=ShowCopyPath}" IsOn="{x:Bind ViewModel.ShowCopyPath, Mode=TwoWay}" /> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use field for DI instances