Index: sources/gui/GuiView.cpp =================================================================== diff -u -r7f2b5b06e41e5ab0b86c0b7107a77786e01ce5fa -r64484a210332da6b2dcf3f0a23cb6c59f4caaf98 --- sources/gui/GuiView.cpp (.../GuiView.cpp) (revision 7f2b5b06e41e5ab0b86c0b7107a77786e01ce5fa) +++ sources/gui/GuiView.cpp (.../GuiView.cpp) (revision 64484a210332da6b2dcf3f0a23cb6c59f4caaf98) @@ -43,15 +43,21 @@ */ void GuiView::initConnections() { + connect(&_GuiController, SIGNAL(didActionReceive (GuiActionType, const QVariantList &)), + this , SLOT( onActionReceive (GuiActionType, const QVariantList &))); + // since we do not have access to this object because it is created in QML. // Connection to the GuiController made here // It should be defined in the class which wants to connect to signal. + connect(this , SIGNAL(didActionTransmit(GuiActionType,const QVariantList &)), + &_GuiController, SLOT( doActionTransmit(GuiActionType,const QVariantList &))); connect(this , SIGNAL(didQuitApplication()), &_GuiController, SLOT( doQuitApplication())); // From UI : USB drive umount connect(this , SIGNAL(didUSBDriveUmount()), &_GuiController, SLOT( doUSBDriveUmount())); + // From OS : USB drive removed connect(&_GuiController, SIGNAL(didUSBDriveMount ()), this , SLOT( onUSBDriveMount ())); @@ -83,6 +89,51 @@ } /*! + * \brief GuiView::onActionReceive + * \details emits didActionReceive signal to notify other classes (Gui) + * , an action has been received. + * \param vAction - the action + * \param vData - the action data + */ +void GuiView::onActionReceive (GuiActionType vAction, const QVariantList &vData) +{ + // process the evaluation and notify GUI + emit didActionReceive (vAction, vData); +} + +/*! + * \brief GuiView::doActionTransmit + * \details emits didActionTransmit signal to notify other classes (GuiController) + * , an action has been required to be transmitted. + * \param vAction - the action + * \param vData - the action data + */ +void GuiView::doActionTransmit(GuiActionType vAction, const QVariantList &vData) +{ + // TODO : Remove this code later when Investigated thoroughly. + // This code later needs to be removed when Investigated thoroughly. + emit didActionTransmit(vAction, vData); +} + +/*! + * \brief GuiView::doActionTransmit + * \details emits didActionTransmit signal to notify other classes (GuiController) + * , an action has been required to be transmitted. + * \note The overloaded method with only one data parameter, for easier use in qml. + * \param vAction - the action + * \param vData - the action data + */ + +void GuiView::doActionTransmit(GuiActionType vAction, const QVariant &vData) +{ + // TODO : Remove this code later when Investigated thoroughly. + // This code later needs to be removed when Investigated thoroughly. + QVariantList mData; + mData += vData; + emit didActionTransmit(vAction, mData); +} + +/*! * \brief GuiView::doUSBDriveMount * \details emits didUSBDriveMount signal to notify other classes (UI) * , the USB drive has been mounted.