[apps/graph/list] Display warning when no function can be deleted

Change-Id: Id872300984efab3b30b8a7c97d7c83b4f6afd4cb
This commit is contained in:
Émilie Feral
2017-01-20 10:29:55 +01:00
parent 4b49be549d
commit 01904bc16e

View File

@@ -55,7 +55,14 @@ bool ParameterController::handleEvent(Ion::Events::Event event) {
stack->pop();
return true;
} else {
// TODO: add an warning "no function to delete!"
if (m_functionStore->numberOfDefinedFunctions() == 1) {
Function * f = m_functionStore->definedFunctionAtIndex(0);
f->setContent("");
StackViewController * stack = (StackViewController *)(parentResponder());
stack->pop();
return true;
}
app()->displayWarning("Pas de fonction a supprimer");
return false;
}
}