Skip to content
Merged
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: 2 additions & 2 deletions src/displayapp/DisplayApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,8 @@ void DisplayApp::LoadScreen(Apps app, DisplayApp::FullRefreshDirections directio
switch (app) {
case Apps::Launcher: {
std::array<Screens::Tile::Applications, UserAppTypes::Count> apps;
std::ranges::transform(userApps, apps.begin(), [](const auto& userApp) {
return Screens::Tile::Applications {userApp.icon, userApp.app, true};
std::ranges::transform(userApps, apps.begin(), [this](const auto& userApp) {
return Screens::Tile::Applications {userApp.icon, userApp.app, userApp.isAvailable(controllers.filesystem)};
});
currentScreen = std::make_unique<Screens::ApplicationList>(this,
settingsController,
Expand Down
3 changes: 2 additions & 1 deletion src/displayapp/UserApps.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ namespace Pinetime {
Apps app;
const char* icon;
Screens::Screen* (*create)(AppControllers& controllers);
bool (*isAvailable)(Controllers::FS& fileSystem);
};

struct WatchFaceDescription {
Expand All @@ -37,7 +38,7 @@ namespace Pinetime {

template <Apps t>
consteval AppDescription CreateAppDescription() {
return {AppTraits<t>::app, AppTraits<t>::icon, &AppTraits<t>::Create};
return {AppTraits<t>::app, AppTraits<t>::icon, &AppTraits<t>::Create, &AppTraits<t>::IsAvailable};
}

template <WatchFace t>
Expand Down
4 changes: 4 additions & 0 deletions src/displayapp/screens/Alarm.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ namespace Pinetime {
*controllers.systemTask,
controllers.motorController);
};

static bool IsAvailable(Pinetime::Controllers::FS& /*filesystem*/) {
return true;
};
};
}
}
4 changes: 4 additions & 0 deletions src/displayapp/screens/Calculator.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ namespace Pinetime {
static Screens::Screen* Create(AppControllers& /* controllers */) {
return new Screens::Calculator();
};

static bool IsAvailable(Pinetime::Controllers::FS& /*filesystem*/) {
return true;
};
};
}
}
4 changes: 4 additions & 0 deletions src/displayapp/screens/Dice.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ namespace Pinetime {
static Screens::Screen* Create(AppControllers& controllers) {
return new Screens::Dice(controllers.motionController, controllers.motorController, controllers.settingsController);
};

static bool IsAvailable(Pinetime::Controllers::FS& /*filesystem*/) {
return true;
};
};
}
}
4 changes: 4 additions & 0 deletions src/displayapp/screens/HeartRate.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ namespace Pinetime {
static Screens::Screen* Create(AppControllers& controllers) {
return new Screens::HeartRate(controllers.heartRateController, *controllers.systemTask);
};

static bool IsAvailable(Pinetime::Controllers::FS& /*filesystem*/) {
return true;
};
};
}
}
4 changes: 4 additions & 0 deletions src/displayapp/screens/InfiniPaint.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ namespace Pinetime {
static Screens::Screen* Create(AppControllers& controllers) {
return new Screens::InfiniPaint(controllers.lvgl, controllers.motorController);
};

static bool IsAvailable(Pinetime::Controllers::FS& /*filesystem*/) {
return true;
};
};
}
}
4 changes: 4 additions & 0 deletions src/displayapp/screens/Metronome.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ namespace Pinetime {
static Screens::Screen* Create(AppControllers& controllers) {
return new Screens::Metronome(controllers.motorController, *controllers.systemTask);
};

static bool IsAvailable(Pinetime::Controllers::FS& /*filesystem*/) {
return true;
};
};
}
}
4 changes: 4 additions & 0 deletions src/displayapp/screens/Motion.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ namespace Pinetime {
static Screens::Screen* Create(AppControllers& controllers) {
return new Screens::Motion(controllers.motionController);
};

static bool IsAvailable(Pinetime::Controllers::FS& /*filesystem*/) {
return true;
};
};
}
}
4 changes: 4 additions & 0 deletions src/displayapp/screens/Music.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ namespace Pinetime {
static Screens::Screen* Create(AppControllers& controllers) {
return new Screens::Music(*controllers.musicService);
};

static bool IsAvailable(Pinetime::Controllers::FS& /*filesystem*/) {
return true;
};
};
}
}
4 changes: 4 additions & 0 deletions src/displayapp/screens/Navigation.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ namespace Pinetime {
static Screens::Screen* Create(AppControllers& controllers) {
return new Screens::Navigation(*controllers.navigationService);
};

static bool IsAvailable(Pinetime::Controllers::FS& filesystem) {
return Screens::Navigation::IsAvailable(filesystem);
};
};
}
}
4 changes: 4 additions & 0 deletions src/displayapp/screens/Paddle.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ namespace Pinetime {
static Screens::Screen* Create(AppControllers& controllers) {
return new Screens::Paddle(controllers.lvgl);
};

static bool IsAvailable(Pinetime::Controllers::FS& /*filesystem*/) {
return true;
};
};
}
}
4 changes: 4 additions & 0 deletions src/displayapp/screens/Steps.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ namespace Pinetime {
static Screens::Screen* Create(AppControllers& controllers) {
return new Screens::Steps(controllers.motionController, controllers.settingsController);
};

static bool IsAvailable(Pinetime::Controllers::FS& /*filesystem*/) {
return true;
};
};
}
}
4 changes: 4 additions & 0 deletions src/displayapp/screens/StopWatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ namespace Pinetime {
static Screens::Screen* Create(AppControllers& controllers) {
return new Screens::StopWatch(*controllers.systemTask);
};

static bool IsAvailable(Pinetime::Controllers::FS& /*filesystem*/) {
return true;
};
};
}
}
4 changes: 4 additions & 0 deletions src/displayapp/screens/Timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,9 @@ namespace Pinetime::Applications {
static Screens::Screen* Create(AppControllers& controllers) {
return new Screens::Timer(controllers.timer);
};

static bool IsAvailable(Pinetime::Controllers::FS& /*filesystem*/) {
return true;
};
};
}
4 changes: 4 additions & 0 deletions src/displayapp/screens/Twos.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ namespace Pinetime {
static Screens::Screen* Create(AppControllers& /*controllers*/) {
return new Screens::Twos();
};

static bool IsAvailable(Pinetime::Controllers::FS& /*filesystem*/) {
return true;
};
};
}
}
4 changes: 4 additions & 0 deletions src/displayapp/screens/Weather.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ namespace Pinetime {
static Screens::Screen* Create(AppControllers& controllers) {
return new Screens::Weather(controllers.settingsController, *controllers.weatherController);
};

static bool IsAvailable(Pinetime::Controllers::FS& /*filesystem*/) {
return true;
};
};
}
}