[escher] Add methods viewWillAppear/Disappear in view controller instead

of keeping track of dataHasChanged in the selectable table view

Change-Id: Id2626f527f44714e29b9bd66e2c843193e1b57b5
This commit is contained in:
Émilie Feral
2017-02-13 16:31:05 +01:00
parent 761be1c8c7
commit 6f138e6b1c
45 changed files with 176 additions and 56 deletions

View File

@@ -25,7 +25,6 @@ ValuesController::ValuesController(Responder * parentResponder, FunctionStore *
m_derivativeParameterController(DerivativeParameterController(this)),
m_setIntervalButton(Button(this, "Regler l'intervalle",Invocation([](void * context, void * sender) {
ValuesController * valuesController = (ValuesController *) context;
valuesController->hasChangedTableData();
StackViewController * stack = ((StackViewController *)valuesController->stackController());
stack->push(valuesController->intervalParameterController());
}, this), KDText::FontSize::Small)),
@@ -83,20 +82,16 @@ bool ValuesController::handleEvent(Ion::Events::Event event) {
}
if (event == Ion::Events::OK) {
if (activeRow() == -1) {
m_selectableTableView.dataHasChanged(true);
return headerViewController()->handleEvent(event);
}
if (activeRow() == 0) {
if (activeColumn() == 0) {
m_selectableTableView.dataHasChanged(true);
configureAbscissa();
return true;
}
if (isDerivativeColumn(activeColumn())) {
m_selectableTableView.dataHasChanged(true);
configureDerivativeFunction();
} else {
m_selectableTableView.dataHasChanged(true);
configureFunction();
}
return true;
@@ -291,10 +286,6 @@ Responder * ValuesController::defaultController() {
return tabController();
}
void ValuesController::hasChangedTableData() {
m_selectableTableView.dataHasChanged(true);
}
void ValuesController::selectCellAtLocation(int i, int j) {
m_selectableTableView.selectCellAtLocation(i, j);
}