Index: sources/gui/GuiView.cpp =================================================================== diff -u -r3a528c6f3fce8132de2791b55d3227e715d68898 -r465a935949a85d3d1bebd11979737ff38ef96122 --- sources/gui/GuiView.cpp (.../GuiView.cpp) (revision 3a528c6f3fce8132de2791b55d3227e715d68898) +++ sources/gui/GuiView.cpp (.../GuiView.cpp) (revision 465a935949a85d3d1bebd11979737ff38ef96122) @@ -57,25 +57,24 @@ this , SLOT( onUSBDriveMount ())); connect(&_GuiController, SIGNAL(didUSBDriveRemove()), this , SLOT( onUSBDriveRemove())); + connect(&_GuiController, SIGNAL(didUSBSpaceChange(bool, qint64, qint64, quint8)), + this , SLOT( onUSBSpaceChange(bool, qint64, qint64, quint8))); - // USB Drive - connect(&_DeviceController, SIGNAL( didUSBSpaceChange(bool, qint64, qint64, quint8)), - this , SLOT( onUSBSpaceChange(bool, qint64, qint64, quint8))); - // SD Card - connect(&_GuiController, SIGNAL(didSDCardStateChange(bool,bool)), - this , SLOT( onSDCardStateChange(bool,bool))); + connect(&_GuiController , SIGNAL(didSDCardStateChange(bool,bool)), + this , SLOT( onSDCardStateChange(bool,bool))); + connect(&_GuiController , SIGNAL(didSDCardSpaceChange(bool, qint64, qint64, quint8)), + this , SLOT( onSDCardSpaceChange(bool, qint64, qint64, quint8))); + connect(&_GuiController , SIGNAL(didExport()), + this , SLOT( onExport())); - /// TEST: Test the space on GUI, not sure if we keep it. - connect(&_DeviceController, SIGNAL( didSDCardSpaceChange(bool, qint64, qint64, quint8)), - this , SLOT( onSDCardSpaceChange(bool, qint64, qint64, quint8))); - - connect(&_GuiController, SIGNAL(didExport()), - this , SLOT( onExport())); - // From UI : Export Log - connect(this , SIGNAL(didExportLog()), - &_GuiController, SLOT( doExportLog())); + connect(this , SIGNAL(didExportLog ()), + &_GuiController, SLOT( doExportLog ())); + connect(this , SIGNAL(didExportService ()), + &_GuiController, SLOT( doExportService ())); + connect(this , SIGNAL(didExportTreatment ()), + &_GuiController, SLOT( doExportTreatment ())); } /*! @@ -153,6 +152,7 @@ // has been tested manually usbIsReady (false); usbIsRemoved(false); + exportRunning(false); emit didUSBDriveUmount(); } // disabled coco end @@ -168,6 +168,7 @@ // has been tested manually usbIsReady (false); usbIsRemoved(true ); + exportRunning(false); emit didUSBDriveRemove(); } // disabled coco end @@ -183,9 +184,12 @@ { // disabled 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; + //DEBUG:0: qDebug() << " ***** GuiView " << Storage::SDCard_Base_Path_Name << vIsReady; sdIsReady (vIsReady ); sdIsReadOnly(vIsReadOnly); + if (! vIsReady || vIsReadOnly) exportRunning(false); + + //DEBUG:0: qDebug() << __FUNCTION__ << _sdIsReady << _sdIsReadOnly; } // disabled coco end @@ -209,8 +213,9 @@ */ void GuiView::onExport() { - emit didExport(); exportRunning(false); + emit didExport(); + //DEBUG:0: qDebug() << " ~~~~~ " << "GuiView::onExport" << _exportRunning; } @@ -226,6 +231,28 @@ } /*! + * \brief GuiView::doExportService + * \details emits didExportService signal to notify other classes (GuiController) + * , the User requested to export the log. + */ +void GuiView::doExportService() +{ + exportRunning(true); + emit didExportService(); +} + +/*! + * \brief GuiView::doExportTreatment + * \details emits didExportTreatment signal to notify other classes (GuiController) + * , the User requested to export the log. + */ +void GuiView::doExportTreatment() +{ + exportRunning(true); + emit didExportTreatment(); +} + +/*! * \brief GuiView::onSDCardSpaceChange * \details SD Card storage space parameter change slot. * This slot when called is calling the function concurrentRemoveLogs, @@ -238,25 +265,21 @@ */ void GuiView::onSDCardSpaceChange(bool vReady, qint64 vTotal, qint64 vAvailable, quint8 vPercent) { - // disabled 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 ( Storage::Log_Min_Available_Total_Space_IsLow(vPercent) ); } -// disabled coco end void GuiView::onUSBSpaceChange(bool vReady, qint64 vTotal, qint64 vAvailable, quint8 vPercent) { - // has been tested manually - /// DEBUG: qDebug() << vReady << vTotal << vAvailable << vPercent << Storage::Available_Space_Percent; + // DEBUG: qDebug() << "GuiView::onUSBSpaceChange" << vReady << vTotal << vAvailable << vPercent; usbTotal ( vTotal ); usbAvail ( vAvailable ); usbPercent ( vPercent ); usbIsReady ( vReady ); - // TODO : the space check should also be done for the USB as destination but needs calculation has will be done later. + // TODO : the space check should also be done for the USB as destination but needs calculation and will be done later. // usbIsLow ( vPercent <= Storage::Available_Space_Percent ); }