Index: sources/gui/guicontroller.cpp =================================================================== diff -u -rcbea4224ad67eecc2e7c4c66df9a7db711c72832 -r846a9ebc350e33be4affab3cc4c136248900015d --- sources/gui/guicontroller.cpp (.../guicontroller.cpp) (revision cbea4224ad67eecc2e7c4c66df9a7db711c72832) +++ sources/gui/guicontroller.cpp (.../guicontroller.cpp) (revision 846a9ebc350e33be4affab3cc4c136248900015d) @@ -1,15 +1,16 @@ /*! - * + * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. - * \copyright \n - * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n - * IN PART OR IN WHOLE, \n - * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n - * - * \file guicontroller.cpp - * \date 2019/09/30 - * \author Behrouz NematiPour - * + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file guicontroller.cpp + * \author (last) Behrouz NematiPour + * \date (last) 25-Aug-2020 + * \author (original) Behrouz NematiPour + * \date (original) 24-Sep-2019 + * */ #include "guicontroller.h" @@ -73,16 +74,23 @@ // From OS : USB Drive has been removed physically. + // USB drive connect(&_ApplicationController, SIGNAL(didUSBDriveMount ()), this , SLOT( onUSBDriveMount ())); connect(&_ApplicationController, SIGNAL(didUSBDriveRemove()), this , SLOT( onUSBDriveRemove())); + // SD card + connect(&_ApplicationController, SIGNAL(didSDCardStateChange(bool,bool)), + this , SLOT( onSDCardStateChange(bool,bool))); + + // Export connect(&_ApplicationController, SIGNAL(didExport()), this , SLOT( onExport())); + // transmission fail connect(&_ApplicationController, SIGNAL(didFailedTransmit(Sequence)), - this , SLOT(didFailedTransmit(Sequence))); + this , SLOT( onFailedTransmit(Sequence))); // ---- Signal/Slots ACTION_RECEIVE_MODEL_BRIDGE_CONNECTIONS(_ApplicationController) @@ -135,7 +143,7 @@ initConnections(); - LOG_EVENT(QObject::tr("%1 Initialized").arg(metaObject()->className())); + LOG_EVENT("UI," + tr("%1 Initialized").arg(metaObject()->className())); return true; } @@ -180,7 +188,7 @@ // Process the GuiView Request. // It can be processed in GuiController take action and notify GuiView switch (vAction) { - case GuiActionType::PowerOff: + case GuiActionType::ID_PowerOff: //qApp->quit(); // GUI Controller decides (loop back) @@ -256,6 +264,21 @@ // coco end /*! + * \brief GuiController::onSDCardStateChange + * \details emits didSDCardStateChange signal to notify other classes (GuiView) + * , the SD Card state has been changed. + * \param vIsReady - SdCard is Ready + * \param vIsReadOnly - SdCard is ReadOnly + */ +void GuiController::onSDCardStateChange(bool vIsReady, bool vIsReadOnly) +{ + // coco begin validated: This needs user interaction to plug-out the SD Card + // has been tested manually + emit didSDCardStateChange(vIsReady, vIsReadOnly); +} +// coco end + +/*! * \brief GuiController::onExport * \details The slot which will be called to notify the export is done * by emitting the didExport signal. @@ -283,10 +306,10 @@ /*! * \brief GuiController::didFailedTransmit - * Raises an HD communiation timeout alarm if communication with HD is lost. + * Raises an HD communication timeout alarm if communication with HD is lost. * \param seq - Sequence that failed to transmit */ -void GuiController::didFailedTransmit(Sequence seq) +void GuiController::onFailedTransmit(Sequence seq) { Q_UNUSED(seq); AlarmStatusData data; @@ -297,4 +320,3 @@ data.mFlags = QBitArray(16, false); // 16 QBitArray of flags, if needed emit didActionReceive(data); } -