Index: sources/gui/GuiController.cpp =================================================================== diff -u -r7ebc073150532073ae7f1a0e768272bcff5d6fb3 -r465a935949a85d3d1bebd11979737ff38ef96122 --- sources/gui/GuiController.cpp (.../GuiController.cpp) (revision 7ebc073150532073ae7f1a0e768272bcff5d6fb3) +++ sources/gui/GuiController.cpp (.../GuiController.cpp) (revision 465a935949a85d3d1bebd11979737ff38ef96122) @@ -80,10 +80,14 @@ this , SLOT( onUSBDriveMount ())); connect(&_ApplicationController, SIGNAL(didUSBDriveRemove()), this , SLOT( onUSBDriveRemove())); + connect(&_ApplicationController, SIGNAL(didUSBSpaceChange(bool, qint64, qint64, quint8)), + this , SLOT( onUSBSpaceChange(bool, qint64, qint64, quint8))); // SD card connect(&_ApplicationController, SIGNAL(didSDCardStateChange(bool,bool)), this , SLOT( onSDCardStateChange(bool,bool))); + connect(&_ApplicationController, SIGNAL(didSDCardSpaceChange(bool, qint64, qint64, quint8)), + this , SLOT( onSDCardSpaceChange(bool, qint64, qint64, quint8))); connect(&_ApplicationController, SIGNAL(didSDCardSpaceTooLow(quint8)), this , SLOT( onSDCardSpaceTooLow(quint8))); @@ -263,12 +267,15 @@ */ void GuiController::onUSBDriveRemove() { - // disabled coco begin validated: This needs user interaction to plug-out the USB device - // has been tested manually emit didUSBDriveRemove(); } -// disabled coco end +void GuiController::onUSBSpaceChange(bool vReady, qint64 vTotal, qint64 vAvailable, quint8 vPercent) +{ + //DEBUG:0: qDebug() << "GuiController::onUSBSpaceChange" << vReady << vTotal << vAvailable << vPercent; + emit didUSBSpaceChange(vReady, vTotal, vAvailable, vPercent); +} + /*! * \brief GuiController::onSDCardStateChange * \details emits didSDCardStateChange signal to notify other classes (GuiView) @@ -278,14 +285,29 @@ */ void GuiController::onSDCardStateChange(bool vIsReady, bool vIsReadOnly) { - // disabled coco begin validated: This needs user interaction to plug-out the SD Card - // has been tested manually - /// DEBUG: qDebug() << " ***** GuiController " << Storage::SDCard_Base_Path_Name << vIsReady; + //DEBUG:0: qDebug() << " ***** GuiController " << Storage::SDCard_Base_Path_Name << vIsReady << vIsReadOnly << gDisableSDCFailLogStop; + + static bool hasAlarm = false; // to make it clear the alarm only once. + if ( ( ! vIsReady || vIsReadOnly ) && ! gDisableSDCFailLogStop ) { + hasAlarm = true; + AlarmStatusData data = AlarmGenerator::ALARM_ID_UI_POST_FAILURE_SDCARD(); + emit didActionReceive(data); + } + else if ( hasAlarm ) { + hasAlarm = false; + AlarmStatusData data = AlarmGenerator::ALARM_ID_NO_ALARM(); + emit didActionReceive(data); + } + emit didSDCardStateChange(vIsReady, vIsReadOnly); } -// disabled coco end +void GuiController::onSDCardSpaceChange(bool vReady, qint64 vTotal, qint64 vAvailable, quint8 vPercent) +{ + emit didSDCardSpaceChange(vReady, vTotal, vAvailable, vPercent); +} + /*! * \brief GuiController::onSDCardSpaceTooLow * \details The handler slot for the didSDCardSpaceTooLow signal comes form ApplicationController.