mirror of
https://github.com/opentx/opentx.git
synced 2025-07-23 16:25:16 +03:00
Fixes #946
This commit is contained in:
parent
b36393e155
commit
711112846c
16 changed files with 53 additions and 15 deletions
|
@ -344,16 +344,21 @@ bool modelHasNotes()
|
|||
return (f_stat(filename, &info) == FR_OK);
|
||||
}
|
||||
|
||||
void pushModelNotes()
|
||||
{
|
||||
char filename[sizeof(MODELS_PATH)+1+sizeof(g_model.header.name)+sizeof(TEXT_EXT)] = MODELS_PATH "/";
|
||||
char *buf = strcat_modelname(&filename[sizeof(MODELS_PATH)], g_eeGeneral.currModel);
|
||||
strcpy(buf, TEXT_EXT);
|
||||
pushMenuTextView(filename);
|
||||
}
|
||||
|
||||
void onLongMenuPress(const char *result)
|
||||
{
|
||||
if (result == STR_VIEW_CHANNELS) {
|
||||
pushMenu(menuChannelsView);
|
||||
}
|
||||
else if (result == STR_VIEW_NOTES) {
|
||||
char filename[sizeof(MODELS_PATH)+1+sizeof(g_model.header.name)+sizeof(TEXT_EXT)] = MODELS_PATH "/";
|
||||
char *buf = strcat_modelname(&filename[sizeof(MODELS_PATH)], g_eeGeneral.currModel);
|
||||
strcpy(buf, TEXT_EXT);
|
||||
pushMenuTextView(filename);
|
||||
pushModelNotes();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -407,6 +407,7 @@ void displayWarning(uint8_t event);
|
|||
void menuChannelsView(uint8_t event);
|
||||
void pushMenuTextView(const char *filename);
|
||||
bool modelHasNotes();
|
||||
void pushModelNotes();
|
||||
#endif
|
||||
|
||||
#define LABEL(...) (uint8_t)-1
|
||||
|
|
|
@ -460,6 +460,17 @@ void onMainViewMenu(const char *result)
|
|||
else if (result == STR_RESET_TIMER2) {
|
||||
resetTimer(1);
|
||||
}
|
||||
#if defined(PCBTARANIS)
|
||||
else if (result == STR_VIEW_NOTES) {
|
||||
pushModelNotes();
|
||||
}
|
||||
else if (result == STR_RESET_SUBMENU) {
|
||||
MENU_ADD_ITEM(STR_RESET_FLIGHT);
|
||||
MENU_ADD_ITEM(STR_RESET_TIMER1);
|
||||
MENU_ADD_ITEM(STR_RESET_TIMER2);
|
||||
MENU_ADD_ITEM(STR_RESET_TELEMETRY);
|
||||
}
|
||||
#endif
|
||||
#if defined(FRSKY)
|
||||
else if (result == STR_RESET_TELEMETRY) {
|
||||
resetTelemetry();
|
||||
|
@ -531,12 +542,24 @@ void menuMainView(uint8_t event)
|
|||
#if defined(NAVIGATION_MENUS)
|
||||
case EVT_KEY_CONTEXT_MENU:
|
||||
killEvents(event);
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
if (modelHasNotes()) {
|
||||
MENU_ADD_ITEM(STR_VIEW_NOTES);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
MENU_ADD_ITEM(STR_RESET_SUBMENU);
|
||||
#else
|
||||
MENU_ADD_ITEM(STR_RESET_TIMER1);
|
||||
MENU_ADD_ITEM(STR_RESET_TIMER2);
|
||||
#if defined(FRSKY)
|
||||
MENU_ADD_ITEM(STR_RESET_TELEMETRY);
|
||||
#endif
|
||||
MENU_ADD_ITEM(STR_RESET_FLIGHT);
|
||||
#endif
|
||||
|
||||
MENU_ADD_ITEM(STR_STATISTICS);
|
||||
#if defined(CPUARM)
|
||||
MENU_ADD_ITEM(STR_ABOUT_US);
|
||||
|
|
|
@ -2330,11 +2330,8 @@ void checkAll()
|
|||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
if (modelHasNotes() && g_model.displayText) {
|
||||
char filename[sizeof(MODELS_PATH)+1+sizeof(g_model.header.name)+sizeof(TEXT_EXT)] = MODELS_PATH "/";
|
||||
char *buf = strcat_modelname(&filename[sizeof(MODELS_PATH)], g_eeGeneral.currModel);
|
||||
strcpy(buf, TEXT_EXT);
|
||||
pushMenuTextView(filename);
|
||||
if (g_model.displayText && modelHasNotes()) {
|
||||
pushModelNotes();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -497,6 +497,7 @@ const pm_char STR_VIEW_TEXT[] PROGMEM = TR_VIEW_TEXT;
|
|||
const pm_char STR_MIRROR[] PROGMEM = TR_MIRROR;
|
||||
const pm_char STR_CLEAR[] PROGMEM = TR_CLEAR;
|
||||
const pm_char STR_RESET[] PROGMEM = TR_RESET;
|
||||
const pm_char STR_RESET_SUBMENU[] PROGMEM = TR_RESET_SUBMENU;
|
||||
const pm_char STR_COUNT[] PROGMEM = TR_COUNT;
|
||||
const pm_char STR_PT[] PROGMEM = TR_PT;
|
||||
const pm_char STR_PTS[] PROGMEM = TR_PTS;
|
||||
|
|
|
@ -677,10 +677,11 @@ extern const pm_char STR_VIEW_TEXT[];
|
|||
extern const pm_char STR_MIRROR[];
|
||||
extern const pm_char STR_CLEAR[];
|
||||
extern const pm_char STR_RESET[];
|
||||
extern const pm_char STR_COUNT[];
|
||||
extern const pm_char STR_PT[];
|
||||
extern const pm_char STR_PTS[];
|
||||
extern const pm_char STR_SMOOTH[];
|
||||
extern const pm_char STR_RESET_SUBMENU[];
|
||||
extern const pm_char STR_COUNT[];
|
||||
extern const pm_char STR_PT[];
|
||||
extern const pm_char STR_PTS[];
|
||||
extern const pm_char STR_SMOOTH[];
|
||||
extern const pm_char STR_COPY_TRIMS_TO_OFS[];
|
||||
extern const pm_char STR_TOP_BAR[];
|
||||
extern const pm_char STR_ALTITUDE[];
|
||||
|
|
|
@ -754,6 +754,7 @@
|
|||
#define TR_MIRROR "Zrcadlit"
|
||||
#define TR_CLEAR "Smazat"
|
||||
#define TR_RESET "Reset"
|
||||
#define TR_RESET_SUBMENU "Reset..."
|
||||
#define TR_COUNT "Velikost"
|
||||
#define TR_PT "č."
|
||||
#define TR_PTS " b."
|
||||
|
|
|
@ -754,6 +754,7 @@
|
|||
#define TR_MIRROR "Mirror"
|
||||
#define TR_CLEAR "Clear"
|
||||
#define TR_RESET "Reset Servowerte"
|
||||
#define TR_RESET_SUBMENU "Reset..."
|
||||
#define TR_COUNT "Punkte"
|
||||
#define TR_PT "Pt"
|
||||
#define TR_PTS "Pts"
|
||||
|
|
|
@ -754,6 +754,7 @@
|
|||
#define TR_MIRROR "Mirror"
|
||||
#define TR_CLEAR "Clear"
|
||||
#define TR_RESET "Reset"
|
||||
#define TR_RESET_SUBMENU "Reset..."
|
||||
#define TR_COUNT "Count"
|
||||
#define TR_PT "pt"
|
||||
#define TR_PTS "pts"
|
||||
|
|
|
@ -754,6 +754,7 @@
|
|||
#define TR_MIRROR "Mirror"
|
||||
#define TR_CLEAR "Clear"
|
||||
#define TR_RESET "Reset"
|
||||
#define TR_RESET_SUBMENU "Reset..."
|
||||
#define TR_COUNT "Count"
|
||||
#define TR_PT "pt"
|
||||
#define TR_PTS "pts"
|
||||
|
|
|
@ -754,6 +754,7 @@
|
|||
#define TR_MIRROR "Mirror"
|
||||
#define TR_CLEAR "Clear"
|
||||
#define TR_RESET "Reset"
|
||||
#define TR_RESET_SUBMENU "Reset..."
|
||||
#define TR_COUNT "Count"
|
||||
#define TR_PT "pt"
|
||||
#define TR_PTS "pts"
|
||||
|
|
|
@ -754,6 +754,7 @@
|
|||
#define TR_MIRROR "Miroir"
|
||||
#define TR_CLEAR "Effacer"
|
||||
#define TR_RESET "Réinitialiser"
|
||||
#define TR_RESET_SUBMENU "Reset..."
|
||||
#define TR_COUNT "Nb points"
|
||||
#define TR_PT "pt"
|
||||
#define TR_PTS "pts"
|
||||
|
|
|
@ -754,6 +754,7 @@
|
|||
#define TR_MIRROR "Mirror"
|
||||
#define TR_CLEAR "Clear"
|
||||
#define TR_RESET "Reset"
|
||||
#define TR_RESET_SUBMENU "Reset..."
|
||||
#define TR_COUNT "Count"
|
||||
#define TR_PT "pt"
|
||||
#define TR_PTS "pts"
|
||||
|
|
|
@ -754,6 +754,7 @@
|
|||
#define TR_MIRROR "Lutro"
|
||||
#define TR_CLEAR "Wyczyść"
|
||||
#define TR_RESET "Resetuj"
|
||||
#define TR_RESET_SUBMENU "Reset..."
|
||||
#define TR_COUNT "Punkty"
|
||||
#define TR_PT "pkt"
|
||||
#define TR_PTS "pkt"
|
||||
|
|
|
@ -754,6 +754,7 @@
|
|||
#define TR_MIRROR "Mirror"
|
||||
#define TR_CLEAR "Clear"
|
||||
#define TR_RESET "Reset"
|
||||
#define TR_RESET_SUBMENU "Reset..."
|
||||
#define TR_COUNT "Count"
|
||||
#define TR_PT "pt"
|
||||
#define TR_PTS "pts"
|
||||
|
|
|
@ -754,6 +754,7 @@
|
|||
#define TR_MIRROR "Spegla"
|
||||
#define TR_CLEAR "Töm"
|
||||
#define TR_RESET "Nollställ"
|
||||
#define TR_RESET_SUBMENU "Reset..."
|
||||
#define TR_COUNT "Antal"
|
||||
#define TR_PT "pt"
|
||||
#define TR_PTS "pkt"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue