Mercurial > public > ostc4
comparison Discovery/Src/base.c @ 540:ffd01ead2c80
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.
author | Ideenmodellierer |
---|---|
date | Sat, 10 Oct 2020 18:30:13 +0200 |
parents | 06b21f1e47a5 |
children | 469e93f8633e |
comparison
equal
deleted
inserted
replaced
539:d784f281833a | 540:ffd01ead2c80 |
---|---|
740 openMenu(1); | 740 openMenu(1); |
741 else | 741 else |
742 tHomeDiveMenuControl(action); | 742 tHomeDiveMenuControl(action); |
743 } else if (action == ACTION_BUTTON_BACK) { | 743 } else if (action == ACTION_BUTTON_BACK) { |
744 if (get_globalState() == StS) | 744 if (get_globalState() == StS) |
745 { | |
745 openInfo(StILOGLIST); | 746 openInfo(StILOGLIST); |
746 else if ((status.page == PageDive) | 747 } |
747 && (settingsGetPointer()->design < 7)) { | 748 else if ((status.page == PageDive) && (settingsGetPointer()->design < 7)) |
748 settingsGetPointer()->design = 7; // auto switch to 9 if necessary | 749 { |
749 } else if ((status.page == PageDive) && (status.line != 0)) { | 750 if(settingsGetPointer()->design == 3) |
751 { | |
752 if(get_globalState() != StD) /* located in submenu? => return */ | |
753 { | |
754 set_globalState(StD); | |
755 } | |
756 else /* return to t7 view */ | |
757 { | |
758 settingsGetPointer()->design = 7; | |
759 } | |
760 } | |
761 else | |
762 { | |
763 settingsGetPointer()->design = 7; // auto switch to 9 if necessary | |
764 } | |
765 } else if ((status.page == PageDive) && (status.line != 0)) | |
766 { | |
750 if (settingsGetPointer()->extraDisplay == EXTRADISPLAY_BIGFONT) | 767 if (settingsGetPointer()->extraDisplay == EXTRADISPLAY_BIGFONT) |
751 { | 768 { |
752 settingsGetPointer()->design = 3; | 769 settingsGetPointer()->design = 3; |
753 if(settingsGetPointer()->MotionDetection == MOTION_DETECT_SECTOR) | 770 if(settingsGetPointer()->MotionDetection == MOTION_DETECT_SECTOR) |
754 { | 771 { |
755 DefinePitchSectors(stateRealGetPointer()->lifeData.compass_pitch,CUSTOMER_DEFINED_VIEWS); | 772 DefinePitchSectors(stateRealGetPointer()->lifeData.compass_pitch,CUSTOMER_DEFINED_VIEWS); |
756 } | 773 } |
757 } | 774 } |
758 else if (settingsGetPointer()->extraDisplay | 775 else if (settingsGetPointer()->extraDisplay == EXTRADISPLAY_DECOGAME) |
759 == EXTRADISPLAY_DECOGAME) | |
760 settingsGetPointer()->design = 4; | 776 settingsGetPointer()->design = 4; |
761 | |
762 set_globalState(StD); | 777 set_globalState(StD); |
763 } else | 778 } |
779 else | |
780 { | |
764 tHome_change_field_button_pressed(); | 781 tHome_change_field_button_pressed(); |
782 } | |
765 } else if ((action == ACTION_BUTTON_ENTER) || (action == ACTION_PITCH_NEG) || (action == ACTION_PITCH_POS)) | 783 } else if ((action == ACTION_BUTTON_ENTER) || (action == ACTION_PITCH_NEG) || (action == ACTION_PITCH_POS)) |
766 { | 784 { |
767 | 785 |
768 if ((status.page == PageDive) && (status.line == 0)) | 786 if ((status.page == PageDive) && (status.line == 0)) |
769 { | 787 { |