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