mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-07 22:22:21 -04:00
Declare all folder names in a single source file (#2039)
This commit is contained in:
parent
d9bbd1b9ff
commit
d5c8525afc
56 changed files with 224 additions and 105 deletions
|
@ -23,11 +23,10 @@
|
|||
#include "ui_flash_utility.hpp"
|
||||
#include "ui_styles.hpp"
|
||||
#include "portapack_shared_memory.hpp"
|
||||
#include "file_path.hpp"
|
||||
|
||||
namespace ui {
|
||||
|
||||
static const std::filesystem::path firmware_path = u"/FIRMWARE";
|
||||
|
||||
// Firmware image validation
|
||||
static const char* hackrf_magic = "HACKRFFW";
|
||||
#define FIRMWARE_INFO_AREA_OFFSET 0x400
|
||||
|
@ -84,7 +83,7 @@ FlashUtilityView::FlashUtilityView(NavigationView& nav)
|
|||
|
||||
menu_view.set_parent_rect({0, 3 * 8, 240, 33 * 8});
|
||||
|
||||
ensure_directory(firmware_path);
|
||||
ensure_directory(firmware_dir);
|
||||
|
||||
auto add_firmware_items = [&](
|
||||
const std::filesystem::path& folder_path,
|
||||
|
@ -103,8 +102,8 @@ FlashUtilityView::FlashUtilityView(NavigationView& nav)
|
|||
}
|
||||
};
|
||||
|
||||
add_firmware_items(firmware_path, u"*.bin", ui::Color::red());
|
||||
add_firmware_items(firmware_path, u"*.tar", ui::Color::purple());
|
||||
add_firmware_items(firmware_dir, u"*.bin", ui::Color::red());
|
||||
add_firmware_items(firmware_dir, u"*.tar", ui::Color::purple());
|
||||
|
||||
// add_firmware_items(user_firmware_folder,u"*.bin", ui::Color::purple());
|
||||
}
|
||||
|
@ -116,7 +115,7 @@ void FlashUtilityView::firmware_selected(std::filesystem::path::string_type path
|
|||
YESNO,
|
||||
[this, path](bool choice) {
|
||||
if (choice) {
|
||||
std::u16string full_path = std::u16string(u"FIRMWARE/") + path;
|
||||
std::filesystem::path::string_type full_path = firmware_dir.native() + u"/" + path;
|
||||
this->flash_firmware(full_path);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue