Port new naming scheme to apps

This commit is contained in:
Willy-JL
2023-09-02 17:16:21 +02:00
parent 6d8ef70f28
commit 58355994ec
12 changed files with 21 additions and 21 deletions

View File

@@ -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 =========================== */