Skip to content

Commit 69b7184

Browse files
committed
Fix half merge of '956MB:feat/archive-select-multiple'
* Somehow entirely missed the browser path in this merge :( * Don't lint on this branch * Let linker exclude protocols
1 parent 7e47619 commit 69b7184

File tree

5 files changed

+111
-108
lines changed

5 files changed

+111
-108
lines changed

.github/workflows/lint.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

applications/main/archive/views/archive_browser_view.c

Lines changed: 77 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,58 @@ void archive_browser_set_callback(
6464
browser->context = context;
6565
}
6666

67+
static void archive_update_formatted_path(ArchiveBrowserViewModel* model) {
68+
ArchiveBrowserView* browser = model->archive->browser;
69+
if(!browser->path_changed) {
70+
return;
71+
}
72+
73+
if(momentum_settings.browser_path_mode == BrowserPathOff || archive_is_home(browser)) {
74+
furi_string_set(browser->formatted_path, ArchiveTabNames[model->tab_idx]);
75+
} else {
76+
const char* path = furi_string_get_cstr(browser->path);
77+
switch(momentum_settings.browser_path_mode) {
78+
case BrowserPathFull:
79+
furi_string_set(browser->formatted_path, browser->path);
80+
break;
81+
82+
case BrowserPathBrief: {
83+
furi_string_reset(browser->formatted_path);
84+
FuriString* token = furi_string_alloc();
85+
FuriString* remaining = furi_string_alloc_set(path);
86+
87+
while(furi_string_size(remaining) > 0) {
88+
size_t slash_pos = furi_string_search_char(remaining, '/');
89+
if(slash_pos == FURI_STRING_FAILURE) {
90+
furi_string_cat_printf(
91+
browser->formatted_path, "/%s", furi_string_get_cstr(remaining));
92+
break;
93+
}
94+
furi_string_set_n(token, remaining, 0, slash_pos);
95+
if(furi_string_size(token) > 0) {
96+
furi_string_cat_printf(
97+
browser->formatted_path, "/%c", furi_string_get_char(token, 0));
98+
}
99+
furi_string_right(remaining, slash_pos + 1);
100+
}
101+
102+
furi_string_free(token);
103+
furi_string_free(remaining);
104+
break;
105+
}
106+
107+
case BrowserPathCurrent:
108+
path_extract_basename(path, browser->formatted_path);
109+
break;
110+
111+
default:
112+
break;
113+
}
114+
}
115+
116+
browser->path_changed = false;
117+
}
118+
67119
static void render_item_menu(Canvas* canvas, ArchiveBrowserViewModel* model) {
68120
if(menu_array_size(model->context_menu) == 0) {
69121
// Need init context menu
@@ -328,10 +380,15 @@ static void draw_list(Canvas* canvas, ArchiveBrowserViewModel* model) {
328380
static void archive_render_status_bar(Canvas* canvas, ArchiveBrowserViewModel* model) {
329381
furi_assert(model);
330382

331-
const char* tab_name = ArchiveTabNames[model->tab_idx];
332-
if(model->tab_idx == ArchiveTabSearch &&
333-
scene_manager_get_scene_state(model->archive->scene_manager, ArchiveAppSceneSearch)) {
334-
tab_name = "Searching";
383+
const char* tab_name = NULL;
384+
if(model->tab_idx == ArchiveTabSearch) {
385+
if(scene_manager_get_scene_state(model->archive->scene_manager, ArchiveAppSceneSearch)) {
386+
tab_name = "Searching";
387+
} else {
388+
tab_name = ArchiveTabNames[model->tab_idx];
389+
}
390+
} else {
391+
archive_update_formatted_path(model);
335392
}
336393
bool clip = model->clipboard != NULL;
337394

@@ -347,7 +404,19 @@ static void archive_render_status_bar(Canvas* canvas, ArchiveBrowserViewModel* m
347404
canvas_draw_rframe(canvas, 0, 0, 51, 13, 1); // frame
348405
canvas_draw_line(canvas, 49, 1, 49, 11); // shadow right
349406
canvas_draw_line(canvas, 1, 11, 49, 11); // shadow bottom
350-
canvas_draw_str_aligned(canvas, 25, 9, AlignCenter, AlignBottom, tab_name);
407+
if(tab_name) {
408+
canvas_draw_str_aligned(canvas, 25, 9, AlignCenter, AlignBottom, tab_name);
409+
} else {
410+
elements_scrollable_text_line_centered(
411+
canvas,
412+
25,
413+
9,
414+
45,
415+
model->archive->browser->formatted_path,
416+
model->scroll_counter,
417+
false,
418+
true);
419+
}
351420

352421
if(clip || model->select_mode) {
353422
const uint8_t box_w = clip ? 25 : 31;
@@ -670,6 +739,8 @@ ArchiveBrowserView* browser_alloc(void) {
670739
browser->scroll_timer = furi_timer_alloc(browser_scroll_timer, FuriTimerTypePeriodic, browser);
671740

672741
browser->path = furi_string_alloc_set(archive_get_default_path(TAB_DEFAULT));
742+
browser->formatted_path = furi_string_alloc();
743+
browser->path_changed = true;
673744

674745
with_view_model(
675746
browser->view,
@@ -703,6 +774,7 @@ void browser_free(ArchiveBrowserView* browser) {
703774
false);
704775

705776
furi_string_free(browser->path);
777+
furi_string_free(browser->formatted_path);
706778

707779
view_free(browser->view);
708780
free(browser);

lib/subghz/SConscript

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -33,49 +33,7 @@ env.Append(
3333
libenv = env.Clone(FW_LIB_NAME="subghz")
3434
libenv.ApplyLibFlags()
3535

36-
all_sources = libenv.GlobRecursive("*.c*")
37-
38-
excluded_protocols = [
39-
#
40-
# Weather Station
41-
"protocols/ws_generic.c",
42-
"protocols/vauno_en8822c.c",
43-
"protocols/emos_e601x.c",
44-
"protocols/wendox_w6726.c",
45-
"protocols/solight_te44.c",
46-
"protocols/auriol_ahfl.c",
47-
"protocols/auriol_hg0601a.c",
48-
"protocols/kedsum_th.c",
49-
"protocols/gt_wt_02.c",
50-
"protocols/gt_wt_03.c",
51-
"protocols/thermopro_tx4.c",
52-
"protocols/infactory.c",
53-
"protocols/nexus_th.c",
54-
"protocols/tx_8300.c",
55-
#
56-
# Uncommon/Regional
57-
"protocols/feron.c",
58-
"protocols/elplast.c",
59-
"protocols/hay21.c",
60-
"protocols/doitrand.c",
61-
"protocols/nero_radio.c",
62-
"protocols/nero_sketch.c",
63-
"protocols/pcsg_generic.c",
64-
"protocols/power_smart.c",
65-
"protocols/kinggates_stylo_4k.c",
66-
"protocols/dickert_mahs.c",
67-
"protocols/ansonic.c",
68-
"protocols/dooya.c",
69-
"protocols/ido.c",
70-
"protocols/kia.c",
71-
"protocols/smc5326.c",
72-
"protocols/linear_delta3.c",
73-
"protocols/schrader_gg4.c",
74-
"protocols/tpms_generic.c",
75-
]
76-
77-
excluded_protocols_full = [f"lib/subghz/{f}" for f in excluded_protocols]
78-
sources = [f for f in all_sources if str(f) not in excluded_protocols_full]
36+
sources = libenv.GlobRecursive("*.c*")
7937

8038
lib = libenv.StaticLibrary("${FW_LIB_NAME}", sources)
8139
libenv.Install("${LIB_DIST_DIR}", lib)

lib/subghz/protocols/protocol_items.h

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -50,24 +50,23 @@
5050
#include "mastercode.h"
5151
#include "megacode.h"
5252
#include "hollarm.h"
53-
54-
// #include "nero_sketch.h"
55-
// #include "nero_radio.h"
56-
// #include "ido.h"
57-
// #include "kia.h"
58-
// #include "power_smart.h"
59-
// #include "doitrand.h"
60-
// #include "ansonic.h"
61-
// #include "smc5326.h"
62-
// #include "linear_delta3.h"
63-
// #include "dooya.h"
64-
// #include "kinggates_stylo_4k.h"
65-
// #include "dickert_mahs.h"
66-
// #include "hay21.h"
67-
// #include "feron.h"
68-
// #include "elplast.h"
69-
// #include "schrader_gg4.h"
70-
// #include "tpms_generic.h"
53+
#include "nero_sketch.h"
54+
#include "nero_radio.h"
55+
#include "ido.h"
56+
#include "kia.h"
57+
#include "power_smart.h"
58+
#include "doitrand.h"
59+
#include "ansonic.h"
60+
#include "smc5326.h"
61+
#include "linear_delta3.h"
62+
#include "dooya.h"
63+
#include "kinggates_stylo_4k.h"
64+
#include "dickert_mahs.h"
65+
#include "hay21.h"
66+
#include "feron.h"
67+
#include "elplast.h"
68+
#include "schrader_gg4.h"
69+
#include "tpms_generic.h"
7170

7271
// Weather Station
7372
#include "oregon2.h"
@@ -80,19 +79,18 @@
8079
#include "acurite_606tx.h"
8180
#include "acurite_609txc.h"
8281
#include "lacrosse_tx141thbv2.h"
83-
84-
// #include "solight_te44.h"
85-
// #include "infactory.h"
86-
// #include "acurite_986.h"
87-
// #include "auriol_ahfl.h"
88-
// #include "auriol_hg0601a.h"
89-
// #include "emos_e601x.h"
90-
// #include "gt_wt_02.h"
91-
// #include "gt_wt_03.h"
92-
// #include "kedsum_th.h"
93-
// #include "nexus_th.h"
94-
// #include "oregon_v1.h"
95-
// #include "thermopro_tx4.h"
96-
// #include "tx_8300.h"
97-
// #include "vauno_en8822c.h"
98-
// #include "wendox_w6726.h"
82+
#include "solight_te44.h"
83+
#include "infactory.h"
84+
#include "acurite_986.h"
85+
#include "auriol_ahfl.h"
86+
#include "auriol_hg0601a.h"
87+
#include "emos_e601x.h"
88+
#include "gt_wt_02.h"
89+
#include "gt_wt_03.h"
90+
#include "kedsum_th.h"
91+
#include "nexus_th.h"
92+
#include "oregon_v1.h"
93+
#include "thermopro_tx4.h"
94+
#include "tx_8300.h"
95+
#include "vauno_en8822c.h"
96+
#include "wendox_w6726.h"

targets/f7/api_symbols.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4365,6 +4365,7 @@ Variable,-,_sys_errlist,const char* const[],
43654365
Variable,-,_sys_nerr,int,
43664366
Variable,-,ble_profile_hid,const FuriHalBleProfileTemplate*,
43674367
Variable,+,ble_profile_serial,const FuriHalBleProfileTemplate* const,
4368+
Variable,+,canvas_font_params,const CanvasFontParameters[FontTotalNumber],
43684369
Variable,+,compress_config_heatshrink_default,const CompressConfigHeatshrink,
43694370
Variable,+,firmware_api_interface,const ElfApiInterface* const,
43704371
Variable,+,furi_hal_i2c_bus_external,FuriHalI2cBus,

0 commit comments

Comments
 (0)