mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-14 02:26:50 -07:00
Narrator does not provide the confirmation when user deleted one history from the history list items #1172 (#1302)
* Narrator reads incorrect information as “History and Memory list” in Programmer Calculator #1174
This commit is contained in:
parent
ca53d01e4e
commit
b1f49a2fcb
5 changed files with 22 additions and 1 deletions
|
@ -18,6 +18,7 @@ namespace CalculatorApp::Common::Automation
|
|||
StringReference MemoryItemChanged(L"MemorySlotChanged");
|
||||
StringReference MemoryItemAdded(L"MemorySlotAdded");
|
||||
StringReference HistoryCleared(L"HistoryCleared");
|
||||
StringReference HistorySlotCleared(L"HistorySlotCleared");
|
||||
StringReference CategoryNameChanged(L"CategoryNameChanged");
|
||||
StringReference UpdateCurrencyRates(L"UpdateCurrencyRates");
|
||||
StringReference DisplayCopied(L"DisplayCopied");
|
||||
|
@ -104,6 +105,12 @@ NarratorAnnouncement ^ CalculatorAnnouncement::GetHistoryClearedAnnouncement(Str
|
|||
announcement, CalculatorActivityIds::HistoryCleared, AutomationNotificationKind::ItemRemoved, AutomationNotificationProcessing::MostRecent);
|
||||
}
|
||||
|
||||
NarratorAnnouncement ^ CalculatorAnnouncement::GetHistorySlotClearedAnnouncement(String ^ announcement)
|
||||
{
|
||||
return ref new NarratorAnnouncement(
|
||||
announcement, CalculatorActivityIds::HistorySlotCleared, AutomationNotificationKind::ItemRemoved, AutomationNotificationProcessing::ImportantMostRecent);
|
||||
}
|
||||
|
||||
NarratorAnnouncement ^ CalculatorAnnouncement::GetCategoryNameChangedAnnouncement(String ^ announcement)
|
||||
{
|
||||
return ref new NarratorAnnouncement(
|
||||
|
|
|
@ -57,6 +57,7 @@ public
|
|||
static NarratorAnnouncement ^ GetMemoryItemAddedAnnouncement(Platform::String ^ announcement);
|
||||
|
||||
static NarratorAnnouncement ^ GetHistoryClearedAnnouncement(Platform::String ^ announcement);
|
||||
static NarratorAnnouncement ^ GetHistorySlotClearedAnnouncement(Platform::String ^ announcement);
|
||||
|
||||
static NarratorAnnouncement ^ GetCategoryNameChangedAnnouncement(Platform::String ^ announcement);
|
||||
|
||||
|
|
|
@ -23,14 +23,16 @@ using namespace Windows::Foundation::Collections;
|
|||
static StringReference HistoryVectorLengthKey{ L"HistoryVectorLength" };
|
||||
static StringReference ItemsSizeKey{ L"ItemsCount" };
|
||||
|
||||
namespace CalculatorApp::ViewModel::HistoryResourceKeys
|
||||
namespace HistoryResourceKeys
|
||||
{
|
||||
StringReference HistoryCleared(L"HistoryList_Cleared");
|
||||
StringReference HistorySlotCleared(L"Format_HistorySlotCleared");
|
||||
}
|
||||
|
||||
HistoryViewModel::HistoryViewModel(_In_ CalculationManager::CalculatorManager* calculatorManager)
|
||||
: m_calculatorManager(calculatorManager)
|
||||
, m_localizedHistoryCleared(nullptr)
|
||||
, m_localizedHistorySlotCleared(nullptr)
|
||||
{
|
||||
AreHistoryShortcutsEnabled = true;
|
||||
|
||||
|
@ -129,6 +131,12 @@ void HistoryViewModel::DeleteItem(_In_ HistoryItemViewModel ^ e)
|
|||
RaisePropertyChanged(ItemsSizeKey);
|
||||
}
|
||||
}
|
||||
// Adding 1 to the history item index to provide 1-based numbering on announcements.
|
||||
wstring localizedIndex = to_wstring(itemIndex + 1);
|
||||
LocalizationSettings::GetInstance().LocalizeDisplayValue(&localizedIndex);
|
||||
m_localizedHistorySlotCleared = AppResourceProvider::GetInstance()->GetResourceString(HistoryResourceKeys::HistorySlotCleared);
|
||||
String ^ announcement = LocalizationStringUtil::GetLocalizedString(m_localizedHistorySlotCleared, StringReference(localizedIndex.c_str()));
|
||||
HistoryAnnouncement = CalculatorAnnouncement::GetHistorySlotClearedAnnouncement(announcement);
|
||||
}
|
||||
|
||||
void HistoryViewModel::OnHideCommand(_In_ Platform::Object ^ e)
|
||||
|
|
|
@ -61,6 +61,7 @@ namespace CalculatorApp
|
|||
CalculatorDisplay m_calculatorDisplay;
|
||||
CalculationManager::CalculatorMode m_currentMode;
|
||||
Platform::String ^ m_localizedHistoryCleared;
|
||||
Platform::String ^ m_localizedHistorySlotCleared;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue