[apps/graph/list] handle deleting functions from the parameter page

Change-Id: I34eff520f40ed5901011499c770c1b06d72b3cc7
This commit is contained in:
Émilie Feral
2016-09-22 15:08:07 +02:00
parent 82ea774621
commit ff70414108
3 changed files with 13 additions and 5 deletions

View File

@@ -1,13 +1,14 @@
#include "parameter_controller.h"
#include <assert.h>
ParameterController::ParameterController(Responder * parentResponder) :
ParameterController::ParameterController(Responder * parentResponder, Graph::FunctionStore * functionStore) :
ViewController(parentResponder),
m_colorCell(TableViewCell((char*)"Couleur de la fonction")),
m_enableCell(SwitchTableViewCell((char*)"Activer/Desactiver")),
m_deleteCell(TableViewCell((char*)"Supprimer la fonction")),
m_tableView(TableView(this)),
m_activeCell(0)
m_activeCell(0),
m_functionStore(functionStore)
{
}
@@ -78,13 +79,19 @@ bool ParameterController::handleEnter() {
return true;
}
case 2:
{
m_functionStore->removeFunction(m_function);
StackViewController * stack = (StackViewController *)(parentResponder());
stack->pop();
return true;
}
default:
{
return false;
}
}
}
int ParameterController::numberOfCells() {
return k_totalNumberOfCell;
};