From eb0af22ecf66957b9341521990c49a6d1d5d70e3 Mon Sep 17 00:00:00 2001 From: Jean-François Milants Date: Tue, 11 Oct 2022 21:36:31 +0200 Subject: Watch face settings : disable watch faces that are not available (external resources are not installed). --- src/displayapp/screens/WatchFaceInfineat.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/displayapp/screens/WatchFaceInfineat.cpp') diff --git a/src/displayapp/screens/WatchFaceInfineat.cpp b/src/displayapp/screens/WatchFaceInfineat.cpp index 5822a1e8..01b425da 100644 --- a/src/displayapp/screens/WatchFaceInfineat.cpp +++ b/src/displayapp/screens/WatchFaceInfineat.cpp @@ -609,3 +609,21 @@ void WatchFaceInfineat::ToggleBatteryIndicatorColor(bool showSideCover) { lv_color_hex(infineatColors.orange[settingsController.GetInfineatColorIndex() * nLines + 7])); } } + +bool WatchFaceInfineat::IsAvailable(Pinetime::Controllers::FS& filesystem) { + lfs_file file = {}; + + if (filesystem.FileOpen(&file, "/fonts/teko.bin", LFS_O_RDONLY) < 0) { + return false; + } + + if (filesystem.FileOpen(&file, "/fonts/bebas.bin", LFS_O_RDONLY) < 0) { + return false; + } + + if (filesystem.FileOpen(&file, "/images/pine_small.bin", LFS_O_RDONLY) < 0) { + return false; + } + + return true; +} -- cgit v1.2.3-70-g09d2