mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-01-01 18:39:03 -05:00
Performing the factory reset removes user files and settings. After powering on the device will run the onboarding.
67 lines
1.8 KiB
C++
67 lines
1.8 KiB
C++
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#include "OptionsList.hpp"
|
|
|
|
namespace gui
|
|
{
|
|
template <class ListType>
|
|
OptionsList<ListType>::OptionsList(std::shared_ptr<OptionsModel> model, std::list<Option> options)
|
|
: optionsModel{std::move(model)}, options(std::move(options))
|
|
{}
|
|
|
|
template <class ListType>
|
|
void OptionsList<ListType>::createOptions()
|
|
{
|
|
optionsModel->createData(options);
|
|
}
|
|
|
|
template <class ListType>
|
|
void OptionsList<ListType>::refreshOptions(std::list<Option> &&optionList)
|
|
{
|
|
options = std::move(optionList);
|
|
optionsList->rebuildList(listview::RebuildType::InPlace);
|
|
}
|
|
|
|
template <class ListType>
|
|
void OptionsList<ListType>::refreshOptions(std::list<Option> &&optionList, unsigned int pageIndex)
|
|
{
|
|
options = std::move(optionList);
|
|
optionsList->rebuildList(listview::RebuildType::OnPageElement, pageIndex);
|
|
}
|
|
|
|
template <class ListType>
|
|
void OptionsList<ListType>::addOptions(std::list<Option> &&optionList)
|
|
{
|
|
options = std::move(optionList);
|
|
createOptions();
|
|
|
|
optionsList->rebuildList();
|
|
}
|
|
|
|
template <class ListType>
|
|
void OptionsList<ListType>::changeOptions(std::list<Option> &&optionList)
|
|
{
|
|
clearOptions();
|
|
addOptions(std::move(optionList));
|
|
}
|
|
|
|
template <class ListType>
|
|
void OptionsList<ListType>::recreateOptions()
|
|
{
|
|
clearOptions();
|
|
createOptions();
|
|
}
|
|
|
|
template <class ListType>
|
|
void OptionsList<ListType>::clearOptions()
|
|
{
|
|
optionsList->clear();
|
|
optionsModel->clearData();
|
|
}
|
|
|
|
template class OptionsList<ListView>;
|
|
template class OptionsList<ListViewWithArrows>;
|
|
|
|
} // namespace gui
|