Index: sources/device/DeviceView.cpp =================================================================== diff -u -r46231564422493a69e3120459adefe1320eba255 -r9ebd78edd3127e38ee92b2e870430f12731244bc --- sources/device/DeviceView.cpp (.../DeviceView.cpp) (revision 46231564422493a69e3120459adefe1320eba255) +++ sources/device/DeviceView.cpp (.../DeviceView.cpp) (revision 9ebd78edd3127e38ee92b2e870430f12731244bc) @@ -63,6 +63,7 @@ response(true); } +// ================================================= Crypt Setup void VDevice::doInitCryptSetup() { // Nothing for now. } @@ -94,12 +95,13 @@ accepted(vData.mAccepted); reason (vData.mReason ); - cryptSetupEnabled(true); + cryptSetupEnabled(isCompleteResponse(vData)); // has to be the last one response(true); } +// ================================================= Bluetooth Paired Reset void VDevice::doInitBluetoothPairedReset() { // DEBUG : qDebug() << "HERE Init"; DeviceBluetoothPairedResetRequestData data; @@ -124,6 +126,7 @@ response(true); } +// ================================================= Bluetooth Paired Query void VDevice::doInitBluetoothPairedQuery() { // DEBUG : qDebug() << "HERE Init"; DeviceBluetoothPairedQueryRequestData data; @@ -148,7 +151,7 @@ response(true); } -/// ---------- RootSSHAccess +// ================================================= RootSSHAccess void VDevice::doInitRootSSHAccess() { // DEBUG : qDebug() << "HERE Request" << vValue; DeviceRootSSHAccessRequestData data; @@ -206,7 +209,7 @@ accepted(vData.mAccepted); reason (vData.mReason ); - factoryResetEnabled(true); + factoryResetEnabled(isCompleteResponse(vData)); // has to be the last one response(true); @@ -243,7 +246,7 @@ accepted(vData.mAccepted); reason (vData.mReason ); - decommissionEnabled(true); + decommissionEnabled(isCompleteResponse(vData)); // has to be the last one response(true); Index: sources/device/DeviceView.h =================================================================== diff -u -r5a4a26f106ba03759e3a89b19690fa678f8a3aca -r9ebd78edd3127e38ee92b2e870430f12731244bc --- sources/device/DeviceView.h (.../DeviceView.h) (revision 5a4a26f106ba03759e3a89b19690fa678f8a3aca) +++ sources/device/DeviceView.h (.../DeviceView.h) (revision 9ebd78edd3127e38ee92b2e870430f12731244bc) @@ -59,5 +59,13 @@ PROPERTY ( bool , decommissionEnabled , true ) VIEW_DEC_CLASS(VDevice) + +private: + bool isCompleteResponse(Model::MDeviceResponseBase::Data vData) { + // Either the script exited successfully or the script failed and the reason is provided + // There are situaltoins that the script is using the attribute response to update the UI + // but it is not the final/completed response + return vData.mAccepted || (!vData.mAccepted && vData.mReason != 0 ); + } }; }