Skip to content

Commit

Permalink
fixed IR Import when empty, add hint when empty
Browse files Browse the repository at this point in the history
  • Loading branch information
rdefeo committed Jul 19, 2024
1 parent b477140 commit f848547
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions scenes/scene_action_ir_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion scenes/scene_items.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f848547

Please sign in to comment.