mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps] Do not allow store expressions except in Calculation
This commit is contained in:
@@ -52,7 +52,7 @@ StandardDeviation = "Standardabweichung"
|
||||
Step = "Schrittwert"
|
||||
StorageMemoryFull1 = "Der Speicher ist voll. Löschen Sie"
|
||||
StorageMemoryFull2 = "von Daten und versuchen Sie es erneut."
|
||||
StoreExpressionNotAcceptedAsFunction = "Eine Funktion darf kein 'store' enthalten"
|
||||
StoreExpressionNotAllowed = "'store' ist verboten"
|
||||
SyntaxError = "Syntaxfehler"
|
||||
ToZoom = "Zoom: "
|
||||
Trigonometric = "Trigonometrisch"
|
||||
|
||||
@@ -48,7 +48,7 @@ RoundAbscissa = "Integer"
|
||||
Sci = "sci/"
|
||||
SquareSum = "Sum of squares"
|
||||
StandardDeviation = "Standard deviation"
|
||||
StoreExpressionNotAcceptedAsFunction = "A function cannot have a 'store'"
|
||||
StoreExpressionNotAllowed = "'store' is not allowed"
|
||||
StatTab = "Stats"
|
||||
Step = "Step"
|
||||
StorageMemoryFull1 = "The memory is full."
|
||||
|
||||
@@ -52,7 +52,7 @@ StatTab = "Medidas"
|
||||
Step = "Incremento"
|
||||
StorageMemoryFull1 = "La memoria esta llena."
|
||||
StorageMemoryFull2 = "Borre datos e intente de nuevo."
|
||||
StoreExpressionNotAcceptedAsFunction = "Una funcion no puede incluir 'store'"
|
||||
StoreExpressionNotAllowed = "'store' no está permitido"
|
||||
SyntaxError = "Error sintactico"
|
||||
ToZoom = "Zoom : "
|
||||
Trigonometric = "Trigonometrico"
|
||||
|
||||
@@ -52,7 +52,7 @@ StatTab = "Stats"
|
||||
Step = "Pas"
|
||||
StorageMemoryFull1 = "La mémoire est pleine."
|
||||
StorageMemoryFull2 = "Effacez des données et réessayez."
|
||||
StoreExpressionNotAcceptedAsFunction = "Une fonction ne peut pas contenir 'store'"
|
||||
StoreExpressionNotAllowed = "'store' n'est pas autorisé"
|
||||
SyntaxError = "Attention a la syntaxe"
|
||||
ToZoom = "Zoomer : "
|
||||
Trigonometric = "Trigonometrique"
|
||||
|
||||
@@ -52,7 +52,7 @@ StatTab = "Estat"
|
||||
Step = "Passo"
|
||||
StorageMemoryFull1 = "A memoria esta chéia."
|
||||
StorageMemoryFull2 = "Apage dados e tente novamente."
|
||||
StoreExpressionNotAcceptedAsFunction = "Uma função não pode conter 'store'"
|
||||
StoreExpressionNotAllowed = "'store' não está permitido"
|
||||
SyntaxError = "Erro de sintaxe"
|
||||
ToZoom = "Zoom : "
|
||||
Trigonometric = "Trigonometrico"
|
||||
|
||||
@@ -38,18 +38,4 @@ void StorageFunctionApp::willBecomeInactive() {
|
||||
::App::willBecomeInactive();
|
||||
}
|
||||
|
||||
|
||||
bool StorageFunctionApp::isAcceptableExpression(const Expression exp, Responder * responder) {
|
||||
if (TextFieldDelegateApp::isAcceptableExpression(exp, responder)) {
|
||||
assert(!exp.isUninitialized());
|
||||
if (exp.type() == ExpressionNode::Type::Store) {
|
||||
// We do not want to allow a function to be "3->a" or "5->f(x)"
|
||||
responder->app()->displayWarning(I18n::Message::StoreExpressionNotAcceptedAsFunction);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -39,7 +39,6 @@ protected:
|
||||
StorageFunctionApp(Container * container, Snapshot * snapshot, ViewController * rootViewController) :
|
||||
ExpressionFieldDelegateApp(container, snapshot, rootViewController)
|
||||
{}
|
||||
bool isAcceptableExpression(const Poincare::Expression expression, Responder * responder) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -64,6 +64,11 @@ bool TextFieldDelegateApp::isAcceptableExpression(const Expression exp, Responde
|
||||
responder->app()->displayWarning(I18n::Message::SyntaxError);
|
||||
return false;
|
||||
}
|
||||
if (exp.type() == ExpressionNode::Type::Store) {
|
||||
// Most textfields do not allow Store "3->a" or "5->f(x)"
|
||||
responder->app()->displayWarning(I18n::Message::StoreExpressionNotAllowed);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user