more string extraction. moved prompt_fm and prompt_dmr to string table as they are needed by the UI.

md1702
vk7js 2022-05-10 17:43:42 +10:00 zatwierdzone przez Silvano Seva
rodzic fd5c5b4979
commit 2373d8374c
6 zmienionych plików z 30 dodań i 13 usunięć

Wyświetl plik

@ -113,8 +113,6 @@ PROMPT_WATTS, // Watts
PROMPT_RECEIVE, // Receive
PROMPT_TRANSMIT, // Transmit
PROMPT_MODE, // Mode
PROMPT_DMR, // D M R
PROMPT_FM, // F M
PROMPT_CHARACTER, // character
PROMPT_SPACE, // space
PROMPT_PERCENT, // Percent

Wyświetl plik

@ -35,7 +35,9 @@ const stringsTable_t englishStrings =
.about = "About",
.display = "Display",
.timeAndDate = "Time & Date",
.fm = "FM",
.m17 = "M17",
.dmr = "DMR",
.defaultSettings = "Default Settings",
.brightness = "Brightness",
.contrast = "Contrast",
@ -72,5 +74,11 @@ const stringsTable_t englishStrings =
.toRestoreFlashAnd = "to restore flash and",
.openRTX = "OpenRTX",
.gpsSettings = "GPS Settings",
.m17settings = "M17 Settings",
.callsign = "Callsign:",
.resetToDefaults = "Reset to Defaults",
.toReset = "To reset:",
.pressEnterTwice = "Press Enter twice",
.macroMenu = "Macro Menu",
};
#endif //EnglishStrings_h_included

Wyświetl plik

@ -40,7 +40,9 @@ typedef struct
const char* about;
const char* display;
const char* timeAndDate;
const char* fm;
const char* m17;
const char* dmr;
const char* defaultSettings;
const char* brightness;
const char* contrast;
@ -77,6 +79,12 @@ typedef struct
const char* toRestoreFlashAnd;
const char* openRTX;
const char* gpsSettings;
const char* callsign;
const char* m17settings;
const char* resetToDefaults;
const char* toReset;
const char* pressEnterTwice;
const char* macroMenu;
} stringsTable_t;
extern const stringsTable_t languages[];

Wyświetl plik

@ -111,10 +111,10 @@ void announceRadioMode(uint8_t mode, VoicePromptQueueFlags_T flags)
switch(mode)
{
case OPMODE_DMR:
vpQueuePrompt(PROMPT_DMR);
vpQueueStringTableEntry(currentLanguage->dmr);
break;
case OPMODE_FM:
vpQueuePrompt(PROMPT_FM);
vpQueueStringTableEntry(currentLanguage->fm);
break;
case OPMODE_M17:
vpQueueStringTableEntry(&currentLanguage->m17);

Wyświetl plik

@ -24,6 +24,7 @@
#include <stdint.h>
#include <ui.h>
#include <string.h>
#include "ui/UIStrings.h"
void _ui_drawMainBackground()
{
@ -60,15 +61,15 @@ void _ui_drawMainTop()
{
case OPMODE_FM:
gfx_print(layout.top_pos, layout.top_font, TEXT_ALIGN_LEFT,
color_white, "FM");
color_white, currentLanguage->fm);
break;
case OPMODE_DMR:
gfx_print(layout.top_pos, layout.top_font, TEXT_ALIGN_LEFT,
color_white, "DMR");
color_white, currentLanguage->dmr);
break;
case OPMODE_M17:
gfx_print(layout.top_pos, layout.top_font, TEXT_ALIGN_LEFT,
color_white, "M17");
color_white, currentLanguage->m17);
break;
}
}

Wyświetl plik

@ -611,10 +611,10 @@ void _ui_drawSettingsM17(ui_state_t* ui_state)
gfx_clearScreen();
// Print "M17 Settings" on top bar
gfx_print(layout.top_pos, layout.top_font, TEXT_ALIGN_CENTER,
color_white, "M17 Settings");
color_white, currentLanguage->m17settings);
gfx_printLine(1, 4, layout.top_h, SCREEN_HEIGHT - layout.bottom_h,
layout.horizontal_pad, layout.menu_font,
TEXT_ALIGN_LEFT, color_white, "Callsign:");
TEXT_ALIGN_LEFT, color_white, currentLanguage->callsign);
if(ui_state->edit_mode)
{
uint16_t rect_width = SCREEN_WIDTH - (layout.horizontal_pad * 2);
@ -645,29 +645,31 @@ void _ui_drawSettingsReset2Defaults(ui_state_t* ui_state)
gfx_clearScreen();
gfx_print(layout.top_pos, layout.top_font, TEXT_ALIGN_CENTER,
color_white, "Reset to Defaults");
color_white, currentLanguage->resetToDefaults);
// Make text flash yellow once every 1s
color_t textcolor = drawcnt % 2 == 0 ? color_white : yellow_fab413;
gfx_printLine(1, 4, layout.top_h, SCREEN_HEIGHT - layout.bottom_h,
layout.horizontal_pad, layout.top_font,
TEXT_ALIGN_CENTER, textcolor, "To reset:");
TEXT_ALIGN_CENTER, textcolor, currentLanguage->toReset);
gfx_printLine(2, 4, layout.top_h, SCREEN_HEIGHT - layout.bottom_h,
layout.horizontal_pad, layout.top_font,
TEXT_ALIGN_CENTER, textcolor, "Press Enter twice");
TEXT_ALIGN_CENTER, textcolor, currentLanguage->pressEnterTwice);
if((getTick() - lastDraw) > 1000)
{
drawcnt++;
lastDraw = getTick();
}
drawcnt++;
}
bool _ui_drawMacroMenu()
{
// Header
gfx_print(layout.top_pos, layout.top_font, TEXT_ALIGN_CENTER,
color_white, "Macro Menu");
color_white, currentLanguage->macroMenu);
// First row
if (last_state.channel.mode == OPMODE_FM)
{