Index: sources/gui/GuiView.cpp =================================================================== diff -u -ra3030123e885fb9f22dea5839c4e988896a257e4 -re159592e3a99658e661ab83fffef43322dc075f3 --- sources/gui/GuiView.cpp (.../GuiView.cpp) (revision a3030123e885fb9f22dea5839c4e988896a257e4) +++ sources/gui/GuiView.cpp (.../GuiView.cpp) (revision e159592e3a99658e661ab83fffef43322dc075f3) @@ -16,6 +16,7 @@ // Project #include "GuiView.h" #include "GuiController.h" +#include "DriveWatcher.h" // namespace using namespace Gui; @@ -42,7 +43,7 @@ connect(&_GuiController, SIGNAL(didActionReceive (GuiActionType, const QVariantList &)), this , SLOT( onActionReceive (GuiActionType, const QVariantList &))); - // since we don't have access to this object because it is created in Qml. + // since we don't 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 &)), @@ -60,9 +61,11 @@ // SD Card connect(&_GuiController, SIGNAL(didSDCardStateChange(bool,bool)), this , SLOT( onSDCardStateChange(bool,bool))); - connect(&_GuiController, SIGNAL(didSDCardStateChange(bool,bool)), - this , SLOT( onSDCardStateChange(bool,bool))); + /// TEST: Test the space on GUI, not sure if we keep it. + connect(&_DriveWatcher, SIGNAL( didSDCardSpaceChange(bool, qint64, qint64, quint8)), + this , SLOT( onSDCardSpaceChange(bool, qint64, qint64, quint8))); + connect(&_GuiController, SIGNAL(didExport()), this , SLOT( onExport())); @@ -162,14 +165,15 @@ /*! * \brief GuiView::onSDCardStateChange * \details emits didSDCardStateChange signal to notify other classes (UI) - * , the SD Card Stte has been changed. - * \param vIsReady - SdCard is Ready - * \param vIsReadOnly - SdCard is ReadOnly + * , the SD Card State has been changed. + * \param vIsReady - SDCard is Ready + * \param vIsReadOnly - SDCard is ReadOnly */ void GuiView::onSDCardStateChange(bool vIsReady, bool vIsReadOnly) { // coco begin validated: This needs user interaction to plug-in USB device // has been tested manually + /// DEBUG: qDebug() << " ***** GuiView " << Storage::SDCard_Base_Path_Name << vIsReady; sdIsReady (vIsReady ); sdIsReadOnly(vIsReadOnly); } @@ -213,3 +217,27 @@ emit didExportLog(); } // coco end + +/*! + * \brief GuiView::onSDCardSpaceChange + * \details SD Card storage space parameter change slot. + * This slot when called is calling the function concurrentRemoveLogs, + * if percent of available space vPercent is less than Storage::Available_Space_Percent, + * if the SD Card is ready (vReady is true) + * \param vReady - The SD Card is Ready + * \param vTotal - Total storage space on the SD Card + * \param vAvailable - Available storage space on the SD Card + * \param vPercent - Percent of available storage space on the SD Card + */ +void GuiView::onSDCardSpaceChange(bool vReady, qint64 vTotal, qint64 vAvailable, quint8 vPercent) +{ + // coco begin validated: This needs user interaction to change the SD card files system. + // has been tested manually + /// DEBUG: qDebug() << vReady << vTotal << vAvailable << vPercent << Storage::Available_Space_Percent; + Q_UNUSED(vReady) + sdTotal ( vTotal ); + sdAvail ( vAvailable ); + sdPercent ( vPercent ); + sdIsLow ( vPercent <= Storage::Available_Space_Percent ); +} +// coco end