From 01904bc16eff726a5d7ef60266e4e0d29b190d4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Fri, 20 Jan 2017 10:29:55 +0100 Subject: [PATCH] [apps/graph/list] Display warning when no function can be deleted Change-Id: Id872300984efab3b30b8a7c97d7c83b4f6afd4cb --- apps/graph/list/parameter_controller.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/graph/list/parameter_controller.cpp b/apps/graph/list/parameter_controller.cpp index 14e77082d..cb2ead430 100644 --- a/apps/graph/list/parameter_controller.cpp +++ b/apps/graph/list/parameter_controller.cpp @@ -55,7 +55,14 @@ bool ParameterController::handleEvent(Ion::Events::Event event) { stack->pop(); return true; } else { - // TODO: add an warning "no function to delete!" + if (m_functionStore->numberOfDefinedFunctions() == 1) { + Function * f = m_functionStore->definedFunctionAtIndex(0); + f->setContent(""); + StackViewController * stack = (StackViewController *)(parentResponder()); + stack->pop(); + return true; + } + app()->displayWarning("Pas de fonction a supprimer"); return false; } }