Desktop: Fix disabling keybinds

Turns out, flipper format does not allow empty value strings
This commit is contained in:
Willy-JL
2024-08-27 00:37:42 +02:00
parent c5f6d84920
commit e7267108c5
3 changed files with 9 additions and 91 deletions

View File

@@ -1,86 +1,2 @@
### Breaking Changes:
- Desktop: Settings restructured due to removal of LFS / LittleFS Internal Storage
- You might need to reconfigure Desktop Settings (PIN code, auto lock, show clock)
- Desktop Keybinds should transfer correctly automatically
### Added:
- Apps:
- Tools: Key Copier (by @zinongli)
- Sub-GHz: Music to Sub-GHz Radio (by @jamisonderek)
- Sub-GHz:
- Added Solight TE44 weather station recognition (#183 by @m7i-org)
- OFW: Add Dickert MAHS garage door protocol (by @OevreFlataeker)
- MNTM Settings: Allow setting Dolphin XP manually (by @Willy-JL)
- Settings: Show free flash amount in internal storage info (by @Willy-JL)
- Services:
- OFW: On SD insert load BT, Desktop, Dolphin, Expansion, Notification, Region files (by @gsurkov)
- On SD insert also load Momentum Settings, Asset Packs, FindMy Flipper, NameSpoof, RGB Backlight, Power, SubGHz options, and migrate files (by @Willy-JL)
- Furi: Re-enabled `FURI_TRACE` since LFS removal frees DFU, will get better crash messages with source code path (by @Willy-JL)
- OFW: RFID: Add GProxII support (by @BarTenderNZ)
- OFW: iButton: Support ID writing (by @Astrrra)
- OFW: GUI: Added a text input that only accepts full numbers (by @leedave)
- FBT:
- OFW: Add `-Wundef` to compiler options (by @hedger)
- OFW: Ensure that all images conform specification (by @skyhawkillusions & @hedger)
- Don't format images in external apps folder, only firmware (by @Willy-JL)
### Updated:
- Apps:
- BLE Spam: Can use 20ms advertising again with LFS gone (by @Willy-JL)
- Seader: Remove some optional ASN1 fields, disable ASN1 debug, correct key for Save as SR (by @bettse)
- NFC Playlist: Move playlist items, many bugfixes and improvements (by @acegoal07)
- ESP Flasher: Update Marauder bins to v1.0.0 (by @justcallmekoko)
- Pokemon Trading: Reset trade without affecting current pokemon, major refactoring (by @kbembedded)
- T5577 Raw Writer: Code refactor, bugfixes and improvements (by @zinongli)
- AirMouse: Fix compatibility with new firmwares (by @ginkage)
- Flizzer Tracker: Fix app not responding to keypresses (by @LTVA1)
- UHF RFID: Bugfixes, some refactoring, write modes (by @frux-c)
- Authenticator: Fix BT keys filenames format (by @akopachov)
- Mifare Fuzzer: Fix crash on unsupported card type loaded (by @Willy-JL)
- Cross Remote: Use system provided NumberInput (by @leedave)
- UL: UART Terminal: Configurable CRLF or newline mode (by @xMasterX)
- UL: SubGHz Bruteforcer: App refactoring and code documentation (by @derskythe)
- Various app fixes for `-Wundef` option (by @Willy-JL)
- Many app fixes for deprecated `view_dispatcher_enable_queue()` (by @xMasterX & @Willy-JL)
- BadKB: Lower BLE conn interval like base HID profile (by @Willy-JL)
- Desktop: Refactor Keybinds, no more 63 character limit, only load when activated to save RAM (by @Willy-JL)
- MNTM Settings: SubGHz frequency add screen uses new NumberInput view (by @Willy-JL)
- GUI: Small tweaks to NumberInput to match Text and Byte, and for better usability (by @Willy-JL)
- Settings:
- Statusbar Clock and Left Handed options show in normal Settings app like OFW (by @Willy-JL)
- Update list of keys files for forget all devices (by @Willy-JL)
- Services:
- Big cleanup of all services and settings handling, refactor lots old code (by @Willy-JL)
- Update all settings paths to use equivalents like OFW or UL for better compatibility (by @Willy-JL)
- Updater: Change to `resources.tar.gz` filename to avoid confusion with update `.tgz` (by @Willy-JL)
- Storage: Improved handling of VirtualMount status and added logging (by @Willy-JL)
- NFC:
- Updated MFC dict, +5 from RRG proxmark3, +3 from Mifare Classic Tool, +26 from Stepzor11 repo
- OFW: Refactor detected protocols list (by @Astrrra)
- Furi:
- OFW: FuriEventLoop Pt.2 with `Mutex` `Semaphore` `StreamBuffer`, refactor Power service (by @gsurkov)
- OFW: Update string documentation (by @skotopes)
- OFW: CCID: App refactor (by @kidbomb)
- OFW: FBT: Toolchain v39 (by @hedger)
### Fixed:
- GUI:
- Fix Dark Mode after XOR canvas color, like in NFC dict attack (by @Willy-JL)
- OFW: Make file extensions case-insensitive (by @gsurkov)
- File Browser: Fix race condition for switch folder and refresh (by @Willy-JL)
- MNTM Settings: Fix UI desync after reset mainmenu (by @Willy-JL)
- Sub-GHz:
- Make sure previous frequency is in list, fix UI desync (by @Willy-JL)
- OFW: Fix RPC status for ButtonRelease event (by @Skorpionm)
- NFC:
- OFW: Fix plantain balance string (by @Astrrra)
- OFW: Now fifo size in ST25 chip is calculated properly (by @RebornedBrain)
- OFW: Infrared: Fix cumulative error in infrared signals (by @gsurkov)
- OFW: Desktop: Separate callbacks for dolphin and storage subscriptions (by @skotopes)
- OFW: FBT: Improved size validator for updater image (by @hedger)
- OFW: JS: Ensure proper closure of variadic function in `mjs_array` (by @derskythe)
### Removed:
- OFW: Storage: Remove LFS / LittleFS Internal Storage, all config on SD Card (by @skotopes & @gsurkov)
- Storage: Remove `CFG_PATH()` and `.config/` folder, `INT_PATH()` is now on SD card at `.int/` due to LFS removal and should be used instead (by @Willy-JL)
- NFC: Removed abandoned unverified `bmp_sorted` and `icbmp_sorted` proxmark3 key dict sections
- Desktop: Fix disabling keybinds (by @Willy-JL)

View File

@@ -36,7 +36,9 @@ void desktop_keybinds_migrate(Desktop* desktop) {
for(DesktopKeybindType type = 0; type < DesktopKeybindTypeMAX; type++) {
for(DesktopKeybindKey key = 0; key < DesktopKeybindKeyMAX; key++) {
FuriString* keybind = furi_string_alloc_set(old[type][key].data);
if(furi_string_equal(keybind, EXT_PATH("apps/Misc/nightstand.fap"))) {
if(furi_string_empty(keybind)) {
furi_string_set_str(keybind, "_");
} else if(furi_string_equal(keybind, EXT_PATH("apps/Misc/nightstand.fap"))) {
furi_string_set(keybind, "Clock");
} else if(furi_string_equal(keybind, "RFID")) {
furi_string_set(keybind, "125 kHz RFID");
@@ -66,8 +68,8 @@ const char* desktop_keybinds_defaults[DesktopKeybindTypeMAX][DesktopKeybindKeyMA
},
[DesktopKeybindTypeHold] =
{
[DesktopKeybindKeyUp] = "",
[DesktopKeybindKeyDown] = "",
[DesktopKeybindKeyUp] = "_",
[DesktopKeybindKeyDown] = "_",
[DesktopKeybindKeyRight] = "Device Info",
[DesktopKeybindKeyLeft] = "Lock with PIN",
},
@@ -197,7 +199,7 @@ void desktop_run_keybind(Desktop* desktop, InputType _type, InputKey _key) {
DesktopKeybindKey key = keybind_keys[_key];
FuriString* keybind = desktop_keybinds_load_one(desktop, type, key);
if(furi_string_empty(keybind)) {
if(furi_string_equal(keybind, "_")) {
} else if(furi_string_equal(keybind, "Apps Menu")) {
loader_start_detached_with_gui_error(desktop->loader, LOADER_APPLICATIONS_NAME, NULL);
} else if(furi_string_equal(keybind, "Archive")) {

View File

@@ -68,7 +68,7 @@ static void
break;
}
case DesktopSettingsAppKeybindActionTypeRemoveKeybind:
desktop_settings_app_set_keybind(app, "");
desktop_settings_app_set_keybind(app, "_");
scene_manager_search_and_switch_to_previous_scene(
app->scene_manager, DesktopSettingsAppSceneStart);
break;
@@ -146,7 +146,7 @@ void desktop_settings_scene_keybinds_action_type_on_enter(void* context) {
}
}
if(furi_string_empty(keybind)) {
if(furi_string_equal(keybind, "_")) {
selected = DesktopSettingsAppKeybindActionTypeRemoveKeybind;
}
}