runner: autoupdate improvements (#2346)

This commit is contained in:
Andrey Nekrasov
2020-04-27 13:39:47 +03:00
committed by GitHub
parent 55c311cd39
commit ce4643d650
5 changed files with 92 additions and 21 deletions

View File

@@ -33,6 +33,11 @@ namespace
constexpr std::wstring_view WIN32_AUMID = L"Microsoft.PowerToysWin32";
}
namespace localized_strings
{
constexpr std::wstring_view SNOOZE_BUTTON = L"Snooze";
}
static DWORD loop_thread_id()
{
static const DWORD thread_id = GetCurrentThreadId();
@@ -213,7 +218,14 @@ void notifications::show_toast_with_activations(std::wstring message, std::wstri
toast_xml += selection_id;
toast_xml += LR"(" type="selection" defaultInput=")";
toast_xml += std::to_wstring(b.durations[0].minutes);
toast_xml += LR"(">)";
toast_xml += L'"';
if (!b.snooze_title.empty())
{
toast_xml += LR"( title=")";
toast_xml += b.snooze_title;
toast_xml += L'"';
}
toast_xml += L'>';
for (const auto& duration : b.durations)
{
toast_xml += LR"(<selection id=")";
@@ -269,7 +281,9 @@ void notifications::show_toast_with_activations(std::wstring message, std::wstri
toast_xml += selection_id;
toast_xml += '"';
}
toast_xml += LR"( content="" />)";
toast_xml += LR"( content=")";
toast_xml += localized_strings::SNOOZE_BUTTON;
toast_xml += LR"(" />)";
} },
actions[i]);
}