Skip to content

Commit 90297cb

Browse files
committed
fixed nfc and unknown icons
1 parent 560e958 commit 90297cb

File tree

11 files changed

+40
-20
lines changed

11 files changed

+40
-20
lines changed

actions/action_ir.c

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,18 @@ void action_ir_tx(void* context, const FuriString* action_path, FuriString* erro
117117
break;
118118
}
119119

120-
// FURI_LOG_I(
121-
// TAG,
122-
// "IR: Sending parsed => %s %lu %lu",
123-
// infrared_get_protocol_name(signal->payload.message.protocol),
124-
// signal->payload.message.address,
125-
// signal->payload.message.command);
120+
FURI_LOG_I(
121+
TAG,
122+
"IR: Sending (%s) type=parsed => %s %lu %lu",
123+
file_name,
124+
infrared_get_protocol_name(signal->payload.message.protocol),
125+
signal->payload.message.address,
126+
signal->payload.message.command);
126127

127128
infrared_send(&signal->payload.message, 1);
128129

130+
FURI_LOG_I(TAG, "IR: Send complete");
131+
129132
} else if(!furi_string_cmp_str(temp_str, "raw")) {
130133
// FURI_LOG_I(TAG, "IR File is RAW");
131134
signal->is_raw = true;
@@ -158,19 +161,22 @@ void action_ir_tx(void* context, const FuriString* action_path, FuriString* erro
158161
break;
159162
}
160163

161-
// FURI_LOG_I(
162-
// TAG,
163-
// "IR: Sending raw => %d timings, %lu Hz, %f",
164-
// signal->payload.raw.timings_size,
165-
// signal->payload.raw.frequency,
166-
// (double)signal->payload.raw.duty_cycle);
164+
FURI_LOG_I(
165+
TAG,
166+
"IR: Sending (%s) type=raw => %d timings, %lu Hz, %f",
167+
file_name,
168+
signal->payload.raw.timings_size,
169+
signal->payload.raw.frequency,
170+
(double)signal->payload.raw.duty_cycle);
167171

168172
infrared_send_raw_ext(
169173
signal->payload.raw.timings,
170174
signal->payload.raw.timings_size,
171175
true,
172176
signal->payload.raw.frequency,
173177
signal->payload.raw.duty_cycle);
178+
179+
FURI_LOG_I(TAG, "IR: Send complete");
174180
} else {
175181
ACTION_SET_ERROR("IR: Unknown type: %s", furi_string_get_cstr(temp_str));
176182
break;

actions/action_rfid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void action_rfid_tx(void* context, const FuriString* action_path, FuriString* er
9191
lfrfid_worker_emulate_start(worker, protocol);
9292

9393
int16_t time_ms = app->settings.rfid_duration;
94-
FURI_LOG_I(TAG, "RFID: Emulating RFID (%s) for %d ms", file_name, time_ms);
94+
FURI_LOG_I(TAG, "RFID: Emulating (%s) for %d ms", file_name, time_ms);
9595
int16_t interval_ms = 100;
9696
while(time_ms > 0) {
9797
furi_delay_ms(interval_ms);

application.fam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ App(
88
stack_size=2 * 1024,
99
fap_category="Tools",
1010
# Optional values
11-
fap_version="0.5.1",
11+
fap_version="0.6",
1212
fap_icon="quac.png", # 10x10 1-bit PNG
1313
fap_description="Quick Action remote control app",
1414
fap_author="Roberto De Feo",

images/Unknown_10px.png

312 Bytes
Loading

item.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,16 @@ ItemsView* item_get_items_view_from_path(void* context, const FuriString* input_
9696

9797
Item* item = ItemArray_push_new(iview->items);
9898

99-
// Action files have extensions, so item->ext starts with '.'
100-
item->ext[0] = 0;
101-
path_extract_extension(path, item->ext, MAX_EXT_LEN);
102-
item->type = item_get_item_type_from_extension(item->ext);
99+
FileInfo fileinfo;
100+
if(storage_common_stat(app->storage, found_path, &fileinfo) == FSE_OK &&
101+
file_info_is_dir(&fileinfo)) {
102+
item->type = Item_Group;
103+
} else {
104+
// Action files have extensions, so item->ext starts with '.'
105+
item->ext[0] = 0;
106+
path_extract_extension(path, item->ext, MAX_EXT_LEN);
107+
item->type = item_get_item_type_from_extension(item->ext);
108+
}
103109

104110
item->name = furi_string_alloc();
105111
path_extract_filename_no_ext(found_path, item->name);
@@ -147,7 +153,7 @@ void item_prettify_name(FuriString* name) {
147153
}
148154

149155
ItemType item_get_item_type_from_extension(const char* ext) {
150-
ItemType type = Item_Group;
156+
ItemType type = Item_Unknown;
151157

152158
if(!strcmp(ext, ".sub")) {
153159
type = Item_SubGhz;

item.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ typedef enum {
1919
Item_Playlist,
2020
Item_Group,
2121
Item_Settings,
22+
Item_Unknown,
2223
Item_count
2324
} ItemType;
2425

quac.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// #pragma GCC optimize("O0")
2222

2323
#define QUAC_NAME "Quac!"
24-
#define QUAC_VERSION "v0.5.1"
24+
#define QUAC_VERSION "v0.6"
2525
#define QUAC_ABOUT \
2626
"Quick Action remote control\n" QUAC_VERSION "\n" \
2727
"github.com/rdefeo/quac"

scenes/scene_action_settings.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,12 @@ static bool scene_action_settings_import_file_browser_callback(
8181
memcpy(*icon, icon_get_data(&I_RFID_10px), 32);
8282
} else if(!strcmp(ext, ".ir")) {
8383
memcpy(*icon, icon_get_data(&I_IR_10px), 32);
84+
} else if(!strcmp(ext, ".nfc")) {
85+
memcpy(*icon, icon_get_data(&I_NFC_10px), 32);
8486
} else if(!strcmp(ext, ".qpl")) {
8587
memcpy(*icon, icon_get_data(&I_Playlist_10px), 32);
88+
} else {
89+
return false;
8690
}
8791
return true;
8892
}

scenes/scene_items.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ static const ActionMenuItemType ItemToMenuItem[] = {
2222
[Item_Playlist] = ActionMenuItemTypePlaylist,
2323
[Item_Group] = ActionMenuItemTypeGroup,
2424
[Item_Settings] = ActionMenuItemTypeSettings,
25+
[Item_Unknown] = ActionMenuItemTypeUnknown,
2526
};
2627

2728
void scene_items_item_callback(void* context, int32_t index, InputType type) {

views/action_menu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ static const Icon* ActionMenuIcons[] = {
2828
[ActionMenuItemTypePlaylist] = &I_Playlist_10px,
2929
[ActionMenuItemTypeGroup] = &I_Directory_10px,
3030
[ActionMenuItemTypeSettings] = &I_Settings_10px,
31+
[ActionMenuItemTypeUnknown] = &I_Unknown_10px,
3132
};
3233

3334
struct ActionMenuItem {

0 commit comments

Comments
 (0)