mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-12 12:28:36 -07:00
Merge branch 'ofw-dev' into dev
This commit is contained in:
@@ -37,6 +37,7 @@ static void desktop_loader_callback(const void* message, void* context) {
|
||||
view_dispatcher_send_custom_event(desktop->view_dispatcher, DesktopGlobalAfterAppFinished);
|
||||
}
|
||||
}
|
||||
|
||||
static void desktop_lock_icon_draw_callback(Canvas* canvas, void* context) {
|
||||
UNUSED(context);
|
||||
furi_assert(canvas);
|
||||
|
||||
@@ -36,7 +36,8 @@ static void desktop_scene_main_interact_animation_callback(void* context) {
|
||||
}
|
||||
|
||||
#ifdef APP_ARCHIVE
|
||||
static void desktop_switch_to_app(Desktop* desktop, const FlipperApplication* flipper_app) {
|
||||
static void
|
||||
desktop_switch_to_app(Desktop* desktop, const FlipperInternalApplication* flipper_app) {
|
||||
furi_assert(desktop);
|
||||
furi_assert(flipper_app);
|
||||
furi_assert(flipper_app->app);
|
||||
@@ -63,33 +64,19 @@ static void desktop_switch_to_app(Desktop* desktop, const FlipperApplication* fl
|
||||
#endif
|
||||
|
||||
static void desktop_scene_main_open_app_or_profile(Desktop* desktop, const char* path) {
|
||||
do {
|
||||
LoaderStatus status = loader_start(desktop->loader, FAP_LOADER_APP_NAME, path);
|
||||
if(status == LoaderStatusOk) break;
|
||||
FURI_LOG_E(TAG, "loader_start failed: %d", status);
|
||||
|
||||
status = loader_start(desktop->loader, "Passport", NULL);
|
||||
if(status != LoaderStatusOk) {
|
||||
FURI_LOG_E(TAG, "loader_start failed: %d", status);
|
||||
}
|
||||
} while(false);
|
||||
if(loader_start_with_gui_error(desktop->loader, path, NULL) != LoaderStatusOk) {
|
||||
loader_start(desktop->loader, "Passport", NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void desktop_scene_main_start_favorite(Desktop* desktop, FavoriteApp* application) {
|
||||
LoaderStatus status = LoaderStatusErrorInternal;
|
||||
if(application->is_external) {
|
||||
status = loader_start(desktop->loader, FAP_LOADER_APP_NAME, application->name_or_path);
|
||||
} else if(strlen(application->name_or_path) > 0) {
|
||||
status = loader_start(desktop->loader, application->name_or_path, NULL);
|
||||
if(strlen(application->name_or_path) > 0) {
|
||||
loader_start_with_gui_error(desktop->loader, application->name_or_path, NULL);
|
||||
} else {
|
||||
// No favourite app is set! So we skipping this part
|
||||
return;
|
||||
//status = loader_start(desktop->loader, FAP_LOADER_APP_NAME, NULL);
|
||||
}
|
||||
|
||||
if(status != LoaderStatusOk) {
|
||||
FURI_LOG_E(TAG, "loader_start failed: %d", status);
|
||||
}
|
||||
}
|
||||
|
||||
void desktop_scene_main_callback(DesktopEvent event, void* context) {
|
||||
@@ -152,10 +139,7 @@ bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
|
||||
break;
|
||||
|
||||
case DesktopMainEventOpenPowerOff: {
|
||||
LoaderStatus status = loader_start(desktop->loader, "Power", "off");
|
||||
if(status != LoaderStatusOk) {
|
||||
FURI_LOG_E(TAG, "loader_start failed: %d", status);
|
||||
}
|
||||
loader_start(desktop->loader, "Power", "off", NULL);
|
||||
consumed = true;
|
||||
break;
|
||||
}
|
||||
@@ -185,18 +169,12 @@ bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
|
||||
break;
|
||||
case DesktopAnimationEventInteractAnimation:
|
||||
if(!animation_manager_interact_process(desktop->animation_manager)) {
|
||||
LoaderStatus status = loader_start(desktop->loader, "Passport", NULL);
|
||||
if(status != LoaderStatusOk) {
|
||||
FURI_LOG_E(TAG, "loader_start failed: %d", status);
|
||||
}
|
||||
loader_start(desktop->loader, "Passport", NULL, NULL);
|
||||
}
|
||||
consumed = true;
|
||||
break;
|
||||
case DesktopMainEventOpenPassport: {
|
||||
LoaderStatus status = loader_start(desktop->loader, "Passport", NULL);
|
||||
if(status != LoaderStatusOk) {
|
||||
FURI_LOG_E(TAG, "loader_start failed: %d", status);
|
||||
}
|
||||
loader_start(desktop->loader, "Passport", NULL, NULL);
|
||||
break;
|
||||
}
|
||||
case DesktopMainEventOpenGameMenu: {
|
||||
|
||||
Reference in New Issue
Block a user