[FL-1543] Scene manager search scene API (#611)
* scene_manager: search -> search_and_switch_to previous_scene * scene_manager: add search and switch to another scene API * scene_manager: Navigation -> Back event
This commit is contained in:
9
applications/storage-settings/scenes/storage-settings-scene-ejected.c
Normal file → Executable file
9
applications/storage-settings/scenes/storage-settings-scene-ejected.c
Normal file → Executable file
@@ -40,12 +40,13 @@ bool storage_settings_scene_unmounted_on_event(void* context, SceneManagerEvent
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
switch(event.event) {
|
||||
case DialogExResultLeft:
|
||||
consumed =
|
||||
scene_manager_search_previous_scene(app->scene_manager, StorageSettingsStart);
|
||||
consumed = scene_manager_search_and_switch_to_previous_scene(
|
||||
app->scene_manager, StorageSettingsStart);
|
||||
break;
|
||||
}
|
||||
} else if(event.type == SceneManagerEventTypeNavigation) {
|
||||
consumed = scene_manager_search_previous_scene(app->scene_manager, StorageSettingsStart);
|
||||
} else if(event.type == SceneManagerEventTypeBack) {
|
||||
consumed = scene_manager_search_and_switch_to_previous_scene(
|
||||
app->scene_manager, StorageSettingsStart);
|
||||
}
|
||||
|
||||
return consumed;
|
||||
|
9
applications/storage-settings/scenes/storage-settings-scene-formatting.c
Normal file → Executable file
9
applications/storage-settings/scenes/storage-settings-scene-formatting.c
Normal file → Executable file
@@ -60,12 +60,13 @@ bool storage_settings_scene_formatting_on_event(void* context, SceneManagerEvent
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
switch(event.event) {
|
||||
case DialogExResultLeft:
|
||||
consumed =
|
||||
scene_manager_search_previous_scene(app->scene_manager, StorageSettingsStart);
|
||||
consumed = scene_manager_search_and_switch_to_previous_scene(
|
||||
app->scene_manager, StorageSettingsStart);
|
||||
break;
|
||||
}
|
||||
} else if(event.type == SceneManagerEventTypeNavigation) {
|
||||
consumed = scene_manager_search_previous_scene(app->scene_manager, StorageSettingsStart);
|
||||
} else if(event.type == SceneManagerEventTypeBack) {
|
||||
consumed = scene_manager_search_and_switch_to_previous_scene(
|
||||
app->scene_manager, StorageSettingsStart);
|
||||
}
|
||||
|
||||
return consumed;
|
||||
|
@@ -6,10 +6,10 @@ static bool storage_settings_custom_event_callback(void* context, uint32_t event
|
||||
return scene_manager_handle_custom_event(app->scene_manager, event);
|
||||
}
|
||||
|
||||
static bool storage_settings_navigation_event_callback(void* context) {
|
||||
static bool storage_settings_back_event_callback(void* context) {
|
||||
furi_assert(context);
|
||||
StorageSettings* app = context;
|
||||
return scene_manager_handle_navigation_event(app->scene_manager);
|
||||
return scene_manager_handle_back_event(app->scene_manager);
|
||||
}
|
||||
|
||||
static StorageSettings* storage_settings_alloc() {
|
||||
@@ -29,7 +29,7 @@ static StorageSettings* storage_settings_alloc() {
|
||||
view_dispatcher_set_custom_event_callback(
|
||||
app->view_dispatcher, storage_settings_custom_event_callback);
|
||||
view_dispatcher_set_navigation_event_callback(
|
||||
app->view_dispatcher, storage_settings_navigation_event_callback);
|
||||
app->view_dispatcher, storage_settings_back_event_callback);
|
||||
|
||||
view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
|
||||
|
||||
|
Reference in New Issue
Block a user