From 8a2ceb0440f63b1819a03e4350449cd5066063e2 Mon Sep 17 00:00:00 2001 From: Ruben Dashyan Date: Thu, 5 Sep 2019 10:33:18 +0200 Subject: [PATCH] [apps/*/go_to_parameter_controller] Use setParameterName --- apps/graph/graph/preimage_parameter_controller.cpp | 1 + apps/regression/go_to_parameter_controller.cpp | 14 +------------- apps/regression/go_to_parameter_controller.h | 1 - 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/apps/graph/graph/preimage_parameter_controller.cpp b/apps/graph/graph/preimage_parameter_controller.cpp index 89797dd0b..ef402642f 100644 --- a/apps/graph/graph/preimage_parameter_controller.cpp +++ b/apps/graph/graph/preimage_parameter_controller.cpp @@ -27,6 +27,7 @@ const char * PreimageParameterController::title() { } void PreimageParameterController::viewWillAppear() { + setParameterName(I18n::Message::Y); m_preimageGraphController->setImage(m_cursor->y()); Shared::GoToParameterController::viewWillAppear(); } diff --git a/apps/regression/go_to_parameter_controller.cpp b/apps/regression/go_to_parameter_controller.cpp index 56ddfbe4b..ade542eb2 100644 --- a/apps/regression/go_to_parameter_controller.cpp +++ b/apps/regression/go_to_parameter_controller.cpp @@ -20,6 +20,7 @@ GoToParameterController::GoToParameterController(Responder * parentResponder, In void GoToParameterController::setXPrediction(bool xPrediction) { m_xPrediction = xPrediction; + setParameterName(xPrediction ? I18n::Message::X : I18n::Message::Y); } const char * GoToParameterController::title() { @@ -78,17 +79,4 @@ bool GoToParameterController::setParameterAtIndex(int parameterIndex, double f) return true; } -void GoToParameterController::willDisplayCellForIndex(HighlightCell * cell, int index) { - if (index == numberOfRows()-1) { - return; - } - MessageTableCellWithEditableText * myCell = (MessageTableCellWithEditableText *) cell; - if (m_xPrediction) { - myCell->setMessage(I18n::Message::X); - } else { - myCell->setMessage(I18n::Message::Y); - } - FloatParameterController::willDisplayCellForIndex(cell, index); -} - } diff --git a/apps/regression/go_to_parameter_controller.h b/apps/regression/go_to_parameter_controller.h index 11a8486ac..c5d27f6c7 100644 --- a/apps/regression/go_to_parameter_controller.h +++ b/apps/regression/go_to_parameter_controller.h @@ -14,7 +14,6 @@ public: GoToParameterController(Responder * parentResponder, InputEventHandlerDelegate * inputEventHandlerDelegate, Store * store, Shared::CurveViewCursor * cursor, GraphController * graphController); void setXPrediction(bool xPrediction); const char * title() override; - void willDisplayCellForIndex(HighlightCell * cell, int index) override; private: double parameterAtIndex(int index) override; bool setParameterAtIndex(int parameterIndex, double f) override;