diff --git a/applications/main/archive/scenes/archive_scene_browser.c b/applications/main/archive/scenes/archive_scene_browser.c index 0bfde1d9d3..3f37990d11 100644 --- a/applications/main/archive/scenes/archive_scene_browser.c +++ b/applications/main/archive/scenes/archive_scene_browser.c @@ -19,9 +19,9 @@ const char* archive_get_flipper_app_name(ArchiveFileTypeEnum file_type) { case ArchiveFileTypeNFC: return "NFC"; case ArchiveFileTypeSubGhz: - return "SubGHz"; + return "Sub-GHz"; case ArchiveFileTypeLFRFID: - return "RFID"; + return "125 kHz RFID"; case ArchiveFileTypeInfrared: return "Infrared"; case ArchiveFileTypeSubghzPlaylist: diff --git a/applications/main/archive/views/archive_browser_view.c b/applications/main/archive/views/archive_browser_view.c index 57eb8310d4..130895743c 100644 --- a/applications/main/archive/views/archive_browser_view.c +++ b/applications/main/archive/views/archive_browser_view.c @@ -13,7 +13,7 @@ static const char* ArchiveTabNames[] = { [ArchiveTabIButton] = "iButton", [ArchiveTabNFC] = "NFC", [ArchiveTabSubGhz] = "Sub-GHz", - [ArchiveTabLFRFID] = "RFID", + [ArchiveTabLFRFID] = "RFID LF", [ArchiveTabInfrared] = "Infrared", [ArchiveTabBadKb] = "Bad KB", [ArchiveTabU2f] = "U2F", diff --git a/applications/main/lfrfid/application.fam b/applications/main/lfrfid/application.fam index b444303230..f8d062f36e 100644 --- a/applications/main/lfrfid/application.fam +++ b/applications/main/lfrfid/application.fam @@ -1,6 +1,6 @@ App( appid="lfrfid", - name="RFID", + name="125 kHz RFID", apptype=FlipperAppType.MENUEXTERNAL, targets=["f7"], entry_point="lfrfid_app", diff --git a/applications/main/momentum_app/momentum_app.c b/applications/main/momentum_app/momentum_app.c index 5502364457..eb4e488ef6 100644 --- a/applications/main/momentum_app/momentum_app.c +++ b/applications/main/momentum_app/momentum_app.c @@ -17,7 +17,7 @@ bool momentum_app_apply(MomentumApp* app) { if(app->save_mainmenu_apps) { Stream* stream = file_stream_alloc(storage); if(file_stream_open(stream, MAINMENU_APPS_PATH, FSAM_READ_WRITE, FSOM_CREATE_ALWAYS)) { - stream_write_format(stream, "MenuAppList Version %u\n", 0); + stream_write_format(stream, "MenuAppList Version %u\n", 1); CharList_it_t it; CharList_it(it, app->mainmenu_app_exes); for(size_t i = 0; i < CharList_size(app->mainmenu_app_exes); i++) { @@ -249,7 +249,13 @@ MomentumApp* momentum_app_alloc() { furi_string_replace_all(line, "\n", ""); CharList_push_back(app->mainmenu_app_exes, strdup(furi_string_get_cstr(line))); flipper_application_load_name_and_icon(line, storage, NULL, line); - if(furi_string_start_with_str(line, "[")) { + if(!furi_string_cmp(line, "Momentum")) { + furi_string_set(line, "MNTM"); + } else if(!furi_string_cmp(line, "125 kHz RFID")) { + furi_string_set(line, "RFID"); + } else if(!furi_string_cmp(line, "Sub-GHz")) { + furi_string_set(line, "SubGHz"); + } else if(furi_string_start_with_str(line, "[")) { size_t trim = furi_string_search_str(line, "] ", 1); if(trim != FURI_STRING_FAILURE) { furi_string_right(line, trim + 2); diff --git a/applications/main/subghz/application.fam b/applications/main/subghz/application.fam index 9666625478..b7c768bd21 100644 --- a/applications/main/subghz/application.fam +++ b/applications/main/subghz/application.fam @@ -1,6 +1,6 @@ App( appid="subghz", - name="SubGHz", + name="Sub-GHz", apptype=FlipperAppType.APP, targets=["f7"], entry_point="subghz_app", @@ -23,7 +23,7 @@ App( App( appid="subghz_fap", - name="SubGHz", + name="Sub-GHz", apptype=FlipperAppType.EXTERNAL, entry_point="subghz_fap", stack_size=3 * 1024, diff --git a/applications/services/gui/modules/menu.c b/applications/services/gui/modules/menu.c index b472431b5a..a78d9d274a 100644 --- a/applications/services/gui/modules/menu.c +++ b/applications/services/gui/modules/menu.c @@ -44,11 +44,23 @@ static void menu_process_left(Menu* menu); static void menu_process_right(Menu* menu); static void menu_process_ok(Menu* menu); -static void menu_short_name(MenuItem* item, FuriString* name) { +static void menu_get_name(MenuItem* item, FuriString* name, bool shorter) { furi_string_set(name, item->label); + if(shorter) { + if(!furi_string_cmp(name, "Momentum")) { + furi_string_set(name, "MNTM"); + return; + } else if(!furi_string_cmp(name, "125 kHz RFID")) { + furi_string_set(name, "RFID"); + return; + } else if(!furi_string_cmp(name, "Sub-GHz")) { + furi_string_set(name, "SubGHz"); + return; + } + } if(furi_string_start_with_str(name, "[")) { size_t trim = furi_string_search_str(name, "] ", 1); - if(trim != STRING_FAILURE) { + if(trim != FURI_STRING_FAILURE) { furi_string_right(name, trim + 2); } } @@ -97,7 +109,7 @@ static void menu_draw_callback(Canvas* canvas, void* _model) { shift_position = (position + items_count + i - 1) % items_count; item = MenuItemArray_get(model->items, shift_position); menu_centered_icon(canvas, item, 4, 3 + 22 * i, 14, 14); - menu_short_name(item, name); + menu_get_name(item, name, false); size_t scroll_counter = menu_scroll_counter(model, i == 1); elements_scrollable_text_line( canvas, 22, 14 + 22 * i, 98, name, scroll_counter, false); @@ -132,7 +144,7 @@ static void menu_draw_callback(Canvas* canvas, void* _model) { } item = MenuItemArray_get(model->items, item_i); menu_centered_icon(canvas, item, x_off, y_off, 40, 20); - menu_short_name(item, name); + menu_get_name(item, name, true); size_t scroll_counter = menu_scroll_counter(model, selected); elements_scrollable_text_line_centered( canvas, 20 + x_off, 26 + y_off, 36, name, scroll_counter, false, true); @@ -174,7 +186,7 @@ static void menu_draw_callback(Canvas* canvas, void* _model) { canvas_set_color(canvas, ColorBlack); canvas_set_font(canvas, FontPrimary); - menu_short_name(item, name); + menu_get_name(item, name, false); size_t scroll_counter = menu_scroll_counter(model, true); elements_scrollable_text_line_centered( canvas, @@ -225,7 +237,7 @@ static void menu_draw_callback(Canvas* canvas, void* _model) { canvas_set_color(canvas, ColorBlack); canvas_set_font(canvas, FontSecondary); - menu_short_name(item, name); + menu_get_name(item, name, true); size_t scroll_counter = menu_scroll_counter(model, true); elements_scrollable_text_line( canvas, @@ -269,7 +281,7 @@ static void menu_draw_callback(Canvas* canvas, void* _model) { } item = MenuItemArray_get(model->items, item_i); menu_centered_icon(canvas, item, 0, y_off, 16, 16); - menu_short_name(item, name); + menu_get_name(item, name, true); size_t scroll_counter = menu_scroll_counter(model, selected); elements_scrollable_text_line( canvas, 17, y_off + 12, 46, name, scroll_counter, false); @@ -307,7 +319,7 @@ static void menu_draw_callback(Canvas* canvas, void* _model) { canvas_set_color(canvas, ColorWhite); } item = MenuItemArray_get(model->items, index); - menu_short_name(item, name); + menu_get_name(item, name, true); char indexstr[5]; snprintf(indexstr, sizeof(indexstr), "%d.", index); @@ -343,7 +355,7 @@ static void menu_draw_callback(Canvas* canvas, void* _model) { canvas_set_color(canvas, ColorWhite); } item = MenuItemArray_get(model->items, index); - menu_short_name(item, name); + menu_get_name(item, name, true); elements_scrollable_text_line( canvas, x_off + 1, y_off + 7, 62, name, scroll_counter, false); @@ -383,7 +395,7 @@ static void menu_draw_callback(Canvas* canvas, void* _model) { // Draw the selected menu item MenuItem* item = MenuItemArray_get(model->items, position); - menu_short_name(item, name); + menu_get_name(item, name, true); elements_bold_rounded_frame(canvas, 42, 23, 35, 33); menu_centered_icon(canvas, item, 43, 24, 35, 32); canvas_draw_frame(canvas, 0, 0, 128, 64); @@ -398,7 +410,7 @@ static void menu_draw_callback(Canvas* canvas, void* _model) { for(size_t i = position; i < endItem; i++) { MenuItem* item = MenuItemArray_get(model->items, i); - menu_short_name(item, name); + menu_get_name(item, name, true); uint8_t yPos = startY + ((i - position) * itemHeight); size_t scroll_counter = menu_scroll_counter(model, i == position); elements_scrollable_text_line(canvas, 83, yPos, 43, name, scroll_counter, false); diff --git a/applications/services/loader/loader.c b/applications/services/loader/loader.c index 7c6369febb..55ce3e22bb 100644 --- a/applications/services/loader/loader.c +++ b/applications/services/loader/loader.c @@ -208,7 +208,7 @@ static void loader_make_menu_file(Storage* storage) { Stream* new = file_stream_alloc(storage); if(!storage_file_exists(storage, MAINMENU_APPS_PATH)) { if(file_stream_open(new, MAINMENU_APPS_PATH, FSAM_WRITE, FSOM_CREATE_ALWAYS)) { - stream_write_format(new, "MenuAppList Version %u\n", 0); + stream_write_format(new, "MenuAppList Version %u\n", 1); for(size_t i = 0; i < FLIPPER_APPS_COUNT; i++) { stream_write_format(new, "%s\n", FLIPPER_APPS[i].name); } @@ -258,7 +258,7 @@ static Loader* loader_alloc() { uint32_t version; if(!stream_read_line(stream, line) || sscanf(furi_string_get_cstr(line), "MenuAppList Version %lu", &version) != 1 || - version > 0) { + version > 1) { file_stream_close(stream); storage_common_remove(storage, MAINMENU_APPS_PATH); loader_make_menu_file(storage); @@ -266,13 +266,20 @@ static Loader* loader_alloc() { break; if(!stream_read_line(stream, line) || sscanf(furi_string_get_cstr(line), "MenuAppList Version %lu", &version) != 1 || - version > 0) + version > 1) break; } while(stream_read_line(stream, line)) { furi_string_replace_all(line, "\r", ""); furi_string_replace_all(line, "\n", ""); + if(version == 0) { + if(!furi_string_cmp(line, "RFID")) { + furi_string_set(line, "125 kHz RFID"); + } else if(!furi_string_cmp(line, "SubGHz")) { + furi_string_set(line, "Sub-GHz"); + } + } const char* label = NULL; const Icon* icon = NULL; const char* exe = NULL; @@ -574,15 +581,10 @@ static LoaderStatus loader_do_start_by_name( break; } - // Translate app names (mainly for RPC, thanks OFW for not using a smart system like appid's :/) - if(!strncmp(name, "Bad USB", strlen("Bad USB"))) + // Translate app names (mainly for RPC) + if(!strncmp(name, "Bad USB", strlen("Bad USB"))) { name = "Bad KB"; - else if(!strncmp(name, "Applications", strlen("Applications"))) - name = "Apps"; - else if(!strncmp(name, "125 kHz RFID", strlen("125 kHz RFID"))) - name = "RFID"; - else if(!strncmp(name, "Sub-GHz", strlen("Sub-GHz"))) - name = "SubGHz"; + } // check internal apps {