feat(update): SD-card firmware update + X3 bootloader compatibility (#1786)
This commit is contained in:
@@ -9,6 +9,10 @@
|
||||
#include "util/ButtonNavigator.h"
|
||||
|
||||
class FileBrowserActivity final : public Activity {
|
||||
public:
|
||||
// Books = standard reader browser; PickFirmware = filter to .bin only and return path via ActivityResult.
|
||||
enum class Mode { Books, PickFirmware };
|
||||
|
||||
private:
|
||||
// Deletion
|
||||
void clearFileMetadata(const std::string& fullPath);
|
||||
@@ -18,6 +22,11 @@ class FileBrowserActivity final : public Activity {
|
||||
size_t selectorIndex = 0;
|
||||
|
||||
bool lockLongPressBack = false;
|
||||
// True when this activity was entered while Confirm was already held; we must swallow the next
|
||||
// release so we don't immediately auto-open the first entry.
|
||||
bool lockNextConfirmRelease = false;
|
||||
|
||||
Mode mode = Mode::Books;
|
||||
|
||||
// Files state
|
||||
std::string basepath = "/";
|
||||
@@ -28,8 +37,11 @@ class FileBrowserActivity final : public Activity {
|
||||
size_t findEntry(const std::string& name) const;
|
||||
|
||||
public:
|
||||
explicit FileBrowserActivity(GfxRenderer& renderer, MappedInputManager& mappedInput, std::string initialPath = "/")
|
||||
: Activity("FileBrowser", renderer, mappedInput), basepath(initialPath.empty() ? "/" : std::move(initialPath)) {}
|
||||
explicit FileBrowserActivity(GfxRenderer& renderer, MappedInputManager& mappedInput, std::string initialPath = "/",
|
||||
Mode mode = Mode::Books)
|
||||
: Activity("FileBrowser", renderer, mappedInput),
|
||||
mode(mode),
|
||||
basepath(initialPath.empty() ? "/" : std::move(initialPath)) {}
|
||||
void onEnter() override;
|
||||
void onExit() override;
|
||||
void loop() override;
|
||||
|
||||
Reference in New Issue
Block a user