|
|
@ -157,6 +157,8 @@ AppletManager::AppletManager() = default;
|
|
|
|
AppletManager::~AppletManager() = default;
|
|
|
|
AppletManager::~AppletManager() = default;
|
|
|
|
|
|
|
|
|
|
|
|
void AppletManager::SetAppletFrontendSet(AppletFrontendSet set) {
|
|
|
|
void AppletManager::SetAppletFrontendSet(AppletFrontendSet set) {
|
|
|
|
|
|
|
|
if (set.parental_controls != nullptr)
|
|
|
|
|
|
|
|
frontend.parental_controls = std::move(set.parental_controls);
|
|
|
|
if (set.error != nullptr)
|
|
|
|
if (set.error != nullptr)
|
|
|
|
frontend.error = std::move(set.error);
|
|
|
|
frontend.error = std::move(set.error);
|
|
|
|
if (set.photo_viewer != nullptr)
|
|
|
|
if (set.photo_viewer != nullptr)
|
|
|
@ -167,17 +169,21 @@ void AppletManager::SetAppletFrontendSet(AppletFrontendSet set) {
|
|
|
|
frontend.software_keyboard = std::move(set.software_keyboard);
|
|
|
|
frontend.software_keyboard = std::move(set.software_keyboard);
|
|
|
|
if (set.web_browser != nullptr)
|
|
|
|
if (set.web_browser != nullptr)
|
|
|
|
frontend.web_browser = std::move(set.web_browser);
|
|
|
|
frontend.web_browser = std::move(set.web_browser);
|
|
|
|
|
|
|
|
if (set.e_commerce != nullptr)
|
|
|
|
|
|
|
|
frontend.e_commerce = std::move(set.e_commerce);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void AppletManager::SetDefaultAppletFrontendSet() {
|
|
|
|
void AppletManager::SetDefaultAppletFrontendSet() {
|
|
|
|
frontend.error = std::make_unique<Core::Frontend::DefaultErrorApplet>();
|
|
|
|
ClearAll();
|
|
|
|
frontend.photo_viewer = std::make_unique<Core::Frontend::DefaultPhotoViewerApplet>();
|
|
|
|
SetDefaultAppletsIfMissing();
|
|
|
|
frontend.profile_select = std::make_unique<Core::Frontend::DefaultProfileSelectApplet>();
|
|
|
|
|
|
|
|
frontend.software_keyboard = std::make_unique<Core::Frontend::DefaultSoftwareKeyboardApplet>();
|
|
|
|
|
|
|
|
frontend.web_browser = std::make_unique<Core::Frontend::DefaultWebBrowserApplet>();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void AppletManager::SetDefaultAppletsIfMissing() {
|
|
|
|
void AppletManager::SetDefaultAppletsIfMissing() {
|
|
|
|
|
|
|
|
if (frontend.parental_controls == nullptr) {
|
|
|
|
|
|
|
|
frontend.parental_controls =
|
|
|
|
|
|
|
|
std::make_unique<Core::Frontend::DefaultParentalControlsApplet>();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (frontend.error == nullptr) {
|
|
|
|
if (frontend.error == nullptr) {
|
|
|
|
frontend.error = std::make_unique<Core::Frontend::DefaultErrorApplet>();
|
|
|
|
frontend.error = std::make_unique<Core::Frontend::DefaultErrorApplet>();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -198,6 +204,10 @@ void AppletManager::SetDefaultAppletsIfMissing() {
|
|
|
|
if (frontend.web_browser == nullptr) {
|
|
|
|
if (frontend.web_browser == nullptr) {
|
|
|
|
frontend.web_browser = std::make_unique<Core::Frontend::DefaultWebBrowserApplet>();
|
|
|
|
frontend.web_browser = std::make_unique<Core::Frontend::DefaultWebBrowserApplet>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (frontend.e_commerce == nullptr) {
|
|
|
|
|
|
|
|
frontend.e_commerce = std::make_unique<Core::Frontend::DefaultECommerceApplet>();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void AppletManager::ClearAll() {
|
|
|
|
void AppletManager::ClearAll() {
|
|
|
@ -206,6 +216,8 @@ void AppletManager::ClearAll() {
|
|
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<Applet> AppletManager::GetApplet(AppletId id) const {
|
|
|
|
std::shared_ptr<Applet> AppletManager::GetApplet(AppletId id) const {
|
|
|
|
switch (id) {
|
|
|
|
switch (id) {
|
|
|
|
|
|
|
|
case AppletId::Auth:
|
|
|
|
|
|
|
|
return std::make_shared<Auth>(*frontend.parental_controls);
|
|
|
|
case AppletId::Error:
|
|
|
|
case AppletId::Error:
|
|
|
|
return std::make_shared<Error>(*frontend.error);
|
|
|
|
return std::make_shared<Error>(*frontend.error);
|
|
|
|
case AppletId::ProfileSelect:
|
|
|
|
case AppletId::ProfileSelect:
|
|
|
@ -214,6 +226,8 @@ std::shared_ptr<Applet> AppletManager::GetApplet(AppletId id) const {
|
|
|
|
return std::make_shared<SoftwareKeyboard>(*frontend.software_keyboard);
|
|
|
|
return std::make_shared<SoftwareKeyboard>(*frontend.software_keyboard);
|
|
|
|
case AppletId::PhotoViewer:
|
|
|
|
case AppletId::PhotoViewer:
|
|
|
|
return std::make_shared<PhotoViewer>(*frontend.photo_viewer);
|
|
|
|
return std::make_shared<PhotoViewer>(*frontend.photo_viewer);
|
|
|
|
|
|
|
|
case AppletId::LibAppletShop:
|
|
|
|
|
|
|
|
return std::make_shared<WebBrowser>(*frontend.web_browser, frontend.e_commerce.get());
|
|
|
|
case AppletId::LibAppletOff:
|
|
|
|
case AppletId::LibAppletOff:
|
|
|
|
return std::make_shared<WebBrowser>(*frontend.web_browser);
|
|
|
|
return std::make_shared<WebBrowser>(*frontend.web_browser);
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|