fix storage settings scene exit via favs

This commit is contained in:
MX
2026-02-10 01:37:42 +03:00
parent 48db77f307
commit 9f9ceee149
11 changed files with 79 additions and 14 deletions

View File

@@ -156,14 +156,26 @@ bool storage_settings_scene_benchmark_on_event(void* context, SceneManagerEvent
if(event.type == SceneManagerEventTypeCustom) {
switch(event.event) {
case DialogExResultCenter:
consumed = scene_manager_search_and_switch_to_previous_scene(
app->scene_manager, StorageSettingsStart);
if(app->from_favorites) {
storage_settings_scene_benchmark_on_exit(app);
view_dispatcher_stop(app->view_dispatcher);
return true;
} else {
consumed = scene_manager_search_and_switch_to_previous_scene(
app->scene_manager, StorageSettingsStart);
}
break;
}
} else if(event.type == SceneManagerEventTypeBack) {
if(sd_status == FSE_OK) {
consumed = scene_manager_search_and_switch_to_previous_scene(
app->scene_manager, StorageSettingsStart);
if(app->from_favorites) {
storage_settings_scene_benchmark_on_exit(app);
view_dispatcher_stop(app->view_dispatcher);
return true;
} else {
consumed = scene_manager_search_and_switch_to_previous_scene(
app->scene_manager, StorageSettingsStart);
}
} else {
consumed = true;
}

View File

@@ -48,7 +48,13 @@ bool storage_settings_scene_benchmark_confirm_on_event(void* context, SceneManag
switch(event.event) {
case DialogExResultLeft:
case DialogExResultCenter:
consumed = scene_manager_previous_scene(app->scene_manager);
if(app->from_favorites) {
storage_settings_scene_benchmark_confirm_on_exit(app);
view_dispatcher_stop(app->view_dispatcher);
return true;
} else {
consumed = scene_manager_previous_scene(app->scene_manager);
}
break;
case DialogExResultRight:
scene_manager_next_scene(app->scene_manager, StorageSettingsBenchmark);

View File

@@ -44,7 +44,13 @@ bool storage_settings_scene_factory_reset_on_event(void* context, SceneManagerEv
switch(event.event) {
case DialogExResultLeft:
scene_manager_set_scene_state(app->scene_manager, StorageSettingsFactoryReset, 0);
consumed = scene_manager_previous_scene(app->scene_manager);
if(app->from_favorites) {
storage_settings_scene_factory_reset_on_exit(app);
view_dispatcher_stop(app->view_dispatcher);
return true;
} else {
consumed = scene_manager_previous_scene(app->scene_manager);
}
break;
case DialogExResultRight:
counter++;

View File

@@ -41,7 +41,13 @@ bool storage_settings_scene_format_confirm_on_event(void* context, SceneManagerE
switch(event.event) {
case DialogExResultLeft:
case DialogExResultCenter:
consumed = scene_manager_previous_scene(app->scene_manager);
if(app->from_favorites) {
storage_settings_scene_format_confirm_on_exit(app);
view_dispatcher_stop(app->view_dispatcher);
return true;
} else {
consumed = scene_manager_previous_scene(app->scene_manager);
}
break;
case DialogExResultRight:
scene_manager_next_scene(app->scene_manager, StorageSettingsFormatting);

View File

@@ -69,8 +69,14 @@ bool storage_settings_scene_formatting_on_event(void* context, SceneManagerEvent
if(event.type == SceneManagerEventTypeCustom) {
switch(event.event) {
case DialogExResultLeft:
consumed = scene_manager_search_and_switch_to_previous_scene(
app->scene_manager, StorageSettingsStart);
if(app->from_favorites) {
storage_settings_scene_formatting_on_exit(app);
view_dispatcher_stop(app->view_dispatcher);
return true;
} else {
consumed = scene_manager_search_and_switch_to_previous_scene(
app->scene_manager, StorageSettingsStart);
}
break;
}
} else if(event.type == SceneManagerEventTypeBack) {

View File

@@ -56,7 +56,13 @@ bool storage_settings_scene_internal_info_on_event(void* context, SceneManagerEv
if(event.type == SceneManagerEventTypeCustom) {
switch(event.event) {
case DialogExResultLeft:
consumed = scene_manager_previous_scene(app->scene_manager);
if(app->from_favorites) {
storage_settings_scene_internal_info_on_exit(app);
view_dispatcher_stop(app->view_dispatcher);
return true;
} else {
consumed = scene_manager_previous_scene(app->scene_manager);
}
break;
}
}

View File

@@ -78,7 +78,13 @@ bool storage_settings_scene_sd_info_on_event(void* context, SceneManagerEvent ev
switch(event.event) {
case DialogExResultLeft:
case DialogExResultCenter:
consumed = scene_manager_previous_scene(app->scene_manager);
if(app->from_favorites) {
storage_settings_scene_sd_info_on_exit(app);
view_dispatcher_stop(app->view_dispatcher);
return true;
} else {
consumed = scene_manager_previous_scene(app->scene_manager);
}
break;
case DialogExResultRight:
scene_manager_next_scene(app->scene_manager, StorageSettingsUnmounted);

View File

@@ -46,7 +46,13 @@ bool storage_settings_scene_unmount_confirm_on_event(void* context, SceneManager
switch(event.event) {
case DialogExResultCenter:
case DialogExResultLeft:
consumed = scene_manager_previous_scene(app->scene_manager);
if(app->from_favorites) {
storage_settings_scene_unmount_confirm_on_exit(app);
view_dispatcher_stop(app->view_dispatcher);
return true;
} else {
consumed = scene_manager_previous_scene(app->scene_manager);
}
break;
case DialogExResultRight:
scene_manager_next_scene(app->scene_manager, StorageSettingsUnmounted);

View File

@@ -57,8 +57,14 @@ bool storage_settings_scene_unmounted_on_event(void* context, SceneManagerEvent
if(event.type == SceneManagerEventTypeCustom) {
switch(event.event) {
case DialogExResultCenter:
consumed = scene_manager_search_and_switch_to_previous_scene(
app->scene_manager, StorageSettingsStart);
if(app->from_favorites) {
storage_settings_scene_unmounted_on_exit(app);
view_dispatcher_stop(app->view_dispatcher);
return true;
} else {
consumed = scene_manager_search_and_switch_to_previous_scene(
app->scene_manager, StorageSettingsStart);
}
break;
}
} else if(event.type == SceneManagerEventTypeBack) {

View File

@@ -98,7 +98,10 @@ int32_t storage_settings_app(void* p) {
StorageSettings* app = storage_settings_alloc();
if(!submenu_settings_helpers_app_start(app->settings_helper, p)) {
app->from_favorites = false;
scene_manager_next_scene(app->scene_manager, StorageSettingsStart);
} else {
app->from_favorites = true;
}
view_dispatcher_run(app->view_dispatcher);

View File

@@ -44,6 +44,8 @@ typedef struct {
// helpers
SubmenuSettingsHelperDescriptor* helper_descriptor;
SubmenuSettingsHelper* settings_helper;
bool from_favorites;
} StorageSettings;
typedef enum {