#pragma once #include #include #include #include #include "dialog_model.h" #include "key_event.h" #include "list_model.h" #include "services/storage_service.h" #include "services/update_service.h" #include "services/wifi_service.h" #include "ui/canvas.h" #include "ui/theme.h" namespace roro { // Settings → Firmware: the running version and its Probation, where to push Firmware Updates, and // the Update Files on the SD card (in /updates) to install from. class FirmwarePage { public: FirmwarePage(UpdateService& update, WifiService& wifi, StorageService& storage) : update_(update), wifi_(wifi), storage_(storage) {} void enter(); bool onKey(const KeyEvent& e); // false: leave the page void draw(Canvas& c); private: enum Row { kVersion, kStatus, kAddress, kSdHeader, kFixed }; std::vector files(); UpdateService& update_; WifiService& wifi_; StorageService& storage_; ListModel list_{theme::kContent.h / theme::kLineHeight}; std::unique_ptr confirm_; // Filled on the storage task. std::mutex lock_; std::vector files_; bool listed_ = false; }; } // namespace roro