# HG changeset patch # User Ideenmodellierer # Date 1602347413 -7200 # Node ID ffd01ead2c80e122a4c2e59d8be68c9ff80021cf # Parent d784f281833a77df1c807a1a3deababec70066fc Bugfix return from submenu in t3 view: In case of beeing in a sub menu (e.g. set bearing) in t3 view and pressing back button, visualization changed to t7 view without reset of the menu state => OSTC assumes still beeing in a sub menu while user sees main screen. Solution: evaluate menu state and take action according to it. diff -r d784f281833a -r ffd01ead2c80 Discovery/Src/base.c --- a/Discovery/Src/base.c Sat Oct 10 16:59:18 2020 +0200 +++ b/Discovery/Src/base.c Sat Oct 10 18:30:13 2020 +0200 @@ -742,11 +742,28 @@ tHomeDiveMenuControl(action); } else if (action == ACTION_BUTTON_BACK) { if (get_globalState() == StS) + { openInfo(StILOGLIST); - else if ((status.page == PageDive) - && (settingsGetPointer()->design < 7)) { - settingsGetPointer()->design = 7; // auto switch to 9 if necessary - } else if ((status.page == PageDive) && (status.line != 0)) { + } + else if ((status.page == PageDive) && (settingsGetPointer()->design < 7)) + { + if(settingsGetPointer()->design == 3) + { + if(get_globalState() != StD) /* located in submenu? => return */ + { + set_globalState(StD); + } + else /* return to t7 view */ + { + settingsGetPointer()->design = 7; + } + } + else + { + settingsGetPointer()->design = 7; // auto switch to 9 if necessary + } + } else if ((status.page == PageDive) && (status.line != 0)) + { if (settingsGetPointer()->extraDisplay == EXTRADISPLAY_BIGFONT) { settingsGetPointer()->design = 3; @@ -755,13 +772,14 @@ DefinePitchSectors(stateRealGetPointer()->lifeData.compass_pitch,CUSTOMER_DEFINED_VIEWS); } } - else if (settingsGetPointer()->extraDisplay - == EXTRADISPLAY_DECOGAME) + else if (settingsGetPointer()->extraDisplay == EXTRADISPLAY_DECOGAME) settingsGetPointer()->design = 4; - set_globalState(StD); - } else + } + else + { tHome_change_field_button_pressed(); + } } else if ((action == ACTION_BUTTON_ENTER) || (action == ACTION_PITCH_NEG) || (action == ACTION_PITCH_POS)) {