mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2026-08-01 21:18:35 +02:00
29 lines
817 B
C++
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>();
|
|
}
|