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

@@ -81,7 +81,7 @@ bool ListController::handleEvent(Ion::Events::Event event) {
if (event == Ion::Events::Up && selectedRow() == -1) {
footer()->setSelectedButton(-1);
selectableTableView()->selectCellAtLocation(0, numberOfRows()-1);
app()->setFirstResponder(selectableTableView());
Container::activeApp()->setFirstResponder(selectableTableView());
return true;
}
if (event == Ion::Events::Down) {
@@ -105,7 +105,7 @@ void ListController::didBecomeFirstResponder() {
selectCellAtLocation(selectedColumn(), numberOfRows()-1);
}
footer()->setSelectedButton(-1);
app()->setFirstResponder(selectableTableView());
Container::activeApp()->setFirstResponder(selectableTableView());
}
void ListController::didEnterResponderChain(Responder * previousFirstResponder) {
@@ -132,7 +132,7 @@ bool ListController::textFieldDidReceiveEvent(TextField * textField, Ion::Events
textField->handleEvent(Ion::Events::ShiftRight);
textField->handleEventWithText("=0");
if (!textRepresentsAnEquality(textField->text())) {
app()->displayWarning(I18n::Message::RequireEquation);
Container::activeApp()->displayWarning(I18n::Message::RequireEquation);
return true;
}
}
@@ -149,7 +149,7 @@ bool ListController::layoutFieldDidReceiveEvent(LayoutField * layoutField, Ion::
layoutField->handleEvent(Ion::Events::ShiftRight);
layoutField->handleEventWithText("=0");
if (!layoutRepresentsAnEquality(layoutField->layout())) {
app()->displayWarning(I18n::Message::RequireEquation);
Container::activeApp()->displayWarning(I18n::Message::RequireEquation);
return true;
}
}
@@ -172,22 +172,22 @@ bool ListController::layoutFieldDidFinishEditing(LayoutField * layoutField, Poin
void ListController::resolveEquations() {
if (m_equationStore->numberOfDefinedModels() == 0) {
app()->displayWarning(I18n::Message::EnterEquation);
Container::activeApp()->displayWarning(I18n::Message::EnterEquation);
return;
}
EquationStore::Error e = m_equationStore->exactSolve(textFieldDelegateApp()->localContext());
switch (e) {
case EquationStore::Error::EquationUndefined:
app()->displayWarning(I18n::Message::UndefinedEquation);
Container::activeApp()->displayWarning(I18n::Message::UndefinedEquation);
return;
case EquationStore::Error::EquationUnreal:
app()->displayWarning(I18n::Message::UnrealEquation);
Container::activeApp()->displayWarning(I18n::Message::UnrealEquation);
return;
case EquationStore::Error::TooManyVariables:
app()->displayWarning(I18n::Message::TooManyVariables);
Container::activeApp()->displayWarning(I18n::Message::TooManyVariables);
return;
case EquationStore::Error::NonLinearSystem:
app()->displayWarning(I18n::Message::NonLinearSystem);
Container::activeApp()->displayWarning(I18n::Message::NonLinearSystem);
return;
case EquationStore::Error::RequireApproximateSolution:
{
@@ -209,7 +209,7 @@ void ListController::reloadButtonMessage() {
}
void ListController::addEmptyModel() {
app()->displayModalViewController(&m_modelsStackController, 0.f, 0.f, Metric::CommonTopMargin, Metric::CommonRightMargin, 0, Metric::CommonLeftMargin);
Container::activeApp()->displayModalViewController(&m_modelsStackController, 0.f, 0.f, Metric::CommonTopMargin, Metric::CommonRightMargin, 0, Metric::CommonLeftMargin);
}
bool ListController::removeModelRow(Ion::Storage::Record record) {