mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-06-14 11:35:30 -04:00
On initial code there was option to store only one popup of set priority, now we can store multiple ones
24 lines
697 B
C++
24 lines
697 B
C++
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#include "WindowsPopupQueue.hpp"
|
|
#include "WindowsPopupFilter.hpp"
|
|
|
|
namespace app
|
|
{
|
|
std::optional<gui::popup::Request> WindowsPopupQueue::popRequest(const gui::popup::Filter &filter)
|
|
{
|
|
for (const auto &val : requests) {
|
|
if (filter.isPermitted(val.getPopupParams())) {
|
|
return {std::move(requests.extract(val).value())};
|
|
}
|
|
}
|
|
return {std::nullopt};
|
|
}
|
|
|
|
void WindowsPopupQueue::pushRequest(gui::popup::Request &&r)
|
|
{
|
|
requests.emplace(std::move(r));
|
|
}
|
|
} // namespace app
|