Index: sources/gui/guicontroller.cpp =================================================================== diff -u -rd6c7d6c382fe56e19d132f6ba0bcbbc1e6b2060f -r2085b749d1d0aafe823e840f5aa0bc88a340798a --- sources/gui/guicontroller.cpp (.../guicontroller.cpp) (revision d6c7d6c382fe56e19d132f6ba0bcbbc1e6b2060f) +++ sources/gui/guicontroller.cpp (.../guicontroller.cpp) (revision 2085b749d1d0aafe823e840f5aa0bc88a340798a) @@ -34,15 +34,11 @@ /*! * \brief GuiController connections definition */ -void GuiController::connection() +void GuiController::initConnections() { // From HD/DG - connect(_ApplicationController, SIGNAL(didActionCommand(GuiActionType)), - this , SLOT( onActionCommand(GuiActionType))); - // From HD/DG - connect(_ApplicationController, SIGNAL(didActionConfirm(GuiActionType, GuiActionData)), - this , SLOT( onActionConfirm(GuiActionType, GuiActionData))); - + connect(_ApplicationController, SIGNAL(didActionReceive (GuiActionType, GuiActionData)), + this , SLOT( onActionReceive (GuiActionType, GuiActionData))); } @@ -51,7 +47,7 @@ */ void GuiController::init() { - connection(); + initConnections(); } /*! @@ -63,61 +59,35 @@ * Sometimes GuiController requires to investigate with the ApplicationController to get approval from HD device.\n * \param vAction - User requested Action */ -void GuiController::doActionRequest(GuiActionType vAction) +void GuiController::doActionTransmit(GuiActionType vAction, GuiActionData vData) { // Process the GuiView Request. // It can be processed in GuiController take action and notify GuiView - GuiActionData mData = GuiActionData::Accepted; switch (vAction) { case GuiActionType::PowerOff: - //GUI Controller decides (loop back) - //case Another_Command_Which_Doesn't_Require_HD_Approval: - emit didActionConfirm(vAction, mData); + //GUI Controller decides (loop back) + //case Another_Command_Which_Doesn't_Require_HD_Approval: + if (vData == GuiActionData::NoData) // PowerOff noData is a request + emit didActionReceive (vAction, GuiActionData::Accepted); + else + emit didActionTransmit(vAction, vData); break; default: // If it requires to be Confirmed by HD/DG send the request to ApplicationController - emit didActionRequest(vAction); + emit didActionTransmit(vAction, vData); break; } } /*! - * \brief Process the performed action - * \details An action which has been commanded by HD has been performed by Gui.\n - * Gui notifies that the action has been performed - * \param vAction - * \param vData - */ -void GuiController::doActionPerform(GuiActionType vAction, GuiActionData vData) -{ - // Process the performed action by Gui - // Process ... - emit didActionPerform(vAction, vData); -} - -/*! * \brief Action commanded by HD * \details An action has been commanded by HD, * Gui requires to be notified to perform the action. * \param vAction */ -void GuiController::onActionCommand(GuiActionType vAction) +void GuiController::onActionReceive (GuiActionType vAction, GuiActionData vData) { // Process the command and notify GuiView // Process ... - emit didActionCommand(vAction); + emit didActionReceive (vAction, vData); } - -/*! - * \brief An action has been confirmed - * \details Gui requested an action. - * In response HD confirmed the action. - * \param vAction - * \param vData - */ -void GuiController::onActionConfirm(GuiActionType vAction, GuiActionData vData) -{ - // Process the command and notify GuiView - // Process ... - emit didActionConfirm(vAction, vData); -}