فهرست منبع

SubGHz Remote: Port changes from firmware

- Different save folder
- External app, not main menu
- Short back to exit (or stop if currently sending)
- Use firmware icons
Willy-JL 1 سال پیش
والد
کامیت
5de1538681

+ 1 - 3
subghz_remote/application.fam

@@ -22,10 +22,8 @@
 App(
     appid="subghz_remote",
     name="Sub-GHz Remote",
-    apptype=FlipperAppType.MENUEXTERNAL,
+    apptype=FlipperAppType.EXTERNAL,
     entry_point="subghz_remote_app",
-    icon="A_SubGHzRemote_14",
-    order=11,
     requires=[
         "gui",
         "dialogs",

BIN
subghz_remote/icons/DolphinNice_96x59.png


+ 1 - 1
subghz_remote/scenes/subrem_scene_edit_preview.c

@@ -20,7 +20,7 @@ void subrem_scene_edit_preview_on_enter(void* context) {
 
     // Setup view
     Popup* popup = app->popup;
-    popup_set_icon(popup, 32, 5, &I_DolphinNice_96x59);
+    popup_set_icon(popup, 36, 5, &I_DolphinDone_80x58);
     popup_set_header(popup, "Saved!", 13, 22, AlignLeft, AlignBottom);
     popup_set_timeout(popup, 1500);
     popup_set_context(popup, app);

+ 1 - 1
subghz_remote/subghz_remote_app_i.h

@@ -24,7 +24,7 @@
 
 #include <flipper_format/flipper_format_i.h>
 
-#define SUBREM_APP_FOLDER EXT_PATH("subghz_remote")
+#define SUBREM_APP_FOLDER EXT_PATH("subghz/remote")
 #define SUBREM_MAX_LEN_NAME 64
 
 typedef struct {

+ 17 - 9
subghz_remote/views/remote.c

@@ -216,19 +216,27 @@ bool subrem_view_remote_input(InputEvent* event, void* context) {
     furi_assert(context);
     SubRemViewRemote* subrem_view_remote = context;
 
-    if(event->key == InputKeyBack && event->type == InputTypeLong) {
-        subrem_view_remote->callback(SubRemCustomEventViewRemoteBack, subrem_view_remote->context);
-        return true;
-    } else if(event->key == InputKeyBack && event->type == InputTypeShort) {
+    if(event->key == InputKeyBack && event->type == InputTypePress) {
+        bool is_stopping = false;
         with_view_model(
             subrem_view_remote->view,
             SubRemViewRemoteModel * model,
-            { model->pressed_btn = 0; },
+            {
+                if(model->state == SubRemViewRemoteStateSending) {
+                    is_stopping = true;
+                    model->pressed_btn = 0;
+                }
+            },
             true);
-        subrem_view_remote->callback(
-            SubRemCustomEventViewRemoteForcedStop, subrem_view_remote->context);
-        return true;
-    } else if(event->key == InputKeyBack) {
+
+        //Cant send exit the app inside that with_model,locks the model and the app will hang and not unload!
+        if(is_stopping)
+            subrem_view_remote->callback(
+                SubRemCustomEventViewRemoteForcedStop, subrem_view_remote->context);
+        else
+            subrem_view_remote->callback(
+                SubRemCustomEventViewRemoteBack, subrem_view_remote->context);
+
         return true;
     }
     // BACK button processing end