diff Discovery/Src/t7.c @ 502:cf06c12c06d1

Bugfix display of disabled screen. It is possible to select a screen as default which is in parallel disabled in the selection view. To avoid this the enable / disable state is not also checked when entering dive mode. The check function was depending on an ACTION. The functionality has been changed to allow the function call without ACTION.
author Ideenmodellierer
date Mon, 24 Aug 2020 19:43:13 +0200
parents 89f6857276f8
children 0004704906d0
line wrap: on
line diff
--- a/Discovery/Src/t7.c	Mon Aug 24 19:39:28 2020 +0200
+++ b/Discovery/Src/t7.c	Mon Aug 24 19:43:13 2020 +0200
@@ -575,6 +575,7 @@
             else
                 selection_customview = settingsGetPointer()->tX_customViewPrimary;
 
+            t7_change_customview(ACTION_END);
             InitMotionDetection();
         }
 
@@ -1582,53 +1583,38 @@
     pLastView = pViews;
     pViews = pCurView;
 
-    if((action == ACTION_BUTTON_ENTER) || (action == ACTION_PITCH_POS))
-    {
-		if(*pViews < CVIEW_END)
-			pViews++;
-
-		if(*pViews == CVIEW_END)
-		{
-			pViews = pStartView;
-		}
-    }
-    else
-    {
-		if(pViews == pStartView)
-		{
-			pViews = pLastView - 1;
-		}
-		else
-		{
-			pViews--;
-		}
-    }
-
     do
     {
-    	cv_disabled = t7_customview_disabled(*pViews);
-        if(cv_disabled)		/* view is disabled => jump to next view */
-        {
-          	if((action == ACTION_BUTTON_ENTER) || (action == ACTION_PITCH_POS))
-          	{
-           		pViews++;
-				if(*pViews == CVIEW_END)
+		switch(action)
+		{
+			case ACTION_BUTTON_ENTER:
+			case ACTION_PITCH_POS:
+						if(*pViews != CVIEW_T3_END)
+					pViews++;
+						if(*pViews == CVIEW_T3_END)
 				{
 					pViews = pStartView;
 				}
-           	}
-           	else
-           	{
-           		if(pViews == pStartView)
-           		{
-           			pViews = pLastView - 1;
-           		}
-           		else
-           		{
-           			pViews--;
-           		}
-           	}
-        }
+				break;
+			case ACTION_PITCH_NEG:
+				if(pViews == pStartView)
+				{
+					pViews = pLastView - 1;
+				}
+				else
+				{
+					pViews--;
+				}
+				break;
+			default:
+				break;
+		}
+
+		cv_disabled = t7_customview_disabled(*pViews);
+		if((cv_disabled) && (action == ACTION_END))
+		{
+			action = ACTION_BUTTON_ENTER;
+		}
     } while(cv_disabled);
 
     selection_customview = *pViews;