mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 17:58:36 -07:00
Desktop favorites pt1
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
#include <toolbox/saved_struct.h>
|
#include <toolbox/saved_struct.h>
|
||||||
#include <storage/storage.h>
|
#include <storage/storage.h>
|
||||||
|
|
||||||
#define DESKTOP_SETTINGS_VER (12)
|
#define DESKTOP_SETTINGS_VER (13)
|
||||||
|
|
||||||
#define DESKTOP_SETTINGS_PATH INT_PATH(DESKTOP_SETTINGS_FILE_NAME)
|
#define DESKTOP_SETTINGS_PATH INT_PATH(DESKTOP_SETTINGS_FILE_NAME)
|
||||||
#define DESKTOP_SETTINGS_MAGIC (0x17)
|
#define DESKTOP_SETTINGS_MAGIC (0x17)
|
||||||
@@ -43,6 +43,24 @@
|
|||||||
#define DISPLAY_BATTERY_RETRO_5 4
|
#define DISPLAY_BATTERY_RETRO_5 4
|
||||||
#define DISPLAY_BATTERY_BAR_PERCENT 5
|
#define DISPLAY_BATTERY_BAR_PERCENT 5
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
FavoriteAppLeftShort = 0,
|
||||||
|
FavoriteAppLeftLong,
|
||||||
|
FavoriteAppRightShort,
|
||||||
|
FavoriteAppRightLong,
|
||||||
|
|
||||||
|
FavoriteAppNumber,
|
||||||
|
} FavoriteAppShortcut;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
DummyAppLeft = 0,
|
||||||
|
DummyAppRight,
|
||||||
|
DummyAppDown,
|
||||||
|
DummyAppOk,
|
||||||
|
|
||||||
|
DummyAppNumber,
|
||||||
|
} DummyAppShortcut;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
InputKey data[MAX_PIN_SIZE];
|
InputKey data[MAX_PIN_SIZE];
|
||||||
uint8_t length;
|
uint8_t length;
|
||||||
@@ -53,12 +71,11 @@ typedef struct {
|
|||||||
} FavoriteApp;
|
} FavoriteApp;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
FavoriteApp favorite_primary;
|
|
||||||
FavoriteApp favorite_secondary;
|
|
||||||
FavoriteApp favorite_tertiary;
|
|
||||||
PinCode pin_code;
|
PinCode pin_code;
|
||||||
uint32_t auto_lock_delay_ms;
|
uint32_t auto_lock_delay_ms;
|
||||||
uint8_t displayBatteryPercentage;
|
uint8_t displayBatteryPercentage;
|
||||||
uint8_t dummy_mode;
|
uint8_t dummy_mode;
|
||||||
uint8_t display_clock;
|
uint8_t display_clock;
|
||||||
|
FavoriteApp favorite_apps[FavoriteAppNumber];
|
||||||
|
FavoriteApp dummy_apps[DummyAppNumber];
|
||||||
} DesktopSettings;
|
} DesktopSettings;
|
||||||
|
|||||||
@@ -87,6 +87,10 @@ bool desktop_scene_locked_on_event(void* context, SceneManagerEvent event) {
|
|||||||
desktop_unlock(desktop);
|
desktop_unlock(desktop);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
break;
|
break;
|
||||||
|
case DesktopLockedEventDoorsClosed:
|
||||||
|
notification_message(desktop->notification, &sequence_display_backlight_off);
|
||||||
|
consumed = true;
|
||||||
|
break;
|
||||||
case DesktopLockedEventUpdate:
|
case DesktopLockedEventUpdate:
|
||||||
if(desktop_view_locked_is_locked_hint_visible(desktop->locked_view)) {
|
if(desktop_view_locked_is_locked_hint_visible(desktop->locked_view)) {
|
||||||
notification_message(desktop->notification, &sequence_display_backlight_off);
|
notification_message(desktop->notification, &sequence_display_backlight_off);
|
||||||
|
|||||||
@@ -61,17 +61,23 @@ static void
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void desktop_scene_main_open_app_or_profile(Desktop* desktop, const char* path) {
|
static void desktop_scene_main_open_app_or_profile(Desktop* desktop, FavoriteApp* application) {
|
||||||
if(loader_start_with_gui_error(desktop->loader, path, NULL) != LoaderStatusOk) {
|
bool load_ok = false;
|
||||||
|
if(strlen(application->name_or_path) > 0) {
|
||||||
|
if(loader_start(desktop->loader, application->name_or_path, NULL, NULL) ==
|
||||||
|
LoaderStatusOk) {
|
||||||
|
load_ok = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!load_ok) {
|
||||||
loader_start(desktop->loader, "Passport", NULL, NULL);
|
loader_start(desktop->loader, "Passport", NULL, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void desktop_scene_main_start_favorite(Desktop* desktop, FavoriteApp* application) {
|
static void desktop_scene_main_start_favorite(Desktop* desktop, FavoriteApp* application) {
|
||||||
if(strlen(application->name_or_path) > 2) {
|
if(strlen(application->name_or_path) > 0) {
|
||||||
loader_start_with_gui_error(desktop->loader, application->name_or_path, NULL);
|
loader_start_with_gui_error(desktop->loader, application->name_or_path, NULL);
|
||||||
} else if(
|
} else {
|
||||||
(strlen(application->name_or_path) < 2) && (strcmp(application->name_or_path, "d") != 0)) {
|
|
||||||
loader_start(desktop->loader, LOADER_APPLICATIONS_NAME, NULL, NULL);
|
loader_start(desktop->loader, LOADER_APPLICATIONS_NAME, NULL, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,6 +118,12 @@ bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
|
|||||||
consumed = true;
|
consumed = true;
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
case DesktopMainEventLock:
|
||||||
|
scene_manager_set_scene_state(desktop->scene_manager, DesktopSceneLockMenu, 0);
|
||||||
|
desktop_lock(desktop);
|
||||||
|
consumed = true;
|
||||||
|
break;
|
||||||
|
|
||||||
case DesktopMainEventOpenLockMenu:
|
case DesktopMainEventOpenLockMenu:
|
||||||
scene_manager_next_scene(desktop->scene_manager, DesktopSceneLockMenu);
|
scene_manager_next_scene(desktop->scene_manager, DesktopSceneLockMenu);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
@@ -122,12 +134,6 @@ bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
|
|||||||
consumed = true;
|
consumed = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DesktopMainEventLock:
|
|
||||||
scene_manager_set_scene_state(desktop->scene_manager, DesktopSceneLockMenu, 0);
|
|
||||||
desktop_lock(desktop);
|
|
||||||
consumed = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case DesktopMainEventOpenArchive:
|
case DesktopMainEventOpenArchive:
|
||||||
#ifdef APP_ARCHIVE
|
#ifdef APP_ARCHIVE
|
||||||
desktop_switch_to_app(desktop, &FLIPPER_ARCHIVE);
|
desktop_switch_to_app(desktop, &FLIPPER_ARCHIVE);
|
||||||
@@ -141,21 +147,31 @@ bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case DesktopMainEventOpenFavoritePrimary:
|
case DesktopMainEventOpenFavoriteLeftShort:
|
||||||
DESKTOP_SETTINGS_LOAD(&desktop->settings);
|
DESKTOP_SETTINGS_LOAD(&desktop->settings);
|
||||||
desktop_scene_main_start_favorite(desktop, &desktop->settings.favorite_primary);
|
desktop_scene_main_start_favorite(
|
||||||
|
desktop, &desktop->settings.favorite_apps[FavoriteAppLeftShort]);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
break;
|
break;
|
||||||
case DesktopMainEventOpenFavoriteSecondary:
|
case DesktopMainEventOpenFavoriteLeftLong:
|
||||||
DESKTOP_SETTINGS_LOAD(&desktop->settings);
|
DESKTOP_SETTINGS_LOAD(&desktop->settings);
|
||||||
desktop_scene_main_start_favorite(desktop, &desktop->settings.favorite_secondary);
|
desktop_scene_main_start_favorite(
|
||||||
|
desktop, &desktop->settings.favorite_apps[FavoriteAppLeftLong]);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
break;
|
break;
|
||||||
case DesktopMainEventOpenFavoriteTertiary:
|
case DesktopMainEventOpenFavoriteRightShort:
|
||||||
DESKTOP_SETTINGS_LOAD(&desktop->settings);
|
DESKTOP_SETTINGS_LOAD(&desktop->settings);
|
||||||
desktop_scene_main_start_favorite(desktop, &desktop->settings.favorite_tertiary);
|
desktop_scene_main_start_favorite(
|
||||||
|
desktop, &desktop->settings.favorite_apps[FavoriteAppRightShort]);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
break;
|
break;
|
||||||
|
case DesktopMainEventOpenFavoriteRightLong:
|
||||||
|
DESKTOP_SETTINGS_LOAD(&desktop->settings);
|
||||||
|
desktop_scene_main_start_favorite(
|
||||||
|
desktop, &desktop->settings.favorite_apps[FavoriteAppRightLong]);
|
||||||
|
consumed = true;
|
||||||
|
break;
|
||||||
|
|
||||||
case DesktopAnimationEventCheckAnimation:
|
case DesktopAnimationEventCheckAnimation:
|
||||||
animation_manager_check_blocking_process(desktop->animation_manager);
|
animation_manager_check_blocking_process(desktop->animation_manager);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
@@ -166,39 +182,31 @@ bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
|
|||||||
break;
|
break;
|
||||||
case DesktopAnimationEventInteractAnimation:
|
case DesktopAnimationEventInteractAnimation:
|
||||||
if(!animation_manager_interact_process(desktop->animation_manager)) {
|
if(!animation_manager_interact_process(desktop->animation_manager)) {
|
||||||
loader_start(desktop->loader, "Passport", NULL, NULL);
|
DESKTOP_SETTINGS_LOAD(&desktop->settings);
|
||||||
|
if(!desktop->settings.dummy_mode) {
|
||||||
|
desktop_scene_main_open_app_or_profile(
|
||||||
|
desktop, &desktop->settings.favorite_apps[FavoriteAppRightShort]);
|
||||||
|
} else {
|
||||||
|
desktop_scene_main_open_app_or_profile(
|
||||||
|
desktop, &desktop->settings.dummy_apps[DummyAppRight]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
consumed = true;
|
consumed = true;
|
||||||
break;
|
break;
|
||||||
case DesktopMainEventOpenPassport: {
|
|
||||||
loader_start(desktop->loader, "Passport", NULL, NULL);
|
case DesktopDummyEventOpenLeft:
|
||||||
break;
|
|
||||||
}
|
|
||||||
case DesktopMainEventOpenGameMenu: {
|
|
||||||
desktop_scene_main_open_app_or_profile(desktop, EXT_PATH("/apps/Games/snake.fap"));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case DesktopMainEventOpenTetris: {
|
|
||||||
desktop_scene_main_open_app_or_profile(desktop, EXT_PATH("/apps/Games/tetris.fap"));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case DesktopMainEventOpenArkanoid: {
|
|
||||||
desktop_scene_main_open_app_or_profile(desktop, EXT_PATH("/apps/Games/arkanoid.fap"));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case DesktopMainEventOpenDOOM: {
|
|
||||||
desktop_scene_main_open_app_or_profile(desktop, EXT_PATH("/apps/Games/doom.fap"));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case DesktopMainEventOpenZombiez: {
|
|
||||||
desktop_scene_main_open_app_or_profile(desktop, EXT_PATH("/apps/Games/zombiez.fap"));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case DesktopMainEventOpenHeap: {
|
|
||||||
desktop_scene_main_open_app_or_profile(
|
desktop_scene_main_open_app_or_profile(
|
||||||
desktop, EXT_PATH("/apps/Games/heap_defence.fap"));
|
desktop, &desktop->settings.dummy_apps[DummyAppLeft]);
|
||||||
break;
|
break;
|
||||||
}
|
case DesktopDummyEventOpenDown:
|
||||||
|
desktop_scene_main_open_app_or_profile(
|
||||||
|
desktop, &desktop->settings.dummy_apps[DummyAppDown]);
|
||||||
|
break;
|
||||||
|
case DesktopDummyEventOpenOk:
|
||||||
|
desktop_scene_main_open_app_or_profile(
|
||||||
|
desktop, &desktop->settings.dummy_apps[DummyAppOk]);
|
||||||
|
break;
|
||||||
|
|
||||||
case DesktopLockedEventUpdate:
|
case DesktopLockedEventUpdate:
|
||||||
desktop_view_locked_update(desktop->locked_view);
|
desktop_view_locked_update(desktop->locked_view);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
|
|||||||
@@ -1,27 +1,30 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
DesktopMainEventLock,
|
||||||
DesktopMainEventOpenLockMenu,
|
DesktopMainEventOpenLockMenu,
|
||||||
DesktopMainEventOpenArchive,
|
DesktopMainEventOpenArchive,
|
||||||
DesktopMainEventOpenFavoritePrimary,
|
DesktopMainEventOpenFavoriteLeftShort,
|
||||||
DesktopMainEventOpenFavoriteSecondary,
|
DesktopMainEventOpenFavoriteLeftLong,
|
||||||
DesktopMainEventOpenFavoriteTertiary,
|
DesktopMainEventOpenFavoriteRightShort,
|
||||||
|
DesktopMainEventOpenFavoriteRightLong,
|
||||||
DesktopMainEventOpenMenu,
|
DesktopMainEventOpenMenu,
|
||||||
DesktopMainEventOpenDebug,
|
DesktopMainEventOpenDebug,
|
||||||
DesktopMainEventOpenPassport,
|
|
||||||
DesktopMainEventOpenPowerOff,
|
DesktopMainEventOpenPowerOff,
|
||||||
DesktopMainEventLock,
|
|
||||||
|
|
||||||
DesktopMainEventOpenGameMenu,
|
DesktopDummyEventOpenLeft,
|
||||||
DesktopMainEventOpenTetris,
|
DesktopDummyEventOpenDown,
|
||||||
DesktopMainEventOpenArkanoid,
|
DesktopDummyEventOpenOk,
|
||||||
DesktopMainEventOpenDOOM,
|
|
||||||
DesktopMainEventOpenZombiez,
|
// TODO add long press in Dummy mode & RightLong
|
||||||
DesktopMainEventOpenHeap,
|
DesktopDummyEventOpenUpLong,
|
||||||
|
DesktopDummyEventOpenDownLong,
|
||||||
|
DesktopDummyEventOpenLeftLong,
|
||||||
|
|
||||||
DesktopLockedEventUnlocked,
|
DesktopLockedEventUnlocked,
|
||||||
DesktopLockedEventUpdate,
|
DesktopLockedEventUpdate,
|
||||||
DesktopLockedEventShowPinInput,
|
DesktopLockedEventShowPinInput,
|
||||||
|
DesktopLockedEventDoorsClosed,
|
||||||
|
|
||||||
DesktopPinInputEventResetWrongPinLabel,
|
DesktopPinInputEventResetWrongPinLabel,
|
||||||
DesktopPinInputEventUnlocked,
|
DesktopPinInputEventUnlocked,
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ void desktop_view_locked_update(DesktopViewLocked* locked_view) {
|
|||||||
|
|
||||||
if(view_state == DesktopViewLockedStateDoorsClosing &&
|
if(view_state == DesktopViewLockedStateDoorsClosing &&
|
||||||
!desktop_view_locked_doors_move(model)) {
|
!desktop_view_locked_doors_move(model)) {
|
||||||
|
locked_view->callback(DesktopLockedEventDoorsClosed, locked_view->context);
|
||||||
model->view_state = DesktopViewLockedStateLocked;
|
model->view_state = DesktopViewLockedStateLocked;
|
||||||
} else if(view_state == DesktopViewLockedStateLockedHintShown) {
|
} else if(view_state == DesktopViewLockedStateLockedHintShown) {
|
||||||
model->view_state = DesktopViewLockedStateLocked;
|
model->view_state = DesktopViewLockedStateLocked;
|
||||||
|
|||||||
@@ -59,18 +59,18 @@ bool desktop_main_input_callback(InputEvent* event, void* context) {
|
|||||||
} else if(event->key == InputKeyDown) {
|
} else if(event->key == InputKeyDown) {
|
||||||
main_view->callback(DesktopMainEventOpenArchive, main_view->context);
|
main_view->callback(DesktopMainEventOpenArchive, main_view->context);
|
||||||
} else if(event->key == InputKeyLeft) {
|
} else if(event->key == InputKeyLeft) {
|
||||||
main_view->callback(DesktopMainEventOpenFavoritePrimary, main_view->context);
|
main_view->callback(DesktopMainEventOpenFavoriteLeftShort, main_view->context);
|
||||||
}
|
}
|
||||||
// Right key is handled by animation manager
|
// Right key short is handled by animation manager
|
||||||
} else if(event->type == InputTypeLong) {
|
} else if(event->type == InputTypeLong) {
|
||||||
if(event->key == InputKeyDown) {
|
if(event->key == InputKeyUp) {
|
||||||
|
main_view->callback(DesktopMainEventLock, main_view->context);
|
||||||
|
} else if(event->key == InputKeyDown) {
|
||||||
main_view->callback(DesktopMainEventOpenDebug, main_view->context);
|
main_view->callback(DesktopMainEventOpenDebug, main_view->context);
|
||||||
} else if(event->key == InputKeyLeft) {
|
} else if(event->key == InputKeyLeft) {
|
||||||
main_view->callback(DesktopMainEventOpenFavoriteSecondary, main_view->context);
|
main_view->callback(DesktopMainEventOpenFavoriteLeftLong, main_view->context);
|
||||||
} else if(event->key == InputKeyRight) {
|
} else if(event->key == InputKeyRight) {
|
||||||
main_view->callback(DesktopMainEventOpenFavoriteTertiary, main_view->context);
|
main_view->callback(DesktopMainEventOpenFavoriteRightLong, main_view->context);
|
||||||
} else if(event->key == InputKeyUp) {
|
|
||||||
main_view->callback(DesktopMainEventLock, main_view->context);
|
|
||||||
} else if(event->key == InputKeyOk) {
|
} else if(event->key == InputKeyOk) {
|
||||||
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
|
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
|
||||||
main_view->callback(DesktopAnimationEventNewIdleAnimation, main_view->context);
|
main_view->callback(DesktopAnimationEventNewIdleAnimation, main_view->context);
|
||||||
@@ -80,31 +80,26 @@ bool desktop_main_input_callback(InputEvent* event, void* context) {
|
|||||||
} else {
|
} else {
|
||||||
if(event->type == InputTypeShort) {
|
if(event->type == InputTypeShort) {
|
||||||
if(event->key == InputKeyOk) {
|
if(event->key == InputKeyOk) {
|
||||||
main_view->callback(
|
main_view->callback(DesktopDummyEventOpenOk, main_view->context);
|
||||||
DesktopMainEventOpenGameMenu, main_view->context); // OPENS Snake
|
|
||||||
} else if(event->key == InputKeyUp) {
|
} else if(event->key == InputKeyUp) {
|
||||||
main_view->callback(DesktopMainEventOpenLockMenu, main_view->context);
|
main_view->callback(DesktopMainEventOpenLockMenu, main_view->context);
|
||||||
} else if(event->key == InputKeyDown) {
|
} else if(event->key == InputKeyDown) {
|
||||||
main_view->callback(
|
main_view->callback(DesktopDummyEventOpenDown, main_view->context);
|
||||||
DesktopMainEventOpenTetris, main_view->context); // OPENS Tetris
|
|
||||||
} else if(event->key == InputKeyLeft) {
|
} else if(event->key == InputKeyLeft) {
|
||||||
main_view->callback(
|
main_view->callback(DesktopDummyEventOpenLeft, main_view->context);
|
||||||
DesktopMainEventOpenArkanoid, main_view->context); // OPENS Arkanoid
|
|
||||||
}
|
}
|
||||||
// Right key is handled by animation manager
|
// Right key short is handled by animation manager
|
||||||
} else if(event->type == InputTypeLong) {
|
} else if(event->type == InputTypeLong) {
|
||||||
if(event->key == InputKeyOk) {
|
if(event->key == InputKeyOk) {
|
||||||
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
|
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
|
||||||
main_view->callback(DesktopAnimationEventNewIdleAnimation, main_view->context);
|
main_view->callback(DesktopAnimationEventNewIdleAnimation, main_view->context);
|
||||||
}
|
}
|
||||||
} else if(event->key == InputKeyUp) {
|
} else if(event->key == InputKeyUp) {
|
||||||
main_view->callback(DesktopMainEventOpenDOOM, main_view->context); // OPENS DOOM
|
main_view->callback(DesktopDummyEventOpenUpLong, main_view->context);
|
||||||
} else if(event->key == InputKeyDown) {
|
} else if(event->key == InputKeyDown) {
|
||||||
main_view->callback(
|
main_view->callback(DesktopDummyEventOpenDownLong, main_view->context);
|
||||||
DesktopMainEventOpenZombiez, main_view->context); // OPENS Zombiez
|
|
||||||
} else if(event->key == InputKeyLeft) {
|
} else if(event->key == InputKeyLeft) {
|
||||||
main_view->callback(
|
main_view->callback(DesktopDummyEventOpenLeftLong, main_view->context);
|
||||||
DesktopMainEventOpenHeap, main_view->context); // OPENS Heap Defence
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
#include "../desktop_settings_app.h"
|
#include "../desktop_settings_app.h"
|
||||||
#include "applications.h"
|
#include "applications.h"
|
||||||
#include "desktop_settings_scene.h"
|
#include "desktop_settings_scene.h"
|
||||||
|
#include "desktop_settings_scene_i.h"
|
||||||
#include <flipper_application/flipper_application.h>
|
#include <flipper_application/flipper_application.h>
|
||||||
#include <storage/storage.h>
|
#include <storage/storage.h>
|
||||||
#include <dialogs/dialogs.h>
|
#include <dialogs/dialogs.h>
|
||||||
|
|
||||||
#define APPS_COUNT (FLIPPER_APPS_COUNT + FLIPPER_EXTERNAL_APPS_COUNT)
|
#define APPS_COUNT (FLIPPER_APPS_COUNT + FLIPPER_EXTERNAL_APPS_COUNT)
|
||||||
|
|
||||||
#define EXTERNAL_BROWSER_NAME ("Apps")
|
#define DEFAULT_INDEX (0)
|
||||||
#define EXTERNAL_BROWSER_INDEX (APPS_COUNT + 1)
|
#define EXTERNAL_BROWSER_NAME ("Apps Menu (Default)")
|
||||||
|
#define PASSPORT_NAME ("Passport (Default)")
|
||||||
|
|
||||||
|
#define EXTERNAL_APPLICATION_INDEX (1)
|
||||||
#define EXTERNAL_APPLICATION_NAME ("[Select App]")
|
#define EXTERNAL_APPLICATION_NAME ("[Select App]")
|
||||||
#define EXTERNAL_APPLICATION_INDEX (APPS_COUNT + 2)
|
|
||||||
|
|
||||||
#define NONE_APPLICATION_INDEX (APPS_COUNT + 3)
|
|
||||||
|
|
||||||
#define PRESELECTED_SPECIAL 0xffffffff
|
#define PRESELECTED_SPECIAL 0xffffffff
|
||||||
|
|
||||||
@@ -57,40 +57,32 @@ void desktop_settings_scene_favorite_on_enter(void* context) {
|
|||||||
Submenu* submenu = app->submenu;
|
Submenu* submenu = app->submenu;
|
||||||
submenu_reset(submenu);
|
submenu_reset(submenu);
|
||||||
|
|
||||||
uint32_t primary_favorite =
|
uint32_t favorite_id =
|
||||||
scene_manager_get_scene_state(app->scene_manager, DesktopSettingsAppSceneFavorite);
|
scene_manager_get_scene_state(app->scene_manager, DesktopSettingsAppSceneFavorite);
|
||||||
uint32_t pre_select_item = PRESELECTED_SPECIAL;
|
uint32_t pre_select_item = PRESELECTED_SPECIAL;
|
||||||
FavoriteApp* curr_favorite_app = NULL;
|
FavoriteApp* curr_favorite_app = NULL;
|
||||||
if(primary_favorite == 0) {
|
bool is_dummy_app = false;
|
||||||
curr_favorite_app = &app->settings.favorite_primary;
|
bool default_passport = false;
|
||||||
} else if(primary_favorite == 1) {
|
|
||||||
curr_favorite_app = &app->settings.favorite_secondary;
|
|
||||||
} else if(primary_favorite == 2) {
|
|
||||||
curr_favorite_app = &app->settings.favorite_tertiary;
|
|
||||||
} else {
|
|
||||||
curr_favorite_app = &app->settings.favorite_primary;
|
|
||||||
}
|
|
||||||
if(curr_favorite_app == NULL) {
|
|
||||||
// This should not happen!
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for(size_t i = 0; i < APPS_COUNT; i++) {
|
if((favorite_id & SCENE_STATE_SET_DUMMY_APP) == 0) {
|
||||||
const char* name = favorite_fap_get_app_name(i);
|
furi_assert(favorite_id < FavoriteAppNumber);
|
||||||
|
curr_favorite_app = &app->settings.favorite_apps[favorite_id];
|
||||||
submenu_add_item(submenu, name, i, desktop_settings_scene_favorite_submenu_callback, app);
|
if(favorite_id == FavoriteAppRightShort) {
|
||||||
|
default_passport = true;
|
||||||
// Select favorite item in submenu
|
|
||||||
if(!strcmp(name, curr_favorite_app->name_or_path)) {
|
|
||||||
pre_select_item = i;
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
favorite_id &= ~(SCENE_STATE_SET_DUMMY_APP);
|
||||||
|
furi_assert(favorite_id < DummyAppNumber);
|
||||||
|
curr_favorite_app = &app->settings.dummy_apps[favorite_id];
|
||||||
|
is_dummy_app = true;
|
||||||
|
default_passport = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Special case: Application browser
|
// Special case: Application browser
|
||||||
submenu_add_item(
|
submenu_add_item(
|
||||||
submenu,
|
submenu,
|
||||||
EXTERNAL_BROWSER_NAME,
|
default_passport ? (PASSPORT_NAME) : (EXTERNAL_BROWSER_NAME),
|
||||||
EXTERNAL_BROWSER_INDEX,
|
DEFAULT_INDEX,
|
||||||
desktop_settings_scene_favorite_submenu_callback,
|
desktop_settings_scene_favorite_submenu_callback,
|
||||||
app);
|
app);
|
||||||
|
|
||||||
@@ -102,28 +94,29 @@ void desktop_settings_scene_favorite_on_enter(void* context) {
|
|||||||
desktop_settings_scene_favorite_submenu_callback,
|
desktop_settings_scene_favorite_submenu_callback,
|
||||||
app);
|
app);
|
||||||
|
|
||||||
|
if(!is_dummy_app) {
|
||||||
|
for(size_t i = 0; i < APPS_COUNT; i++) {
|
||||||
|
const char* name = favorite_fap_get_app_name(i);
|
||||||
|
|
||||||
|
submenu_add_item(
|
||||||
|
submenu, name, i + 2, desktop_settings_scene_favorite_submenu_callback, app);
|
||||||
|
|
||||||
|
// Select favorite item in submenu
|
||||||
|
if(!strcmp(name, curr_favorite_app->name_or_path)) {
|
||||||
|
pre_select_item = i + 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(pre_select_item == PRESELECTED_SPECIAL) {
|
if(pre_select_item == PRESELECTED_SPECIAL) {
|
||||||
if(curr_favorite_app->name_or_path[0] == '\0') {
|
if(curr_favorite_app->name_or_path[0] == '\0') {
|
||||||
pre_select_item = EXTERNAL_BROWSER_INDEX;
|
pre_select_item = DEFAULT_INDEX;
|
||||||
} else {
|
} else {
|
||||||
pre_select_item = EXTERNAL_APPLICATION_INDEX;
|
pre_select_item = EXTERNAL_APPLICATION_INDEX;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
submenu_add_item(
|
submenu_set_header(submenu, is_dummy_app ? ("Dummy Mode app:") : ("Favorite app:"));
|
||||||
submenu,
|
|
||||||
"None (disable)",
|
|
||||||
NONE_APPLICATION_INDEX,
|
|
||||||
desktop_settings_scene_favorite_submenu_callback,
|
|
||||||
app);
|
|
||||||
|
|
||||||
if(primary_favorite == 0) {
|
|
||||||
submenu_set_header(submenu, "Primary favorite app:");
|
|
||||||
} else if(primary_favorite == 1) {
|
|
||||||
submenu_set_header(submenu, "Secondary favorite app:");
|
|
||||||
} else if(primary_favorite == 2) {
|
|
||||||
submenu_set_header(submenu, "Tertiary favorite app:");
|
|
||||||
}
|
|
||||||
submenu_set_selected_item(submenu, pre_select_item); // If set during loop, visual glitch.
|
submenu_set_selected_item(submenu, pre_select_item); // If set during loop, visual glitch.
|
||||||
|
|
||||||
view_dispatcher_switch_to_view(app->view_dispatcher, DesktopSettingsAppViewMenu);
|
view_dispatcher_switch_to_view(app->view_dispatcher, DesktopSettingsAppViewMenu);
|
||||||
@@ -134,26 +127,20 @@ bool desktop_settings_scene_favorite_on_event(void* context, SceneManagerEvent e
|
|||||||
bool consumed = false;
|
bool consumed = false;
|
||||||
FuriString* temp_path = furi_string_alloc_set_str(EXT_PATH("apps"));
|
FuriString* temp_path = furi_string_alloc_set_str(EXT_PATH("apps"));
|
||||||
|
|
||||||
uint32_t primary_favorite =
|
uint32_t favorite_id =
|
||||||
scene_manager_get_scene_state(app->scene_manager, DesktopSettingsAppSceneFavorite);
|
scene_manager_get_scene_state(app->scene_manager, DesktopSettingsAppSceneFavorite);
|
||||||
FavoriteApp* curr_favorite_app = NULL;
|
FavoriteApp* curr_favorite_app = NULL;
|
||||||
if(primary_favorite == 0) {
|
if((favorite_id & SCENE_STATE_SET_DUMMY_APP) == 0) {
|
||||||
curr_favorite_app = &app->settings.favorite_primary;
|
furi_assert(favorite_id < FavoriteAppNumber);
|
||||||
} else if(primary_favorite == 1) {
|
curr_favorite_app = &app->settings.favorite_apps[favorite_id];
|
||||||
curr_favorite_app = &app->settings.favorite_secondary;
|
|
||||||
} else if(primary_favorite == 2) {
|
|
||||||
curr_favorite_app = &app->settings.favorite_tertiary;
|
|
||||||
} else {
|
} else {
|
||||||
curr_favorite_app = &app->settings.favorite_primary;
|
favorite_id &= ~(SCENE_STATE_SET_DUMMY_APP);
|
||||||
}
|
furi_assert(favorite_id < DummyAppNumber);
|
||||||
if(curr_favorite_app == NULL) {
|
curr_favorite_app = &app->settings.dummy_apps[favorite_id];
|
||||||
// This should not happen!
|
|
||||||
furi_string_free(temp_path);
|
|
||||||
return consumed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(event.type == SceneManagerEventTypeCustom) {
|
if(event.type == SceneManagerEventTypeCustom) {
|
||||||
if(event.event == EXTERNAL_BROWSER_INDEX) {
|
if(event.event == DEFAULT_INDEX) {
|
||||||
curr_favorite_app->name_or_path[0] = '\0';
|
curr_favorite_app->name_or_path[0] = '\0';
|
||||||
consumed = true;
|
consumed = true;
|
||||||
} else if(event.event == EXTERNAL_APPLICATION_INDEX) {
|
} else if(event.event == EXTERNAL_APPLICATION_INDEX) {
|
||||||
@@ -180,13 +167,9 @@ bool desktop_settings_scene_favorite_on_event(void* context, SceneManagerEvent e
|
|||||||
MAX_APP_LENGTH);
|
MAX_APP_LENGTH);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
}
|
}
|
||||||
} else if(event.event == NONE_APPLICATION_INDEX) {
|
|
||||||
// Clear favorite app path and set it to "d" (disabled)
|
|
||||||
memset(curr_favorite_app->name_or_path, 0, strlen(curr_favorite_app->name_or_path));
|
|
||||||
strncpy(curr_favorite_app->name_or_path, "d", MAX_APP_LENGTH);
|
|
||||||
consumed = true;
|
|
||||||
} else {
|
} else {
|
||||||
const char* name = favorite_fap_get_app_name(event.event);
|
size_t app_index = event.event - 2;
|
||||||
|
const char* name = favorite_fap_get_app_name(app_index);
|
||||||
if(name) strncpy(curr_favorite_app->name_or_path, name, MAX_APP_LENGTH);
|
if(name) strncpy(curr_favorite_app->name_or_path, name, MAX_APP_LENGTH);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,3 +5,6 @@
|
|||||||
|
|
||||||
#define SCENE_STATE_PIN_ERROR_MISMATCH (0)
|
#define SCENE_STATE_PIN_ERROR_MISMATCH (0)
|
||||||
#define SCENE_STATE_PIN_ERROR_WRONG (1)
|
#define SCENE_STATE_PIN_ERROR_WRONG (1)
|
||||||
|
|
||||||
|
#define SCENE_STATE_SET_FAVORITE_APP (0)
|
||||||
|
#define SCENE_STATE_SET_DUMMY_APP (1 << 8)
|
||||||
|
|||||||
@@ -3,16 +3,24 @@
|
|||||||
|
|
||||||
#include "../desktop_settings_app.h"
|
#include "../desktop_settings_app.h"
|
||||||
#include "desktop_settings_scene.h"
|
#include "desktop_settings_scene.h"
|
||||||
|
#include "desktop_settings_scene_i.h"
|
||||||
#include <power/power_service/power.h>
|
#include <power/power_service/power.h>
|
||||||
|
|
||||||
#define SCENE_EVENT_SELECT_FAVORITE_PRIMARY 0
|
typedef enum {
|
||||||
#define SCENE_EVENT_SELECT_FAVORITE_SECONDARY 1
|
DesktopSettingsPinSetup = 0,
|
||||||
#define SCENE_EVENT_SELECT_FAVORITE_TERTIARY 2
|
DesktopSettingsAutoLockDelay,
|
||||||
#define SCENE_EVENT_SELECT_PIN_SETUP 3
|
DesktopSettingsBatteryDisplay,
|
||||||
#define SCENE_EVENT_SELECT_AUTO_LOCK_DELAY 4
|
DesktopSettingsClockDisplay,
|
||||||
#define SCENE_EVENT_SELECT_BATTERY_DISPLAY 5
|
DesktopSettingsChangeName,
|
||||||
#define SCENE_EVENT_SELECT_CLOCK_DISPLAY 6
|
DesktopSettingsFavoriteLeftShort,
|
||||||
#define SCENE_EVENT_SELECT_CHANGE_NAME 7
|
DesktopSettingsFavoriteLeftLong,
|
||||||
|
DesktopSettingsFavoriteRightShort,
|
||||||
|
DesktopSettingsFavoriteRightLong,
|
||||||
|
DesktopSettingsDummyLeft,
|
||||||
|
DesktopSettingsDummyRight,
|
||||||
|
DesktopSettingsDummyDown,
|
||||||
|
DesktopSettingsDummyOk,
|
||||||
|
} DesktopSettingsEntry;
|
||||||
|
|
||||||
#define AUTO_LOCK_DELAY_COUNT 9
|
#define AUTO_LOCK_DELAY_COUNT 9
|
||||||
const char* const auto_lock_delay_text[AUTO_LOCK_DELAY_COUNT] = {
|
const char* const auto_lock_delay_text[AUTO_LOCK_DELAY_COUNT] = {
|
||||||
@@ -87,12 +95,6 @@ void desktop_settings_scene_start_on_enter(void* context) {
|
|||||||
VariableItem* item;
|
VariableItem* item;
|
||||||
uint8_t value_index;
|
uint8_t value_index;
|
||||||
|
|
||||||
variable_item_list_add(variable_item_list, "Primary Favorite App", 1, NULL, NULL);
|
|
||||||
|
|
||||||
variable_item_list_add(variable_item_list, "Secondary Favorite App", 1, NULL, NULL);
|
|
||||||
|
|
||||||
variable_item_list_add(variable_item_list, "Tertiary Favorite App", 1, NULL, NULL);
|
|
||||||
|
|
||||||
variable_item_list_add(variable_item_list, "PIN Setup", 1, NULL, NULL);
|
variable_item_list_add(variable_item_list, "PIN Setup", 1, NULL, NULL);
|
||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
@@ -102,8 +104,6 @@ void desktop_settings_scene_start_on_enter(void* context) {
|
|||||||
desktop_settings_scene_start_auto_lock_delay_changed,
|
desktop_settings_scene_start_auto_lock_delay_changed,
|
||||||
app);
|
app);
|
||||||
|
|
||||||
variable_item_list_set_enter_callback(
|
|
||||||
variable_item_list, desktop_settings_scene_start_var_list_enter_callback, app);
|
|
||||||
value_index = value_index_uint32(
|
value_index = value_index_uint32(
|
||||||
app->settings.auto_lock_delay_ms, auto_lock_delay_value, AUTO_LOCK_DELAY_COUNT);
|
app->settings.auto_lock_delay_ms, auto_lock_delay_value, AUTO_LOCK_DELAY_COUNT);
|
||||||
variable_item_set_current_value_index(item, value_index);
|
variable_item_set_current_value_index(item, value_index);
|
||||||
@@ -137,6 +137,19 @@ void desktop_settings_scene_start_on_enter(void* context) {
|
|||||||
|
|
||||||
variable_item_list_add(variable_item_list, "Change Flipper Name", 0, NULL, app);
|
variable_item_list_add(variable_item_list, "Change Flipper Name", 0, NULL, app);
|
||||||
|
|
||||||
|
variable_item_list_add(variable_item_list, "Favorite App - Left Short", 1, NULL, NULL);
|
||||||
|
variable_item_list_add(variable_item_list, "Favorite App - Left Long", 1, NULL, NULL);
|
||||||
|
variable_item_list_add(variable_item_list, "Favorite App - Right Short", 1, NULL, NULL);
|
||||||
|
variable_item_list_add(variable_item_list, "Favorite App - Right Long", 1, NULL, NULL);
|
||||||
|
|
||||||
|
variable_item_list_add(variable_item_list, "Dummy Mode App - Left", 1, NULL, NULL);
|
||||||
|
variable_item_list_add(variable_item_list, "Dummy Mode App - Right", 1, NULL, NULL);
|
||||||
|
variable_item_list_add(variable_item_list, "Dummy Mode App - Down", 1, NULL, NULL);
|
||||||
|
variable_item_list_add(variable_item_list, "Dummy Mode App - Ok", 1, NULL, NULL);
|
||||||
|
|
||||||
|
variable_item_list_set_enter_callback(
|
||||||
|
variable_item_list, desktop_settings_scene_start_var_list_enter_callback, app);
|
||||||
|
|
||||||
view_dispatcher_switch_to_view(app->view_dispatcher, DesktopSettingsAppViewVarItemList);
|
view_dispatcher_switch_to_view(app->view_dispatcher, DesktopSettingsAppViewVarItemList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,35 +159,81 @@ bool desktop_settings_scene_start_on_event(void* context, SceneManagerEvent even
|
|||||||
|
|
||||||
if(event.type == SceneManagerEventTypeCustom) {
|
if(event.type == SceneManagerEventTypeCustom) {
|
||||||
switch(event.event) {
|
switch(event.event) {
|
||||||
case SCENE_EVENT_SELECT_FAVORITE_PRIMARY:
|
case DesktopSettingsPinSetup:
|
||||||
scene_manager_set_scene_state(app->scene_manager, DesktopSettingsAppSceneFavorite, 0);
|
|
||||||
scene_manager_next_scene(app->scene_manager, DesktopSettingsAppSceneFavorite);
|
|
||||||
consumed = true;
|
|
||||||
break;
|
|
||||||
case SCENE_EVENT_SELECT_FAVORITE_SECONDARY:
|
|
||||||
scene_manager_set_scene_state(app->scene_manager, DesktopSettingsAppSceneFavorite, 1);
|
|
||||||
scene_manager_next_scene(app->scene_manager, DesktopSettingsAppSceneFavorite);
|
|
||||||
consumed = true;
|
|
||||||
break;
|
|
||||||
case SCENE_EVENT_SELECT_FAVORITE_TERTIARY:
|
|
||||||
scene_manager_set_scene_state(app->scene_manager, DesktopSettingsAppSceneFavorite, 2);
|
|
||||||
scene_manager_next_scene(app->scene_manager, DesktopSettingsAppSceneFavorite);
|
|
||||||
consumed = true;
|
|
||||||
break;
|
|
||||||
case SCENE_EVENT_SELECT_PIN_SETUP:
|
|
||||||
scene_manager_next_scene(app->scene_manager, DesktopSettingsAppScenePinMenu);
|
scene_manager_next_scene(app->scene_manager, DesktopSettingsAppScenePinMenu);
|
||||||
consumed = true;
|
|
||||||
break;
|
break;
|
||||||
case SCENE_EVENT_SELECT_AUTO_LOCK_DELAY:
|
|
||||||
case SCENE_EVENT_SELECT_CLOCK_DISPLAY:
|
// case DesktopSettingsAutoLockDelay:
|
||||||
case SCENE_EVENT_SELECT_BATTERY_DISPLAY:
|
// case DesktopSettingsBatteryDisplay:
|
||||||
consumed = true;
|
// case DesktopSettingsClockDisplay:
|
||||||
break;
|
// Proces in default
|
||||||
case SCENE_EVENT_SELECT_CHANGE_NAME:
|
|
||||||
|
case DesktopSettingsChangeName:
|
||||||
scene_manager_next_scene(app->scene_manager, DesktopSettingsAppSceneChangeName);
|
scene_manager_next_scene(app->scene_manager, DesktopSettingsAppSceneChangeName);
|
||||||
consumed = true;
|
break;
|
||||||
|
|
||||||
|
case DesktopSettingsFavoriteLeftShort:
|
||||||
|
scene_manager_set_scene_state(
|
||||||
|
app->scene_manager,
|
||||||
|
DesktopSettingsAppSceneFavorite,
|
||||||
|
SCENE_STATE_SET_FAVORITE_APP | FavoriteAppLeftShort);
|
||||||
|
scene_manager_next_scene(app->scene_manager, DesktopSettingsAppSceneFavorite);
|
||||||
|
break;
|
||||||
|
case DesktopSettingsFavoriteLeftLong:
|
||||||
|
scene_manager_set_scene_state(
|
||||||
|
app->scene_manager,
|
||||||
|
DesktopSettingsAppSceneFavorite,
|
||||||
|
SCENE_STATE_SET_FAVORITE_APP | FavoriteAppLeftLong);
|
||||||
|
scene_manager_next_scene(app->scene_manager, DesktopSettingsAppSceneFavorite);
|
||||||
|
break;
|
||||||
|
case DesktopSettingsFavoriteRightShort:
|
||||||
|
scene_manager_set_scene_state(
|
||||||
|
app->scene_manager,
|
||||||
|
DesktopSettingsAppSceneFavorite,
|
||||||
|
SCENE_STATE_SET_FAVORITE_APP | FavoriteAppRightShort);
|
||||||
|
scene_manager_next_scene(app->scene_manager, DesktopSettingsAppSceneFavorite);
|
||||||
|
break;
|
||||||
|
case DesktopSettingsFavoriteRightLong:
|
||||||
|
scene_manager_set_scene_state(
|
||||||
|
app->scene_manager,
|
||||||
|
DesktopSettingsAppSceneFavorite,
|
||||||
|
SCENE_STATE_SET_FAVORITE_APP | FavoriteAppRightLong);
|
||||||
|
scene_manager_next_scene(app->scene_manager, DesktopSettingsAppSceneFavorite);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DesktopSettingsDummyLeft:
|
||||||
|
scene_manager_set_scene_state(
|
||||||
|
app->scene_manager,
|
||||||
|
DesktopSettingsAppSceneFavorite,
|
||||||
|
SCENE_STATE_SET_DUMMY_APP | DummyAppLeft);
|
||||||
|
scene_manager_next_scene(app->scene_manager, DesktopSettingsAppSceneFavorite);
|
||||||
|
break;
|
||||||
|
case DesktopSettingsDummyRight:
|
||||||
|
scene_manager_set_scene_state(
|
||||||
|
app->scene_manager,
|
||||||
|
DesktopSettingsAppSceneFavorite,
|
||||||
|
SCENE_STATE_SET_DUMMY_APP | DummyAppRight);
|
||||||
|
scene_manager_next_scene(app->scene_manager, DesktopSettingsAppSceneFavorite);
|
||||||
|
break;
|
||||||
|
case DesktopSettingsDummyDown:
|
||||||
|
scene_manager_set_scene_state(
|
||||||
|
app->scene_manager,
|
||||||
|
DesktopSettingsAppSceneFavorite,
|
||||||
|
SCENE_STATE_SET_DUMMY_APP | DummyAppDown);
|
||||||
|
scene_manager_next_scene(app->scene_manager, DesktopSettingsAppSceneFavorite);
|
||||||
|
break;
|
||||||
|
case DesktopSettingsDummyOk:
|
||||||
|
scene_manager_set_scene_state(
|
||||||
|
app->scene_manager,
|
||||||
|
DesktopSettingsAppSceneFavorite,
|
||||||
|
SCENE_STATE_SET_DUMMY_APP | DummyAppOk);
|
||||||
|
scene_manager_next_scene(app->scene_manager, DesktopSettingsAppSceneFavorite);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
consumed = true;
|
||||||
}
|
}
|
||||||
return consumed;
|
return consumed;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user