Index: sources/device/DeviceController.h =================================================================== diff -u -rc9f8f8cf3c6c37fc6460d8675c62c9442c4d4263 -rc73feffa73c7fe073a7a7581144f5806dfc91beb --- sources/device/DeviceController.h (.../DeviceController.h) (revision c9f8f8cf3c6c37fc6460d8675c62c9442c4d4263) +++ sources/device/DeviceController.h (.../DeviceController.h) (revision c73feffa73c7fe073a7a7581144f5806dfc91beb) @@ -46,6 +46,7 @@ int _timeout = 0; QProcess *_process = nullptr; QString _command = ""; + QStringList _arguments = {}; private slots: void onFinish(int) { @@ -55,14 +56,14 @@ deleteLater(); } public: - TimedProcess(QProcess *vProcess, const QString &vCommand, int vTimeout) - : QObject(), _timeout(vTimeout), _process(vProcess), _command(vCommand) { + TimedProcess(QProcess *vProcess, const QString &vCommand, int vTimeout, QStringList vArguments = {}) + : QObject(), _timeout(vTimeout), _process(vProcess), _command(vCommand), _arguments(vArguments) { connect(_process, SIGNAL( finished(int)), this , SLOT(onFinish (int))); } void start() { _pid = startTimer(_timeout); - _process->start(_command, QStringList()); + _process->start(_command, _arguments); } protected: @@ -109,6 +110,10 @@ QFileSystemWatcher _fileSystemWatcher; + QString _macEthernet = ""; + QString _macWireless = ""; + QString _macBluetooth = ""; + //TODO: all of these should use the TimesProcess (instead of QProcess) // to be able to kill the process automatically after the set time out. DEVICE_DEV_DEFINITION_LIST @@ -123,6 +128,11 @@ private slots: void onScreenshot(const QImage &vImage, const QString &vFileName); + void onUSBDriveUmount(); + void onWatchFileChanged(const QString &vFile); + + void onPOSTInformationReady(const QString &vMacEthernet, const QString &vMacWireless, const QString &vMacBluetooth); + protected: void timerEvent(QTimerEvent *) override; @@ -205,7 +215,16 @@ void didWatchFileChange(const QString &vFile); -private slots: + /*! + * \brief didPOSTReady + * \details This signal will be emitted when UI is done with the POST and will let DeviceView update its property(ies). + * \param vMacEthernet - Ethernet Mac Adress + * \param vMacWireless - Wireless Mac Adress + * \param vMacBluetooth - Bluetooth Mac Adress + */ + void didPOSTInformationReady(const QString &vMacEthernet, const QString &vMacWireless, const QString &vMacBluetooth); + +private: // ----- USB void usbCheck(); @@ -214,16 +233,9 @@ void usbRemove(); void usbError (const QString &vDevice); - void onUSBDriveUmount(); - - void onWatchFileChanged(const QString &vFile); - - // ----- SDCard void sdcardSpaceCheck(); + void usbSpaceCheck(); - // ----- USBDrive - void usbSpaceCheck(); - SAFE_CALL_EX(doAddWatch, const QString &) }; }