mirror of
https://github.com/UberGuidoZ/Flipper.git
synced 2026-09-18 17:21:30 +00:00
Removing FAP files (use FlipC or Official store!)
This commit is contained in:
+30
@@ -0,0 +1,30 @@
|
||||
#include "storage_DolphinBackup_scene.h"
|
||||
|
||||
// Generate scene on_enter handlers array
|
||||
#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_enter,
|
||||
void (*const storage_DolphinBackup_on_enter_handlers[])(void*) = {
|
||||
#include "storage_DolphinBackup_scene_config.h"
|
||||
};
|
||||
#undef ADD_SCENE
|
||||
|
||||
// Generate scene on_event handlers array
|
||||
#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_event,
|
||||
bool (*const storage_DolphinBackup_on_event_handlers[])(void* context, SceneManagerEvent event) = {
|
||||
#include "storage_DolphinBackup_scene_config.h"
|
||||
};
|
||||
#undef ADD_SCENE
|
||||
|
||||
// Generate scene on_exit handlers array
|
||||
#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_exit,
|
||||
void (*const storage_DolphinBackup_on_exit_handlers[])(void* context) = {
|
||||
#include "storage_DolphinBackup_scene_config.h"
|
||||
};
|
||||
#undef ADD_SCENE
|
||||
|
||||
// Initialize scene handlers configuration structure
|
||||
const SceneManagerHandlers storage_DolphinBackup_scene_handlers = {
|
||||
.on_enter_handlers = storage_DolphinBackup_on_enter_handlers,
|
||||
.on_event_handlers = storage_DolphinBackup_on_event_handlers,
|
||||
.on_exit_handlers = storage_DolphinBackup_on_exit_handlers,
|
||||
.scene_num = StorageDolphinBackupSceneNum,
|
||||
};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include <gui/scene_manager.h>
|
||||
|
||||
// Generate scene id and total number
|
||||
#define ADD_SCENE(prefix, name, id) StorageDolphinBackup##id,
|
||||
typedef enum {
|
||||
#include "storage_DolphinBackup_scene_config.h"
|
||||
StorageDolphinBackupSceneNum,
|
||||
} StorageDolphinBackupScene;
|
||||
#undef ADD_SCENE
|
||||
|
||||
extern const SceneManagerHandlers storage_DolphinBackup_scene_handlers;
|
||||
|
||||
// Generate scene on_enter handlers declaration
|
||||
#define ADD_SCENE(prefix, name, id) void prefix##_scene_##name##_on_enter(void*);
|
||||
#include "storage_DolphinBackup_scene_config.h"
|
||||
#undef ADD_SCENE
|
||||
|
||||
// Generate scene on_event handlers declaration
|
||||
#define ADD_SCENE(prefix, name, id) \
|
||||
bool prefix##_scene_##name##_on_event(void* context, SceneManagerEvent event);
|
||||
#include "storage_DolphinBackup_scene_config.h"
|
||||
#undef ADD_SCENE
|
||||
|
||||
// Generate scene on_exit handlers declaration
|
||||
#define ADD_SCENE(prefix, name, id) void prefix##_scene_##name##_on_exit(void* context);
|
||||
#include "storage_DolphinBackup_scene_config.h"
|
||||
#undef ADD_SCENE
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
ADD_SCENE(storage_DolphinBackup, confirm, Confirm)
|
||||
ADD_SCENE(storage_DolphinBackup, progress, Progress)
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
#include "../storage_DolphinBackup.h"
|
||||
#include "gui/canvas.h"
|
||||
#include "gui/modules/widget_elements/widget_element_i.h"
|
||||
#include "storage/storage.h"
|
||||
|
||||
static void storage_DolphinBackup_scene_confirm_widget_callback(
|
||||
GuiButtonType result,
|
||||
InputType type,
|
||||
void* context) {
|
||||
StorageDolphinBackup* app = context;
|
||||
furi_assert(app);
|
||||
if(type == InputTypeShort) {
|
||||
if(result == GuiButtonTypeRight) {
|
||||
view_dispatcher_send_custom_event(
|
||||
app->view_dispatcher, DolphinBackupCustomEventConfirm);
|
||||
} else if(result == GuiButtonTypeLeft) {
|
||||
view_dispatcher_send_custom_event(app->view_dispatcher, DolphinBackupCustomEventExit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void storage_DolphinBackup_scene_confirm_on_enter(void* context) {
|
||||
StorageDolphinBackup* app = context;
|
||||
|
||||
widget_add_button_element(
|
||||
app->widget,
|
||||
GuiButtonTypeLeft,
|
||||
"Cancel",
|
||||
storage_DolphinBackup_scene_confirm_widget_callback,
|
||||
app);
|
||||
widget_add_button_element(
|
||||
app->widget,
|
||||
GuiButtonTypeRight,
|
||||
"Confirm",
|
||||
storage_DolphinBackup_scene_confirm_widget_callback,
|
||||
app);
|
||||
|
||||
widget_add_string_element(
|
||||
app->widget, 64, 10, AlignCenter, AlignCenter, FontPrimary, "SD Card Present");
|
||||
widget_add_string_multiline_element(
|
||||
app->widget,
|
||||
64,
|
||||
32,
|
||||
AlignCenter,
|
||||
AlignCenter,
|
||||
FontSecondary,
|
||||
"Copy data from\ninternal storage to SD card?");
|
||||
|
||||
view_dispatcher_switch_to_view(app->view_dispatcher, StorageDolphinBackupViewWidget);
|
||||
}
|
||||
|
||||
bool storage_DolphinBackup_scene_confirm_on_event(void* context, SceneManagerEvent event) {
|
||||
StorageDolphinBackup* app = context;
|
||||
bool consumed = false;
|
||||
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
if(event.event == DolphinBackupCustomEventConfirm) {
|
||||
scene_manager_next_scene(app->scene_manager, StorageDolphinBackupProgress);
|
||||
consumed = true;
|
||||
} else if(event.event == DolphinBackupCustomEventExit) {
|
||||
view_dispatcher_stop(app->view_dispatcher);
|
||||
}
|
||||
}
|
||||
|
||||
return consumed;
|
||||
}
|
||||
|
||||
void storage_DolphinBackup_scene_confirm_on_exit(void* context) {
|
||||
StorageDolphinBackup* app = context;
|
||||
widget_reset(app->widget);
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
#include "../storage_DolphinBackup.h"
|
||||
|
||||
void storage_DolphinBackup_scene_progress_on_enter(void* context) {
|
||||
StorageDolphinBackup* app = context;
|
||||
|
||||
widget_add_string_element(
|
||||
app->widget, 64, 10, AlignCenter, AlignCenter, FontPrimary, "Moving...");
|
||||
|
||||
view_dispatcher_switch_to_view(app->view_dispatcher, StorageDolphinBackupViewWidget);
|
||||
|
||||
storage_DolphinBackup_perform();
|
||||
view_dispatcher_send_custom_event(app->view_dispatcher, DolphinBackupCustomEventExit);
|
||||
}
|
||||
|
||||
bool storage_DolphinBackup_scene_progress_on_event(void* context, SceneManagerEvent event) {
|
||||
StorageDolphinBackup* app = context;
|
||||
bool consumed = false;
|
||||
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
view_dispatcher_stop(app->view_dispatcher);
|
||||
} else if(event.type == SceneManagerEventTypeBack) {
|
||||
consumed = true;
|
||||
}
|
||||
|
||||
return consumed;
|
||||
}
|
||||
|
||||
void storage_DolphinBackup_scene_progress_on_exit(void* context) {
|
||||
StorageDolphinBackup* app = context;
|
||||
widget_reset(app->widget);
|
||||
}
|
||||
Reference in New Issue
Block a user