mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-15 04:19:26 -07:00
Fix keybind settings UI functionality
This commit is contained in:
@@ -7,6 +7,8 @@ static void
|
||||
DesktopSettingsApp* app = context;
|
||||
|
||||
desktop_settings_app_set_keybind(app, (const char*)index);
|
||||
scene_manager_search_and_switch_to_previous_scene(
|
||||
app->scene_manager, DesktopSettingsAppSceneStart);
|
||||
}
|
||||
|
||||
void desktop_settings_scene_keybinds_action_on_enter(void* context) {
|
||||
|
||||
@@ -61,12 +61,16 @@ static void
|
||||
furi_record_close(RECORD_STORAGE);
|
||||
if(dialog_file_browser_show(app->dialogs, temp_path, temp_path, &browser_options)) {
|
||||
desktop_settings_app_set_keybind(app, furi_string_get_cstr(temp_path));
|
||||
scene_manager_search_and_switch_to_previous_scene(
|
||||
app->scene_manager, DesktopSettingsAppSceneStart);
|
||||
}
|
||||
furi_string_free(temp_path);
|
||||
break;
|
||||
}
|
||||
case DesktopSettingsAppKeybindActionTypeRemoveKeybind:
|
||||
desktop_settings_app_set_keybind(app, "");
|
||||
scene_manager_search_and_switch_to_previous_scene(
|
||||
app->scene_manager, DesktopSettingsAppSceneStart);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -33,6 +33,9 @@ bool desktop_settings_scene_keybinds_reset_on_event(void* context, SceneManagerE
|
||||
case DialogExResultRight:
|
||||
storage_common_remove(furi_record_open(RECORD_STORAGE), DESKTOP_KEYBINDS_PATH);
|
||||
furi_record_close(RECORD_STORAGE);
|
||||
desktop_keybinds_free(&app->keybinds);
|
||||
desktop_keybinds_load(furi_record_open(RECORD_DESKTOP), &app->keybinds);
|
||||
furi_record_close(RECORD_DESKTOP);
|
||||
/* fall through */
|
||||
case DialogExResultLeft:
|
||||
consumed = scene_manager_previous_scene(app->scene_manager);
|
||||
|
||||
Reference in New Issue
Block a user