mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-01-18 06:29:44 +08:00
Dynamic dialog titles for Key/Shortcuts remapping (#4251)
* Fix typo in dialog title * Pass Remap Keys/Shortcuts dialog titles as argument
This commit is contained in:
parent
fad3142a47
commit
3272575f70
@ -1,11 +1,11 @@
|
||||
#include "pch.h"
|
||||
#include "Dialog.h"
|
||||
|
||||
IAsyncOperation<bool> Dialog::PartialRemappingConfirmationDialog(XamlRoot root)
|
||||
IAsyncOperation<bool> Dialog::PartialRemappingConfirmationDialog(XamlRoot root, std::wstring dialogTitle)
|
||||
{
|
||||
ContentDialog confirmationDialog;
|
||||
confirmationDialog.XamlRoot(root);
|
||||
confirmationDialog.Title(box_value(L"Some of the keys could not be remapped. Do you want to continue anyway?"));
|
||||
confirmationDialog.Title(box_value(dialogTitle));
|
||||
confirmationDialog.IsPrimaryButtonEnabled(true);
|
||||
confirmationDialog.DefaultButton(ContentDialogButton::Primary);
|
||||
confirmationDialog.PrimaryButtonText(winrt::hstring(L"Continue Anyway"));
|
||||
|
@ -37,5 +37,5 @@ namespace Dialog
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
IAsyncOperation<bool> PartialRemappingConfirmationDialog(winrt::Windows::UI::Xaml::XamlRoot root);
|
||||
IAsyncOperation<bool> PartialRemappingConfirmationDialog(winrt::Windows::UI::Xaml::XamlRoot root, std::wstring dialogTitle);
|
||||
};
|
||||
|
@ -91,7 +91,7 @@ static IAsyncAction OnClickAccept(KeyboardManagerState& keyboardManagerState, Xa
|
||||
});
|
||||
if (isSuccess != KeyboardManagerHelper::ErrorType::NoError)
|
||||
{
|
||||
if (!co_await Dialog::PartialRemappingConfirmationDialog(root))
|
||||
if (!co_await Dialog::PartialRemappingConfirmationDialog(root, L"Some of the keys could not be remapped. Do you want to continue anyway?"))
|
||||
{
|
||||
co_return;
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ static IAsyncAction OnClickAccept(
|
||||
});
|
||||
if (isSuccess != KeyboardManagerHelper::ErrorType::NoError)
|
||||
{
|
||||
if (!co_await Dialog::PartialRemappingConfirmationDialog(root))
|
||||
if (!co_await Dialog::PartialRemappingConfirmationDialog(root, L"Some of the shortcuts could not be remapped. Do you want to continue anyway?"))
|
||||
{
|
||||
co_return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user