MX 1 год назад
Родитель
Сommit
7bba8524b6

+ 9 - 0
CHANGELOG.md

@@ -1,3 +1,12 @@
+## 0.6.1
+
+- Fix IR Import bus fault on empty
+- Add hint text on Empty group
+
+## 0.6.1
+
+- Several crash fixes when Importing files and Creating groups
+
 ## 0.6
 
 - Basic NFC support

+ 1 - 1
README.md

@@ -2,7 +2,7 @@
 
 ## Quick Action Remote Control for Flipperzero
 
-[Latest Version: 0.6](https://github.com/rdefeo/quac/releases)
+[Latest Version: 0.6.1](https://github.com/rdefeo/quac/releases)
 
 ![build status badge](https://github.com/rdefeo/quac/actions/workflows/build.yml/badge.svg)
 

+ 1 - 1
actions/action.h

@@ -10,4 +10,4 @@ struct Item;
  * @param   item        Selected item to transmit
  * @param   error       Error message if unsuccessful
 */
-void action_tx(void* context, Item* item, FuriString* error);
+void action_tx(void* context, Item* item, FuriString* error);

+ 1 - 1
actions/action_i.h

@@ -9,4 +9,4 @@ void action_subghz_tx(void* context, const FuriString* action_path, FuriString*
 void action_rfid_tx(void* context, const FuriString* action_path, FuriString* error);
 void action_ir_tx(void* context, const FuriString* action_path, FuriString* error);
 void action_nfc_tx(void* context, const FuriString* action_path, FuriString* error);
-void action_qpl_tx(void* context, const FuriString* action_path, FuriString* error);
+void action_qpl_tx(void* context, const FuriString* action_path, FuriString* error);

+ 1 - 1
actions/action_ir.c

@@ -67,4 +67,4 @@ void action_ir_tx(void* context, const FuriString* action_path, FuriString* erro
     furi_string_free(temp_str);
     flipper_format_free(fff_data_file);
     infrared_utils_signal_free(signal);
-}
+}

+ 1 - 1
actions/action_ir_utils.h

@@ -7,7 +7,7 @@
 
 #include <flipper_format/flipper_format.h>
 
-#define INFRARED_FILE_TYPE "IR signals file"
+#define INFRARED_FILE_TYPE    "IR signals file"
 #define INFRARED_FILE_VERSION 1
 
 typedef struct {

+ 1 - 1
actions/action_nfc.c

@@ -42,4 +42,4 @@ void action_nfc_tx(void* context, const FuriString* action_path, FuriString* err
     nfc_device_clear(device); // probably not needed?
     nfc_free(nfc);
     nfc_device_free(device);
-}
+}

+ 1 - 1
actions/action_qpl.c

@@ -170,4 +170,4 @@ void action_qpl_tx(void* context, const FuriString* action_path, FuriString* err
     furi_string_free(buffer);
     file_stream_close(file);
     stream_free(file);
-}
+}

+ 1 - 1
actions/action_rfid.c

@@ -12,7 +12,7 @@
 #include "action_i.h"
 #include "quac.h"
 
-#define RFID_FILE_TYPE "Flipper RFID key"
+#define RFID_FILE_TYPE    "Flipper RFID key"
 #define RFID_FILE_VERSION 1
 
 // lifted from flipperzero-firmware/applications/main/lfrfid/lfrfid_cli.c

+ 1 - 1
application.fam

@@ -8,7 +8,7 @@ App(
     stack_size=2 * 1024,
     fap_category="Tools",
     # Optional values
-    fap_version="0.6",
+    fap_version="0.6.2",
     fap_icon="images/quac.png",  # 10x10 1-bit PNG
     fap_description="Quick Action remote control app",
     fap_author="Roberto De Feo",

+ 1 - 1
item.c

@@ -167,4 +167,4 @@ ItemType item_get_item_type_from_extension(const char* ext) {
         type = Item_Playlist;
     }
     return type;
-}
+}

+ 2 - 2
item.h

@@ -4,7 +4,7 @@
 
 // Max length of a filename, final path element only
 #define MAX_NAME_LEN 64
-#define MAX_EXT_LEN 6
+#define MAX_EXT_LEN  6
 
 /** Defines an individual item action or item group. Each object contains
  * the relevant file and type information needed to both render correctly
@@ -62,4 +62,4 @@ void item_prettify_name(FuriString* name);
 /** Return the ItemType enum for the given extension
  * @param   ext     File extension
 */
-ItemType item_get_item_type_from_extension(const char* ext);
+ItemType item_get_item_type_from_extension(const char* ext);

+ 8 - 5
quac.h

@@ -16,8 +16,8 @@
 #include "views/action_menu.h"
 #include "item.h"
 
-#define QUAC_NAME "Quac!"
-#define QUAC_VERSION "v0.6"
+#define QUAC_NAME    "Quac!"
+#define QUAC_VERSION "v0.6.2"
 #define QUAC_ABOUT                                    \
     "Quick Action remote control\n" QUAC_VERSION "\n" \
     "github.com/rdefeo/quac"
@@ -25,9 +25,12 @@
 
 // Location of our actions and folders
 #define QUAC_SETTINGS_FILENAME ".quac.conf"
-#define QUAC_SETTINGS_PATH APP_DATA_PATH(QUAC_SETTINGS_FILENAME)
+#define QUAC_SETTINGS_PATH     APP_DATA_PATH(QUAC_SETTINGS_FILENAME)
 
-typedef enum { QUAC_APP_PORTRAIT, QUAC_APP_LANDSCAPE } QuacAppLayout;
+typedef enum {
+    QUAC_APP_PORTRAIT,
+    QUAC_APP_LANDSCAPE
+} QuacAppLayout;
 
 typedef struct App {
     SceneManager* scene_manager;
@@ -64,4 +67,4 @@ typedef struct App {
 } App;
 
 App* app_alloc();
-void app_free(App* app);
+void app_free(App* app);

+ 2 - 2
quac_settings.c

@@ -3,7 +3,7 @@
 #include <flipper_format/flipper_format.h>
 
 // Quac Settings File Info
-#define QUAC_SETTINGS_FILE_TYPE "Quac Settings File"
+#define QUAC_SETTINGS_FILE_TYPE    "Quac Settings File"
 #define QUAC_SETTINGS_FILE_VERSION 1
 
 void quac_set_default_settings(App* app) {
@@ -176,4 +176,4 @@ void quac_save_settings(App* app) {
 
     flipper_format_file_close(fff_settings);
     flipper_format_free(fff_settings);
-}
+}

+ 1 - 1
scenes/scene_about.c

@@ -38,4 +38,4 @@ bool scene_about_on_event(void* context, SceneManagerEvent event) {
 void scene_about_on_exit(void* context) {
     App* app = context;
     popup_reset(app->popup);
-}
+}

+ 1 - 1
scenes/scene_action_create_group.c

@@ -88,4 +88,4 @@ bool scene_action_create_group_on_event(void* context, SceneManagerEvent event)
 void scene_action_create_group_on_exit(void* context) {
     App* app = context;
     text_input_reset(app->text_input);
-}
+}

+ 8 - 3
scenes/scene_action_ir_list.c

@@ -8,6 +8,7 @@
 #include "quac.h"
 #include "scenes.h"
 #include "scene_action_ir_list.h"
+#include "../actions/action.h"
 #include "../actions/action_ir_utils.h"
 
 #include <flipper_format/flipper_format.h>
@@ -78,8 +79,12 @@ bool scene_action_ir_list_on_event(void* context, SceneManagerEvent event) {
             flipper_format_file_close(fff_data_file);
 
             // generate the new path, based on current item's dir and new command name
-            Item* item = ItemArray_get(app->items_view->items, app->selected_item);
-            path_extract_dirname(furi_string_get_cstr(item->path), file_name);
+            if(app->selected_item != EMPTY_ACTION_INDEX) {
+                Item* item = ItemArray_get(app->items_view->items, app->selected_item);
+                path_extract_dirname(furi_string_get_cstr(item->path), file_name);
+            } else {
+                furi_string_set(file_name, app->items_view->path);
+            }
             furi_string_cat_printf(file_name, "/%s.ir", furi_string_get_cstr(name));
 
             FURI_LOG_I(TAG, "Writing new IR file: %s", furi_string_get_cstr(file_name));
@@ -112,4 +117,4 @@ bool scene_action_ir_list_on_event(void* context, SceneManagerEvent event) {
 void scene_action_ir_list_on_exit(void* context) {
     App* app = context;
     submenu_reset(app->sub_menu);
-}
+}

+ 1 - 1
scenes/scene_action_rename.c

@@ -101,4 +101,4 @@ bool scene_action_rename_on_event(void* context, SceneManagerEvent event) {
 void scene_action_rename_on_exit(void* context) {
     App* app = context;
     text_input_reset(app->text_input);
-}
+}

+ 1 - 1
scenes/scene_action_settings.c

@@ -304,4 +304,4 @@ void scene_action_settings_on_exit(void* context) {
     ItemsView* new_items = item_get_items_view_from_path(app, app->items_view->path);
     item_items_view_free(app->items_view);
     app->items_view = new_items;
-}
+}

+ 2 - 2
scenes/scene_items.c

@@ -75,7 +75,7 @@ void scene_items_on_enter(void* context) {
         // Add a bogus item - this lets the user still access the Action menu to import, etc
         action_menu_add_item(
             menu,
-            "<Empty>",
+            "<Empty, Hold Right>",
             EMPTY_ACTION_INDEX,
             scene_items_item_callback,
             ActionMenuItemTypeGroup,
@@ -180,4 +180,4 @@ void scene_items_on_exit(void* context) {
     App* app = context;
     ActionMenu* menu = app->action_menu;
     action_menu_reset(menu);
-}
+}

+ 1 - 1
scenes/scene_settings.c

@@ -218,4 +218,4 @@ void scene_settings_on_exit(void* context) {
     variable_item_list_reset(vil);
 
     quac_save_settings(app);
-}
+}

+ 6 - 6
views/action_menu.c

@@ -11,14 +11,14 @@
 
 #include "quac_icons.h"
 
-#define ITEM_FIRST_OFFSET 17
-#define ITEM_NEXT_OFFSET 4
-#define ITEM_HEIGHT 14
-#define ITEM_WIDTH 64
+#define ITEM_FIRST_OFFSET  17
+#define ITEM_NEXT_OFFSET   4
+#define ITEM_HEIGHT        14
+#define ITEM_WIDTH         64
 #define BUTTONS_PER_SCREEN 6
 
 #define ITEMS_PER_SCREEN_LANDSCAPE 3
-#define ITEMS_PER_SCREEN_PORTRAIT 6
+#define ITEMS_PER_SCREEN_PORTRAIT  6
 
 static const Icon* ActionMenuIcons[] = {
     [ActionMenuItemTypeSubGHz] = &I_SubGHz_10px,
@@ -525,4 +525,4 @@ void action_menu_set_selected_item(ActionMenu* action_menu, uint32_t index) {
             },
             true);
     }
-}
+}

+ 1 - 1
views/action_menu.h

@@ -117,4 +117,4 @@ void action_menu_set_selected_item(ActionMenu* action_menu, uint32_t index);
 
 #ifdef __cplusplus
 }
-#endif
+#endif