Index: sources/device/DeviceController.cpp =================================================================== diff -u -rf38edd22f7b63694c21b83d6f4b69ea618390126 -r052c794d6a8db55a2fbfdad172275af073ee54c3 --- sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision f38edd22f7b63694c21b83d6f4b69ea618390126) +++ sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision 052c794d6a8db55a2fbfdad172275af073ee54c3) @@ -106,11 +106,14 @@ */ void DeviceController::initConnections() { - connect(&_ApplicationController, SIGNAL(didUSBDriveUmount()), - this , SLOT( onUSBDriveUmount())); - connect(&_Logger , SIGNAL(didRemoveLogs(bool)), - this , SLOT( onRemoveLogs(bool))); + connect(&_ApplicationController , SIGNAL(didUSBDriveUmount()), + this , SLOT( onUSBDriveUmount())); + connect(&_Logger , SIGNAL(didRemoveLogs(bool)), + this , SLOT( onRemoveLogs(bool))); + connect(this , SIGNAL(didScreenshot(const QImage &, const QString &)), + this , SLOT( onScreenshot(const QImage &, const QString &))); + DEVICE_DEV_INIT_CONNECTIONS_LIST } @@ -320,7 +323,7 @@ } if (error != lastError) { - LOG_DEBUG(error); + LOG_DEBUG("USB: " + error); lastError = error; } } @@ -513,3 +516,23 @@ emit didAttributeResponse(_deviceBrightnessResponse._data); } } + +/*! + * \brief DeviceController::doScreenshot + * \details emit the screenshot signal to run that in Device controller thread + * \param vCurrentDateTime + */ +void DeviceController::doScreenshot(const QImage &vImage, const QString &vFileName) { + emit didScreenshot(vImage, vFileName); +} + +/*! + * \brief DeviceController::onScreenshot + * \details The function to save the image vImage in the file vFileName + * \param vImage - The image source object + * \param vFileName - The filename to same the image to + */ +void DeviceController::onScreenshot(const QImage &vImage, const QString &vFileName) { + vImage.save(vFileName); + LOG_DEBUG("Screenshot saved in " + vFileName); +}