Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion projects/APPLaunch/main/ui/desktop_app_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,9 @@ void launcher_append_desktop_apps(std::list<app> &apps)
if (!launcher_app_registry_register_dynamic(
candidate.entry.name, candidate.icon_path, config_key, origin))
continue;
const bool settings_managed = origin == LauncherAppOrigin::Preinstalled;
// Every desktop app, preinstalled or installed from the Store, can be hidden from the
// carousel in Settings -> Launcher. A missing switch still means shown.
const bool settings_managed = true;
const AppDescriptor descriptor{
candidate.entry.name.c_str(), candidate.icon_path.c_str(),
config_key.c_str(), settings_managed, !settings_managed, origin};
Expand Down
3 changes: 2 additions & 1 deletion projects/APPLaunch/main/ui/model/dynamic_app_registry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ struct DynamicAppRegistration {

void bind_descriptor()
{
const bool settings_managed = origin == LauncherAppOrigin::Preinstalled;
// Preinstalled and Store-installed desktop apps can both be hidden in Settings -> Launcher.
const bool settings_managed = true;
desc = {label.c_str(), icon.c_str(), config_key.c_str(),
settings_managed, !settings_managed, origin};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ inline bool is_protected_launcher_app(std::string_view config_key)
inline bool is_launcher_settings_origin(LauncherAppOrigin origin)
{
return origin == LauncherAppOrigin::Builtin ||
origin == LauncherAppOrigin::Preinstalled;
origin == LauncherAppOrigin::Preinstalled ||
origin == LauncherAppOrigin::StoreInstalled;
}

template <typename Descriptor, typename EnabledPredicate>
Expand Down
9 changes: 5 additions & 4 deletions projects/APPLaunch/tests/test_dynamic_app_registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ void assert_entry(const DynamicAppRegistration &entry,
assert(entry.desc.icon == entry.icon.c_str());
assert(entry.desc.config_key == entry.config_key.c_str());
assert(entry.desc.origin == entry.origin);
const bool settings_managed = entry.origin == LauncherAppOrigin::Preinstalled;
assert(entry.desc.configurable == settings_managed);
assert(entry.desc.always_on == !settings_managed);
// Preinstalled and Store-installed apps alike can be hidden in Settings -> Launcher.
assert(entry.desc.configurable);
assert(!entry.desc.always_on);
}

} // namespace
Expand Down Expand Up @@ -97,7 +97,8 @@ int main(int argc, char **argv)
assert(loader.find("protected_builtin") != std::string::npos);
assert(loader.find("LauncherAppOrigin::Preinstalled") != std::string::npos);
assert(loader.find("LauncherAppOrigin::StoreInstalled") != std::string::npos);
assert(loader.find("origin == LauncherAppOrigin::Preinstalled") != std::string::npos);
// Store-installed apps are switchable too (Settings -> Launcher can hide them).
assert(loader.find("const bool settings_managed = true;") != std::string::npos);
assert(loader.find("parent_path()") != std::string::npos);
assert(loader.find("if (appended >= LAUNCHER_MAX_DESKTOP_APPS) break;") == std::string::npos);
assert(loader.find("!enabled || appended >= LAUNCHER_MAX_DESKTOP_APPS") != std::string::npos);
Expand Down
3 changes: 2 additions & 1 deletion projects/APPLaunch/tests/test_settings_models.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@ int main()
descriptors,
11,
[](const Descriptor &descriptor) { return descriptor.always_on; });
assert(entries.size() == 4);
assert(entries.size() == 5);
assert(entries[0].label == "Calculator");
assert(entries[0].config_key == "calculator");
assert(!entries[0].enabled);
assert(entries[1].label == "Python" && entries[1].config_key == "app_Python");
assert(entries[2].label == "Snake" && entries[2].config_key == "app_Game");
assert(entries[3].label == "ZClaw" && entries[3].config_key == "app_desktop_zclaw");
assert(entries[4].label == "Downloaded" && entries[4].config_key == "app_desktop_downloaded");
using settings_t12b::boot_actions::Action;
using settings_t12b::boot_actions::Operation;
assert(settings_t12b::boot_actions::presentation(Action::Reboot).confirmation_title == "Reboot?");
Expand Down