Files
pico-launcher/arm9/source/settings/SettingsController.cpp
2026-07-05 20:07:13 +02:00

29 lines
817 B
C++

#include "common.h"
#include "App.h"
#include "SettingsController.h"
SettingsController::SettingsController(IAppSettingsService* appSettingsService, TaskQueueBase* ioTaskQueue)
: _appSettingsService(appSettingsService), _ioTaskQueue(ioTaskQueue) { }
void SettingsController::Initialize()
{
_themeRepository.Initialize();
_themeInfoManager = std::make_unique<ThemeInfoManager>(_themeRepository);
}
void SettingsController::NavigateUp()
{
gProcessManager.Goto<App>();
}
void SettingsController::SelectTheme(const char* themeFolderName)
{
_appSettingsService->GetAppSettings().theme = themeFolderName;
_ioTaskQueue->Enqueue([this] (const vu8& cancelRequested)
{
_appSettingsService->Save();
return TaskResult<void>::Completed();
});
gProcessManager.Goto<App>();
}