Quellcode durchsuchen

Merge pull request #34 from leedave/feature/favorites_menu

Feature/favorites menu
David Lee vor 10 Monaten
Ursprung
Commit
47a7381513
9 geänderte Dateien mit 33 neuen und 9 gelöschten Zeilen
  1. 6 0
      README.md
  2. 1 1
      application.fam
  3. 1 0
      docs/README.md
  4. 3 0
      docs/changelog.md
  5. 6 1
      scenes/xremote_scene_transmit.c
  6. 0 1
      scenes/xremote_scene_xr_list.c
  7. 14 5
      xremote.c
  8. 1 0
      xremote.h
  9. 1 1
      xremote_i.h

+ 6 - 0
README.md

@@ -30,6 +30,7 @@ Wouldn't it be nicer to simply click one button and let everything happen? This
 - Add pauses, becaue target systems are not always fast enough for multiple commands<br>
 - Run file containing chained IR & SubGhz commands<br>
 - Loop Transmissions until quit
+- Pin to Favorites menu (if supported by firmware)
 
 ### Settings
 - LED FX, allow the LED to blink
@@ -55,6 +56,11 @@ Then run the command:
  ```
 The application will be compiled and copied onto your device. 
 
+## Pin to Favorites feature
+This feature is only available in custom firmwares that support it or if you modify the owf to support the .xr file types.
+
+From the start screen on flipper press down to enter the favorites menu. Navigate left and right until you hit the tab "browser". From there navigate into the folder apps_data/xremote and select the command chain you want to add to your favorites. Select "Pin" from the context menu and your command chain will be available in the favorites menu. 
+
 ## Thank you notes
 - [Willy-JL](https://github.com/Willy-JL) for code contributions and distributing in Momentum Firmware
 - [Roguemaster](https://github.com/RogueMaster/flipperzero-firmware-wPlugins) for distributing in Roguemaster Firmware

+ 1 - 1
application.fam

@@ -6,7 +6,7 @@ App(
     stack_size=3 * 1024,
     fap_icon="icons/xremote_10px.png",
     fap_icon_assets="icons",
-    fap_version="3.2",
+    fap_version="3.3",
     fap_category="Infrared",
     fap_author="Leedave",
     fap_description="One-Click, sends multiple commands",

+ 1 - 0
docs/README.md

@@ -13,6 +13,7 @@ This app combines your IR and SubGhz commands into a playlist that can be run wi
 - Configure duration of IR Signals
 - Configure default duration of Encoded SubGhz Signals
 - Loop Transmissions until quit
+- Pin to Favorites menu (if supported by Firmware)
 
 ## What good is this?
 

+ 3 - 0
docs/changelog.md

@@ -1,3 +1,6 @@
+## 3.3
+- Added support for Favorites menu. 
+
 ## 3.2
 - Added support for external IR GPIO boards, tested on IR Blaster & Masta-Blasta. 
 

+ 6 - 1
scenes/xremote_scene_transmit.c

@@ -117,7 +117,12 @@ void xremote_scene_transmit_send_signal(void* context, CrossRemoteItem* item) {
 
 static void xremote_scene_transmit_end_scene(XRemote* app) {
     xremote_scene_ir_notification_message(app, InfraredNotificationMessageBlinkStop);
-    scene_manager_previous_scene(app->scene_manager);
+    if (app->loadFavorite) {
+        scene_manager_stop(app->scene_manager);
+        view_dispatcher_stop(app->view_dispatcher);
+    } else {
+        scene_manager_previous_scene(app->scene_manager);
+    }
 }
 
 static void xremote_scene_transmit_run_single_transmit(XRemote* app) {

+ 0 - 1
scenes/xremote_scene_xr_list.c

@@ -12,7 +12,6 @@ void xremote_scene_xr_list_on_enter(void* context) {
     furi_string_set(path, XREMOTE_APP_FOLDER);
 
     bool success = dialog_file_browser_show(
-        //app->dialogs, app->file_path, app->file_path, &browser_options);
         app->dialogs,
         app->file_path,
         path,

+ 14 - 5
xremote.c

@@ -53,6 +53,7 @@ XRemote* xremote_app_alloc() {
     app->stop_transmit = false;
     app->loop_transmit = 0;
     app->transmit_item = 0;
+    app->loadFavorite = false;
 
     // Load configs
     xremote_read_settings(app);
@@ -220,15 +221,10 @@ static void xremote_ir_load_settings(XRemote* app) {
 }
 
 int32_t xremote_app(void* p) {
-    UNUSED(p);
     XRemote* app = xremote_app_alloc();
     
     view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
 
-    //scene_manager_next_scene(app->scene_manager, XRemoteSceneInfoscreen); //Start with start screen
-    scene_manager_next_scene(
-        app->scene_manager, XRemoteSceneMenu); //if you want to directly start with Menu
-
     furi_hal_power_suppress_charge_enter();
     xremote_ir_load_settings(app);
 
@@ -237,6 +233,19 @@ int32_t xremote_app(void* p) {
     storage_common_mkdir(storage, XREMOTE_APP_FOLDER);
     furi_record_close(RECORD_STORAGE);
 
+    //bool loadFavorite = false;
+    if(p && strlen(p)) {
+        furi_string_set_str(app->file_path, p);
+        app->loadFavorite = xremote_cross_remote_load(app->cross_remote, app->file_path);
+    }
+    if (app->loadFavorite) {
+        scene_manager_next_scene(
+            app->scene_manager, XRemoteSceneTransmit); //if you loaded from Favorites
+    } else {
+        scene_manager_next_scene(
+            app->scene_manager, XRemoteSceneMenu); //if you want to directly start with Menu
+    }
+
     view_dispatcher_run(app->view_dispatcher);
 
     xremote_save_settings(app);

+ 1 - 0
xremote.h

@@ -56,6 +56,7 @@ typedef struct {
     char text_store[XREMOTE_TEXT_STORE_NUM][XREMOTE_TEXT_STORE_SIZE + 1];
     SubGhz* subghz;
     NumberInput* number_input;
+    bool loadFavorite;
 } XRemote;
 
 typedef enum {

+ 1 - 1
xremote_i.h

@@ -51,7 +51,7 @@
 #define XREMOTE_TEXT_STORE_SIZE 128
 #define XREMOTE_MAX_ITEM_NAME_LENGTH 22
 #define XREMOTE_MAX_REMOTE_NAME_LENGTH 22
-#define XREMOTE_VERSION "3.2"
+#define XREMOTE_VERSION FAP_VERSION
 
 #define INFRARED_APP_EXTENSION ".ir"
 #define INFRARED_APP_FOLDER EXT_PATH("infrared")