Substitute Escher app() by Container::activeApp()

This commit is contained in:
Ruben Dashyan
2019-07-18 16:10:26 +02:00
committed by EmilieNumworks
parent 1a2a651f36
commit 44809f4b3f
101 changed files with 181 additions and 197 deletions

View File

@@ -36,7 +36,7 @@ void StoreController::ContentView::displayFormulaInput(bool display) {
}
void StoreController::ContentView::didBecomeFirstResponder() {
app()->setFirstResponder(m_displayFormulaInputView ? static_cast<Responder *>(&m_formulaInputView) : static_cast<Responder *>(&m_dataView));
Container::activeApp()->setFirstResponder(m_displayFormulaInputView ? static_cast<Responder *>(&m_formulaInputView) : static_cast<Responder *>(&m_dataView));
}
View * StoreController::ContentView::subviewAtIndex(int index) {
@@ -86,12 +86,12 @@ bool StoreController::textFieldDidFinishEditing(TextField * textField, const cha
// Handle formula input
Expression expression = Expression::Parse(textField->text());
if (expression.isUninitialized()) {
app()->displayWarning(I18n::Message::SyntaxError);
Container::activeApp()->displayWarning(I18n::Message::SyntaxError);
return false;
}
m_contentView.displayFormulaInput(false);
if (fillColumnWithFormula(expression)) {
app()->setFirstResponder(&m_contentView);
Container::activeApp()->setFirstResponder(&m_contentView);
}
return true;
}
@@ -107,7 +107,7 @@ bool StoreController::textFieldDidFinishEditing(TextField * textField, const cha
bool StoreController::textFieldDidAbortEditing(TextField * textField) {
if (textField == m_contentView.formulaInputView()->textField()) {
m_contentView.displayFormulaInput(false);
app()->setFirstResponder(&m_contentView);
Container::activeApp()->setFirstResponder(&m_contentView);
return true;
}
return EditableCellTableViewController::textFieldDidAbortEditing(textField);
@@ -185,7 +185,7 @@ bool StoreController::handleEvent(Ion::Events::Event event) {
if (event == Ion::Events::Up) {
selectableTableView()->deselectTable();
assert(selectedRow() == -1);
app()->setFirstResponder(tabController());
Container::activeApp()->setFirstResponder(tabController());
return true;
}
assert(selectedColumn() >= 0 && selectedColumn() < numberOfColumns());
@@ -213,7 +213,7 @@ void StoreController::didBecomeFirstResponder() {
selectCellAtLocation(0, 0);
}
EditableCellTableViewController::didBecomeFirstResponder();
app()->setFirstResponder(&m_contentView);
Container::activeApp()->setFirstResponder(&m_contentView);
}
Responder * StoreController::tabController() const {
@@ -289,7 +289,7 @@ bool StoreController::privateFillColumnWithFormula(Expression formula, Expressio
// Compute the new value using the formula
double evaluation = PoincareHelpers::ApproximateToScalar<double>(formula, *store);
if (std::isnan(evaluation) || std::isinf(evaluation)) {
app()->displayWarning(I18n::Message::DataNotSuitable);
Container::activeApp()->displayWarning(I18n::Message::DataNotSuitable);
return false;
}
}