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:
Chakib Ljazouli 2020-06-23 23:00:58 -04:00 committed by GitHub
parent fad3142a47
commit 3272575f70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View File

@ -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"));

View File

@ -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);
};

View File

@ -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;
}

View File

@ -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;
}