Index: sources/ApplicationController.cpp =================================================================== diff -u -r265ce7409a0ea99a4ae059f5ce7978c9cdb10631 -r8b044d8ef7db6f72c65aa6109d5f29a79bca92a2 --- sources/ApplicationController.cpp (.../ApplicationController.cpp) (revision 265ce7409a0ea99a4ae059f5ce7978c9cdb10631) +++ sources/ApplicationController.cpp (.../ApplicationController.cpp) (revision 8b044d8ef7db6f72c65aa6109d5f29a79bca92a2) @@ -133,12 +133,12 @@ connect(&_DeviceController , SIGNAL(didSDCardSpaceTooLow(quint8)), this , SLOT( onSDCardSpaceTooLow(quint8))); - connect(&_GuiController , SIGNAL(didExportLog ()), - this , SLOT( onExportLog ())); - connect(&_GuiController , SIGNAL(didExportService ()), - this , SLOT( onExportService ())); - connect(&_GuiController , SIGNAL(didExportTreatment ()), - this , SLOT( onExportTreatment ())); + connect(&_GuiController , SIGNAL(didExportLog (const GuiStringIndexMap &)), + this , SLOT( onExportLog (const GuiStringIndexMap &))); + connect(&_GuiController , SIGNAL(didExportService (const GuiStringIndexMap &)), + this , SLOT( onExportService (const GuiStringIndexMap &))); + connect(&_GuiController , SIGNAL(didExportTreatment (const GuiStringIndexMap &)), + this , SLOT( onExportTreatment (const GuiStringIndexMap &))); connect(&_Logger , SIGNAL(didExportLogs ()), this , SLOT( onExport ())); @@ -313,25 +313,25 @@ * \brief ApplicationController::onExportLog * \details the slot which will be called by UI to so the log export. */ -void ApplicationController::onExportLog() +void ApplicationController::onExportLog(const GuiStringIndexMap &vExportList) { - LOG_EXPORTLOG; + LOG_EXPORTLOG(vExportList); } /*! * \brief ApplicationController::onExportService * \details the slot which will be called by UI to do the service log export. */ -void ApplicationController::onExportService() +void ApplicationController::onExportService(const GuiStringIndexMap &vExportList) { - LOG_EXPORTERR; + LOG_EXPORTERR(vExportList); } /*! * \brief ApplicationController::onExportTreatment * \details the slot which will be called by UI to do the treatment treatment log export. */ -void ApplicationController::onExportTreatment() +void ApplicationController::onExportTreatment(const GuiStringIndexMap &vExportList) { - LOG_EXPORTTRT; + LOG_EXPORTTRT(vExportList); } /*! Index: sources/ApplicationController.h =================================================================== diff -u -r265ce7409a0ea99a4ae059f5ce7978c9cdb10631 -r8b044d8ef7db6f72c65aa6109d5f29a79bca92a2 --- sources/ApplicationController.h (.../ApplicationController.h) (revision 265ce7409a0ea99a4ae059f5ce7978c9cdb10631) +++ sources/ApplicationController.h (.../ApplicationController.h) (revision 8b044d8ef7db6f72c65aa6109d5f29a79bca92a2) @@ -95,9 +95,9 @@ void onSDCardSpaceChange(bool vReady, qint64 vTotal, qint64 vAvailable, quint8 vPercent); void onSDCardSpaceTooLow(quint8 vAvailablePercent); - void onExportLog (); - void onExportService (); - void onExportTreatment (); + void onExportLog (const GuiStringIndexMap &vExportList); + void onExportService (const GuiStringIndexMap &vExportList); + void onExportTreatment (const GuiStringIndexMap &vExportList); void onExport (); void onFailedTransmit(Sequence seq); Index: sources/gui/GuiController.cpp =================================================================== diff -u -r265ce7409a0ea99a4ae059f5ce7978c9cdb10631 -r8b044d8ef7db6f72c65aa6109d5f29a79bca92a2 --- sources/gui/GuiController.cpp (.../GuiController.cpp) (revision 265ce7409a0ea99a4ae059f5ce7978c9cdb10631) +++ sources/gui/GuiController.cpp (.../GuiController.cpp) (revision 8b044d8ef7db6f72c65aa6109d5f29a79bca92a2) @@ -336,29 +336,29 @@ * \details emits didExportLog signal to notify other classes (ApplicationController) * , the User requested to export the log. */ -void GuiController::doExportLog() +void GuiController::doExportLog(const GuiStringIndexMap &vExportList) { - emit didExportLog(); + emit didExportLog(vExportList); } /*! * \brief GuiController::doExportService * \details emits didExportService signal to notify other classes (ApplicationController) * , the User requested to export the log. */ -void GuiController::doExportService() +void GuiController::doExportService(const GuiStringIndexMap &vExportList) { - emit didExportService(); + emit didExportService(vExportList); } /*! * \brief GuiController::doExportTreatment * \details emits didExportTreatment signal to notify other classes (ApplicationController) * , the User requested to export the log. */ -void GuiController::doExportTreatment() +void GuiController::doExportTreatment(const GuiStringIndexMap &vExportList) { - emit didExportTreatment(); + emit didExportTreatment(vExportList); } /*! Index: sources/gui/GuiController.h =================================================================== diff -u -r265ce7409a0ea99a4ae059f5ce7978c9cdb10631 -r8b044d8ef7db6f72c65aa6109d5f29a79bca92a2 --- sources/gui/GuiController.h (.../GuiController.h) (revision 265ce7409a0ea99a4ae059f5ce7978c9cdb10631) +++ sources/gui/GuiController.h (.../GuiController.h) (revision 8b044d8ef7db6f72c65aa6109d5f29a79bca92a2) @@ -71,9 +71,9 @@ void doActionTransmit(GuiActionType vAction, const QVariantList &vData); // UI => HD/DG void doUSBDriveUmount (); // UI => OS - void doExportLog (); // UI => OS - void doExportService (); // UI => OS - void doExportTreatment (); // UI => OS + void doExportLog (const GuiStringIndexMap &vExportList); // UI => OS + void doExportService (const GuiStringIndexMap &vExportList); // UI => OS + void doExportTreatment (const GuiStringIndexMap &vExportList); // UI => OS private slots: // Should be private for thread safety and is connected internally. void onActionReceive (GuiActionType vAction, const QVariantList &vData); // UI <= HD/DG @@ -102,9 +102,9 @@ void didSDCardSpaceChange(bool vReady, qint64 vTotal, qint64 vAvailable, quint8 vPercent); void didSDCardSpaceTooLow(quint8 vAvailablePercent); - void didExportLog (); - void didExportService (); - void didExportTreatment (); + void didExportLog (const GuiStringIndexMap &vExportList); + void didExportService (const GuiStringIndexMap &vExportList); + void didExportTreatment (const GuiStringIndexMap &vExportList); void didExport (); // Device controller signal slots connection Index: sources/gui/GuiGlobals.cpp =================================================================== diff -u -rf502bc55feb08cd037d9caa12086d30034fe715b -r8b044d8ef7db6f72c65aa6109d5f29a79bca92a2 --- sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision f502bc55feb08cd037d9caa12086d30034fe715b) +++ sources/gui/GuiGlobals.cpp (.../GuiGlobals.cpp) (revision 8b044d8ef7db6f72c65aa6109d5f29a79bca92a2) @@ -138,6 +138,8 @@ qRegisterMetaType ("GuiRequestReasons"); + qRegisterMetaType ("GuiStringIndexMap"); + // Note that this Models are not used in the QML // but Qt needs them to be registered to be able to use them in between threads queue // by their metadata information. Index: sources/gui/GuiGlobals.h =================================================================== diff -u -rf502bc55feb08cd037d9caa12086d30034fe715b -r8b044d8ef7db6f72c65aa6109d5f29a79bca92a2 --- sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision f502bc55feb08cd037d9caa12086d30034fe715b) +++ sources/gui/GuiGlobals.h (.../GuiGlobals.h) (revision 8b044d8ef7db6f72c65aa6109d5f29a79bca92a2) @@ -435,6 +435,8 @@ typedef GuiActions::DG_Heat_UI_States GuiDisinfectDGHeatStates; typedef GuiActions::DG_Chem_UI_States GuiDisinfectDGChemicalStates; + typedef QMap GuiStringIndexMap; + /*! * \brief enumString * \details converts the enum index to it's code defined text Index: sources/gui/GuiView.cpp =================================================================== diff -u -r265ce7409a0ea99a4ae059f5ce7978c9cdb10631 -r8b044d8ef7db6f72c65aa6109d5f29a79bca92a2 --- sources/gui/GuiView.cpp (.../GuiView.cpp) (revision 265ce7409a0ea99a4ae059f5ce7978c9cdb10631) +++ sources/gui/GuiView.cpp (.../GuiView.cpp) (revision 8b044d8ef7db6f72c65aa6109d5f29a79bca92a2) @@ -69,12 +69,12 @@ this , SLOT( onExport())); // From UI : Export Log - connect(this , SIGNAL(didExportLog ()), - &_GuiController, SLOT( doExportLog ())); - connect(this , SIGNAL(didExportService ()), - &_GuiController, SLOT( doExportService ())); - connect(this , SIGNAL(didExportTreatment ()), - &_GuiController, SLOT( doExportTreatment ())); + connect(this , SIGNAL(didExportLog (const GuiStringIndexMap &)), + &_GuiController, SLOT( doExportLog (const GuiStringIndexMap &))); + connect(this , SIGNAL(didExportService (const GuiStringIndexMap &)), + &_GuiController, SLOT( doExportService (const GuiStringIndexMap &))); + connect(this , SIGNAL(didExportTreatment (const GuiStringIndexMap &)), + &_GuiController, SLOT( doExportTreatment (const GuiStringIndexMap &))); } /*! @@ -227,7 +227,7 @@ void GuiView::doExportLog() { exportRunning(true); - emit didExportLog(); + emit didExportLog(_exportList); } /*! @@ -238,7 +238,7 @@ void GuiView::doExportService() { exportRunning(true); - emit didExportService(); + emit didExportService(_exportList); } /*! @@ -249,7 +249,7 @@ void GuiView::doExportTreatment() { exportRunning(true); - emit didExportTreatment(); + emit didExportTreatment(_exportList); } /*! Index: sources/gui/GuiView.h =================================================================== diff -u -rb77869b5e44de6f8b140f6d8764efc5a2bb61a59 -r8b044d8ef7db6f72c65aa6109d5f29a79bca92a2 --- sources/gui/GuiView.h (.../GuiView.h) (revision b77869b5e44de6f8b140f6d8764efc5a2bb61a59) +++ sources/gui/GuiView.h (.../GuiView.h) (revision 8b044d8ef7db6f72c65aa6109d5f29a79bca92a2) @@ -105,8 +105,8 @@ void doExportListInsert (quint32 vIndex, const QString &vFilename ) { /* DEBUG: qDebug() << vIndex; */ _exportList [vIndex] = vFilename; exportCount( _exportList.count() ); } void doExportListDelete (quint32 vIndex ) { /* DEBUG: qDebug() << vIndex; */ _exportList.remove (vIndex) ; exportCount( _exportList.count() ); } bool doExportListSelect (quint32 vIndex ) { /* DEBUG: qDebug() << vIndex; */ return _exportList.contains(vIndex) ; } + void doExportListRemove ( ) { _exportList.clear ( ) ; exportCount( _exportList.count() ); } - signals: void didActionReceive (GuiActionType vAction, const QVariantList &vData); // UI <= HD/DG void didActionTransmit(GuiActionType vAction, const QVariantList &vData); // UI => HD/DG @@ -116,9 +116,9 @@ void didUSBDriveRemove(); void didUSBSpaceChange(bool vReady, qint64 vTotal, qint64 vAvailable, quint8 vPercent); - void didExportLog (); - void didExportService (); - void didExportTreatment (); + void didExportLog (const GuiStringIndexMap &vExportList); + void didExportService (const GuiStringIndexMap &vExportList); + void didExportTreatment (const GuiStringIndexMap &vExportList); void didExport (); }; } Index: sources/gui/qml/pages/settings/SettingsExportLogs.qml =================================================================== diff -u -rb77869b5e44de6f8b140f6d8764efc5a2bb61a59 -r8b044d8ef7db6f72c65aa6109d5f29a79bca92a2 --- sources/gui/qml/pages/settings/SettingsExportLogs.qml (.../SettingsExportLogs.qml) (revision b77869b5e44de6f8b140f6d8764efc5a2bb61a59) +++ sources/gui/qml/pages/settings/SettingsExportLogs.qml (.../SettingsExportLogs.qml) (revision 8b044d8ef7db6f72c65aa6109d5f29a79bca92a2) @@ -60,7 +60,7 @@ readonly property string typeLabelService : qsTr("Service" ) readonly property string typeLabelTreatment : qsTr("Treatment" ) - property bool isDevice : true //false// + property bool isDevice : true //false // readonly property string typePathClr : "" readonly property string typePathSrc : isDevice ? "file:///media/sd-card" : "file:///home/denali/Desktop/sd-card" readonly property string typePathDst : isDevice ? "file:///media/usb" : "file:///home/denali/Desktop/usb-disk" @@ -109,6 +109,7 @@ function updatePanels (vIndex) { isUpdatePanels = true + _GuiView.doExportListRemove() _sdcFolderColumn.clearModel() _usbFolderColumn.clearModel() Index: sources/storage/Logger.cpp =================================================================== diff -u -r265ce7409a0ea99a4ae059f5ce7978c9cdb10631 -r8b044d8ef7db6f72c65aa6109d5f29a79bca92a2 --- sources/storage/Logger.cpp (.../Logger.cpp) (revision 265ce7409a0ea99a4ae059f5ce7978c9cdb10631) +++ sources/storage/Logger.cpp (.../Logger.cpp) (revision 8b044d8ef7db6f72c65aa6109d5f29a79bca92a2) @@ -340,8 +340,9 @@ * into USB drive folder (Storage::USB_Mount_Point) * \return true if at least one file has been exported */ -bool Logger::exportLogs() +bool Logger::exportLogs(const Gui::GuiStringIndexMap &vExportList) { + // DEBUG: qDebug() << __FUNCTION__ << vExportList; return false; // qDebug() << " ~~~~~~~~~~ " << QThread::currentThread()->objectName(); int result = 0; static QString mOSource; @@ -365,8 +366,9 @@ * into USB drive folder (Storage::USB_Mount_Point) * \return true if at least one file has been exported */ -bool Logger::exportErrs() +bool Logger::exportErrs(const Gui::GuiStringIndexMap &vExportList) { + // DEBUG: qDebug() << __FUNCTION__ << vExportList; return false; // qDebug() << " ~~~~~~~~~~ " << QThread::currentThread()->objectName(); int result = 0; QString mDestination = USB_Mount_Point; @@ -382,8 +384,9 @@ * into USB drive folder (Storage::USB_Mount_Point) * \return true if at least one file has been exported */ -bool Logger::exportTrts() +bool Logger::exportTrts(const Gui::GuiStringIndexMap &vExportList) { + // DEBUG: qDebug() << __FUNCTION__ << vExportList; return false; // qDebug() << " ~~~~~~~~~~ " << QThread::currentThread()->objectName(); int result = 0; QString mDestination = USB_Mount_Point; @@ -413,13 +416,13 @@ * \return always returns true for now. * \note This method uses QtConcurrent run to execute the FileHandler copyFolder method. */ -bool Logger::concurrentExportLogs() +bool Logger::concurrentExportLogs(const Gui::GuiStringIndexMap &vExportList) { if ( ! concurrentExportIsOk() ) return false; _exportLogsType = eLogEvent; LOG_DEBUG(QString("Export %1 start").arg(_logNames[_exportLogsType])); - QFuture future = QtConcurrent::run(this, &Logger::exportLogs); + QFuture future = QtConcurrent::run(this, &Logger::exportLogs, vExportList); _exportLogsWatcher.setFuture(future); return true; } @@ -430,13 +433,13 @@ * \return always returns true for now. * \note This method uses QtConcurrent run to execute the FileHandler copyFolder method. */ -bool Logger::concurrentExportErrs() +bool Logger::concurrentExportErrs(const Gui::GuiStringIndexMap &vExportList) { if ( ! concurrentExportIsOk() ) return false; _exportLogsType = eLogDebug; LOG_DEBUG(QString("Export %1 start").arg(_logNames[_exportLogsType])); - QFuture future = QtConcurrent::run(this, &Logger::exportErrs); + QFuture future = QtConcurrent::run(this, &Logger::exportErrs, vExportList); _exportLogsWatcher.setFuture(future); return true; } @@ -447,13 +450,13 @@ * \return always returns true for now. * \note This method uses QtConcurrent run to execute the FileHandler copyFolder method. */ -bool Logger::concurrentExportTrts() +bool Logger::concurrentExportTrts(const Gui::GuiStringIndexMap &vExportList) { if ( ! concurrentExportIsOk() ) return false; _exportLogsType = eLogTrtmt; LOG_DEBUG(QString("Export %1 start").arg(_logNames[_exportLogsType])); - QFuture future = QtConcurrent::run(this, &Logger::exportTrts); + QFuture future = QtConcurrent::run(this, &Logger::exportTrts, vExportList); _exportLogsWatcher.setFuture(future); return true; } Index: sources/storage/Logger.h =================================================================== diff -u -r265ce7409a0ea99a4ae059f5ce7978c9cdb10631 -r8b044d8ef7db6f72c65aa6109d5f29a79bca92a2 --- sources/storage/Logger.h (.../Logger.h) (revision 265ce7409a0ea99a4ae059f5ce7978c9cdb10631) +++ sources/storage/Logger.h (.../Logger.h) (revision 8b044d8ef7db6f72c65aa6109d5f29a79bca92a2) @@ -22,13 +22,14 @@ // Project #include "main.h" // Doxygen : do not remove #include "StorageGlobals.h" +#include "GuiGlobals.h" // Define #define _Logger Storage::Logger::I() -#define LOG_EXPORTLOG _Logger.concurrentExportLogs() -#define LOG_EXPORTERR _Logger.concurrentExportErrs() -#define LOG_EXPORTTRT _Logger.concurrentExportTrts() +#define LOG_EXPORTLOG(vExportName) _Logger.concurrentExportLogs(vExportName) +#define LOG_EXPORTERR(vExportName) _Logger.concurrentExportErrs(vExportName) +#define LOG_EXPORTTRT(vExportName) _Logger.concurrentExportTrts(vExportName) #define ADD_EVENT_HEADER emit Storage::Logger::I().didLog(_headerE, Storage::Logger::LogType::eLogEvent, false) #define LOG_EVENT(vCONTENT) emit Storage::Logger::I().didLog(vCONTENT, Storage::Logger::LogType::eLogEvent, true ) @@ -198,14 +199,14 @@ // ----- Export structure private : - bool exportLogs(); - bool exportErrs(); - bool exportTrts(); + bool exportLogs(const Gui::GuiStringIndexMap &vExportList); + bool exportErrs(const Gui::GuiStringIndexMap &vExportList); + bool exportTrts(const Gui::GuiStringIndexMap &vExportList); public slots: // this slot is thread safe and can be called from outside by LOG_EXPORT. bool concurrentExportIsOk (); - bool concurrentExportLogs (); - bool concurrentExportErrs (); - bool concurrentExportTrts (); + bool concurrentExportLogs (const Gui::GuiStringIndexMap &vExportList); + bool concurrentExportErrs (const Gui::GuiStringIndexMap &vExportList); + bool concurrentExportTrts (const Gui::GuiStringIndexMap &vExportList); void onExportLogs (); signals: void didExportLogs();