This commit is contained in:
Willy-JL
2023-05-02 03:44:29 +01:00
parent 01a3385369
commit 8a5782ab9e
3 changed files with 12 additions and 9 deletions
@@ -11,7 +11,8 @@ bool process_favorite_launch(char** args) {
void favorite_timeout_callback(void* _ctx) {
FavoriteTImeoutCtx* ctx = _ctx;
while(scene_manager_handle_back_event(ctx->scene_manager));
while(scene_manager_handle_back_event(ctx->scene_manager))
;
view_dispatcher_stop(ctx->view_dispatcher);
}
@@ -22,10 +23,7 @@ void favorite_timeout_run(ViewDispatcher* view_dispatcher, SceneManager* scene_m
return;
}
FavoriteTImeoutCtx ctx = {
.view_dispatcher = view_dispatcher,
.scene_manager = scene_manager
};
FavoriteTImeoutCtx ctx = {.view_dispatcher = view_dispatcher, .scene_manager = scene_manager};
FuriTimer* timer = furi_timer_alloc(favorite_timeout_callback, FuriTimerTypeOnce, &ctx);
furi_timer_start(timer, timeout * furi_kernel_get_tick_frequency());
view_dispatcher_run(view_dispatcher);
@@ -36,7 +36,8 @@ static void archive_loader_callback(const void* message, void* context) {
}
}
static void archive_run_in_app(ArchiveBrowserView* browser, ArchiveFile_t* selected, bool favorites) {
static void
archive_run_in_app(ArchiveBrowserView* browser, ArchiveFile_t* selected, bool favorites) {
UNUSED(browser);
Loader* loader = furi_record_open(RECORD_LOADER);
@@ -48,13 +49,13 @@ static void archive_run_in_app(ArchiveBrowserView* browser, ArchiveFile_t* selec
}
status = loader_start(loader, flipper_app_name[selected->type], param);
} else {
const char* str = furi_string_get_cstr(selected->path);
if(favorites) {
const char* str = furi_string_get_cstr(selected->path);
char arg[strlen(str) + 4];
snprintf(arg, sizeof(arg), "fav%s", str);
status = loader_start(loader, flipper_app_name[selected->type], arg);
} else {
status = loader_start(loader, flipper_app_name[selected->type], furi_string_get_cstr(selected->path));
status = loader_start(loader, flipper_app_name[selected->type], str);
}
}
@@ -78,7 +78,11 @@ void xtreme_app_scene_interface_common_on_enter(void* context) {
variable_item_set_current_value_text(item, value ? "ON" : "OFF");
item = variable_item_list_add(
var_item_list, "Favorite Timeout", 61, xtreme_app_scene_interface_common_favorite_timeout_changed, app);
var_item_list,
"Favorite Timeout",
61,
xtreme_app_scene_interface_common_favorite_timeout_changed,
app);
variable_item_set_current_value_index(item, xtreme_settings->favorite_timeout);
char text[4];
snprintf(text, sizeof(text), "%lu S", xtreme_settings->favorite_timeout);