mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-14 15:18:35 -07:00
Port new naming scheme to apps
This commit is contained in:
9
applications/external/protoview/view_info.c
vendored
9
applications/external/protoview/view_info.c
vendored
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "app.h"
|
||||
#include <gui/view.h>
|
||||
#include <lib/toolbox/random_name.h>
|
||||
#include <toolbox/name_generator.h>
|
||||
|
||||
/* This view has subviews accessible navigating up/down. This
|
||||
* enumaration is used to track the currently active subview. */
|
||||
@@ -166,12 +166,7 @@ void str_replace(char* buf, char c1, char c2) {
|
||||
|
||||
/* Set a random filename the user can edit. */
|
||||
void set_signal_random_filename(ProtoViewApp* app, char* buf, size_t buflen) {
|
||||
char suffix[6];
|
||||
set_random_name(suffix, sizeof(suffix));
|
||||
snprintf(buf, buflen, "%.10s-%s-%d", app->msg_info->decoder->name, suffix, rand() % 1000);
|
||||
str_replace(buf, ' ', '_');
|
||||
str_replace(buf, '-', '_');
|
||||
str_replace(buf, '/', '_');
|
||||
name_generator_make_auto(buf, buflen, app->msg_info->decoder->name);
|
||||
}
|
||||
|
||||
/* ========================== Signal transmission =========================== */
|
||||
|
||||
Reference in New Issue
Block a user