Fixes #946
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user