mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-24 04:00:02 +01:00
address most diffray warnings
This commit is contained in:
@@ -39,7 +39,6 @@ namespace KeyboardManagerEditorUI
|
||||
/// </summary>
|
||||
public App()
|
||||
{
|
||||
global::System.Diagnostics.Debugger.Break();
|
||||
this.InitializeComponent();
|
||||
|
||||
Task.Run(() =>
|
||||
|
||||
@@ -185,7 +185,7 @@ namespace KeyboardManagerEditorUI.Interop
|
||||
return KeyboardManagerInterop.AddShortcutRemap(_configHandle, originalKeys, targetKeys, targetApp, (int)operationType);
|
||||
}
|
||||
|
||||
public bool AddShorcutMapping(ShortcutKeyMapping shortcutKeyMapping)
|
||||
public bool AddShortcutMapping(ShortcutKeyMapping shortcutKeyMapping)
|
||||
{
|
||||
if (string.IsNullOrEmpty(shortcutKeyMapping.OriginalKeys) || string.IsNullOrEmpty(shortcutKeyMapping.TargetKeys))
|
||||
{
|
||||
|
||||
@@ -172,5 +172,15 @@
|
||||
<controls:AppPageInputControl x:Name="AppShortcutControl" />
|
||||
</Grid>
|
||||
</ContentDialog>
|
||||
|
||||
<TeachingTip
|
||||
x:Name="ValidationTip"
|
||||
x:Uid="ProgramsPageValidationTip"
|
||||
IsLightDismissEnabled="True"
|
||||
PreferredPlacement="Center">
|
||||
<TeachingTip.IconSource>
|
||||
<SymbolIconSource Symbol="Important" />
|
||||
</TeachingTip.IconSource>
|
||||
</TeachingTip>
|
||||
</Grid>
|
||||
</Page>
|
||||
|
||||
@@ -165,12 +165,6 @@ namespace KeyboardManagerEditorUI.Pages
|
||||
// Shortcut to text mapping
|
||||
string originalKeysString = string.Join(";", keys.Select(k => _mappingService.GetKeyCodeFromName(k).ToString(CultureInfo.InvariantCulture)));
|
||||
|
||||
// if (isAppSpecific && !string.IsNullOrEmpty(appName))
|
||||
// {
|
||||
// saved = _mappingService.AddShortcutMapping(originalKeysString, programPath, appName, ShortcutOperationType.RemapText);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
ShortcutKeyMapping shortcutKeyMapping = new ShortcutKeyMapping()
|
||||
{
|
||||
OperationType = ShortcutOperationType.RunProgram,
|
||||
@@ -183,7 +177,7 @@ namespace KeyboardManagerEditorUI.Pages
|
||||
Elevation = elevationLevel,
|
||||
};
|
||||
|
||||
saved = _mappingService.AddShorcutMapping(shortcutKeyMapping);
|
||||
saved = _mappingService.AddShortcutMapping(shortcutKeyMapping);
|
||||
|
||||
if (saved)
|
||||
{
|
||||
@@ -239,13 +233,13 @@ namespace KeyboardManagerEditorUI.Pages
|
||||
|
||||
private void ShowValidationError(ValidationErrorType errorType, ContentDialogButtonClickEventArgs args)
|
||||
{
|
||||
// if (ValidationHelper.ValidationMessages.TryGetValue(errorType, out (string Title, string Message) error))
|
||||
// {
|
||||
// ValidationTip.Title = error.Title;
|
||||
// ValidationTip.Subtitle = error.Message;
|
||||
// ValidationTip.IsOpen = true;
|
||||
// args.Cancel = true;
|
||||
// }
|
||||
if (ValidationHelper.ValidationMessages.TryGetValue(errorType, out (string Title, string Message) error))
|
||||
{
|
||||
ValidationTip.Title = error.Title;
|
||||
ValidationTip.Subtitle = error.Message;
|
||||
ValidationTip.IsOpen = true;
|
||||
args.Cancel = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
||||
@@ -194,7 +194,7 @@
|
||||
</ContentDialog>
|
||||
<TeachingTip
|
||||
x:Name="OrphanedKeysTeachingTip"
|
||||
x:Uid="RemmapingsPageOrphanedKeysTeachingTip"
|
||||
x:Uid="RemapingsPageOrphanedKeysTeachingTip"
|
||||
ActionButtonClick="OrphanedKeysTeachingTip_ActionButtonClick"
|
||||
ActionButtonStyle="{StaticResource AccentButtonStyle}"
|
||||
CloseButtonClick="OrphanedKeysTeachingTip_CloseButtonClick"
|
||||
|
||||
@@ -155,5 +155,15 @@
|
||||
<controls:UrlPageInputControl x:Name="UrlShortcutControl" />
|
||||
</Grid>
|
||||
</ContentDialog>
|
||||
|
||||
<TeachingTip
|
||||
x:Name="ValidationTip"
|
||||
x:Uid="UrlPageValidationTip"
|
||||
IsLightDismissEnabled="True"
|
||||
PreferredPlacement="Center">
|
||||
<TeachingTip.IconSource>
|
||||
<SymbolIconSource Symbol="Important" />
|
||||
</TeachingTip.IconSource>
|
||||
</TeachingTip>
|
||||
</Grid>
|
||||
</Page>
|
||||
|
||||
@@ -179,12 +179,6 @@ namespace KeyboardManagerEditorUI.Pages
|
||||
// Shortcut to text mapping
|
||||
string originalKeysString = string.Join(";", keys.Select(k => _mappingService.GetKeyCodeFromName(k).ToString(CultureInfo.InvariantCulture)));
|
||||
|
||||
// if (isAppSpecific && !string.IsNullOrEmpty(appName))
|
||||
// {
|
||||
// saved = _mappingService.AddShortcutMapping(originalKeysString, programPath, appName, ShortcutOperationType.RemapText);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
ShortcutKeyMapping shortcutKeyMapping = new ShortcutKeyMapping()
|
||||
{
|
||||
OperationType = ShortcutOperationType.OpenUri,
|
||||
@@ -193,7 +187,7 @@ namespace KeyboardManagerEditorUI.Pages
|
||||
UriToOpen = urlPath,
|
||||
};
|
||||
|
||||
saved = _mappingService.AddShorcutMapping(shortcutKeyMapping);
|
||||
saved = _mappingService.AddShortcutMapping(shortcutKeyMapping);
|
||||
|
||||
if (saved)
|
||||
{
|
||||
@@ -210,13 +204,13 @@ namespace KeyboardManagerEditorUI.Pages
|
||||
|
||||
private void ShowValidationError(ValidationErrorType errorType, ContentDialogButtonClickEventArgs args)
|
||||
{
|
||||
// if (ValidationHelper.ValidationMessages.TryGetValue(errorType, out (string Title, string Message) error))
|
||||
// {
|
||||
// ValidationTip.Title = error.Title;
|
||||
// ValidationTip.Subtitle = error.Message;
|
||||
// ValidationTip.IsOpen = true;
|
||||
// args.Cancel = true;
|
||||
// }
|
||||
if (ValidationHelper.ValidationMessages.TryGetValue(errorType, out (string Title, string Message) error))
|
||||
{
|
||||
ValidationTip.Title = error.Title;
|
||||
ValidationTip.Subtitle = error.Message;
|
||||
ValidationTip.IsOpen = true;
|
||||
args.Cancel = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void DeleteButton_Click(object sender, RoutedEventArgs e)
|
||||
|
||||
@@ -141,13 +141,13 @@
|
||||
<data name="RemappingsPageOriginalKeysTextBlock.Text" xml:space="preserve">
|
||||
<value>Original key(s)</value>
|
||||
</data>
|
||||
<data name="RemmapingsPageOrphanedKeysTeachingTip.ActionButtonContent" xml:space="preserve">
|
||||
<data name="RemapingsPageOrphanedKeysTeachingTip.ActionButtonContent" xml:space="preserve">
|
||||
<value>Continue anyway</value>
|
||||
</data>
|
||||
<data name="RemmapingsPageOrphanedKeysTeachingTip.CloseButtonContent" xml:space="preserve">
|
||||
<data name="RemapingsPageOrphanedKeysTeachingTip.CloseButtonContent" xml:space="preserve">
|
||||
<value>Cancel</value>
|
||||
</data>
|
||||
<data name="RemmapingsPageOrphanedKeysTeachingTip.Title" xml:space="preserve">
|
||||
<data name="RemapingsPageOrphanedKeysTeachingTip.Title" xml:space="preserve">
|
||||
<value>Orphaned Keys Warning</value>
|
||||
</data>
|
||||
<data name="RemappingsPageValidationTeachingTip.CloseButtonContent" xml:space="preserve">
|
||||
@@ -309,4 +309,10 @@
|
||||
<data name="AppPageInputControlExtraOptionsTextBlock.Text" xml:space="preserve">
|
||||
<value>More options</value>
|
||||
</data>
|
||||
<data name="ProgramsPageValidationTip.CloseButtonContent" xml:space="preserve">
|
||||
<value>OK</value>
|
||||
</data>
|
||||
<data name="UrlPageValidationTip.CloseButtonContent" xml:space="preserve">
|
||||
<value>OK</value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user