Allow reconfiguring red-only params from the plugin side in autoDevicesAppeared()
This commit is contained in:
parent
7bd863b131
commit
18d684592d
@ -465,7 +465,7 @@ DeviceManager::DeviceError DeviceManager::addConfiguredDevice(const DeviceClassI
|
|||||||
* from a discovery or if the user set them. If it came from discovery not writable parameters (readOnly) will be changed too.
|
* from a discovery or if the user set them. If it came from discovery not writable parameters (readOnly) will be changed too.
|
||||||
*
|
*
|
||||||
* Returns \l{DeviceError} to inform about the result. */
|
* Returns \l{DeviceError} to inform about the result. */
|
||||||
DeviceManager::DeviceError DeviceManager::reconfigureDevice(const DeviceId &deviceId, const ParamList ¶ms, bool fromDiscovery)
|
DeviceManager::DeviceError DeviceManager::reconfigureDevice(const DeviceId &deviceId, const ParamList ¶ms, bool fromDiscoveryOrAuto)
|
||||||
{
|
{
|
||||||
Device *device = findConfiguredDevice(deviceId);
|
Device *device = findConfiguredDevice(deviceId);
|
||||||
if (!device) {
|
if (!device) {
|
||||||
@ -487,7 +487,7 @@ DeviceManager::DeviceError DeviceManager::reconfigureDevice(const DeviceId &devi
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if the params are discovered and not set by the user
|
// if the params are discovered and not set by the user
|
||||||
if (!fromDiscovery) {
|
if (!fromDiscoveryOrAuto) {
|
||||||
// check if one of the given params is not editable
|
// check if one of the given params is not editable
|
||||||
foreach (const ParamType ¶mType, deviceClass.paramTypes()) {
|
foreach (const ParamType ¶mType, deviceClass.paramTypes()) {
|
||||||
foreach (const Param ¶m, params) {
|
foreach (const Param ¶m, params) {
|
||||||
@ -1415,7 +1415,7 @@ void DeviceManager::onAutoDevicesAppeared(const DeviceClassId &deviceClassId, co
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
qCDebug(dcDeviceManager()) << "Start reconfiguring auto device" << device;
|
qCDebug(dcDeviceManager()) << "Start reconfiguring auto device" << device;
|
||||||
reconfigureDevice(deviceDescriptor.deviceId(), deviceDescriptor.params());
|
reconfigureDevice(deviceDescriptor.deviceId(), deviceDescriptor.params(), true);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -115,7 +115,7 @@ public:
|
|||||||
DeviceError addConfiguredDevice(const DeviceClassId &deviceClassId, const QString &name, const ParamList ¶ms, const DeviceId id = DeviceId::createDeviceId());
|
DeviceError addConfiguredDevice(const DeviceClassId &deviceClassId, const QString &name, const ParamList ¶ms, const DeviceId id = DeviceId::createDeviceId());
|
||||||
DeviceError addConfiguredDevice(const DeviceClassId &deviceClassId, const QString &name, const DeviceDescriptorId &deviceDescriptorId, const ParamList ¶ms = ParamList(), const DeviceId &deviceId = DeviceId::createDeviceId());
|
DeviceError addConfiguredDevice(const DeviceClassId &deviceClassId, const QString &name, const DeviceDescriptorId &deviceDescriptorId, const ParamList ¶ms = ParamList(), const DeviceId &deviceId = DeviceId::createDeviceId());
|
||||||
|
|
||||||
DeviceError reconfigureDevice(const DeviceId &deviceId, const ParamList ¶ms, bool fromDiscovery = false);
|
DeviceError reconfigureDevice(const DeviceId &deviceId, const ParamList ¶ms, bool fromDiscoveryOrAuto = false);
|
||||||
DeviceError reconfigureDevice(const DeviceId &deviceId, const DeviceDescriptorId &deviceDescriptorId);
|
DeviceError reconfigureDevice(const DeviceId &deviceId, const DeviceDescriptorId &deviceDescriptorId);
|
||||||
|
|
||||||
DeviceError editDevice(const DeviceId &deviceId, const QString &name);
|
DeviceError editDevice(const DeviceId &deviceId, const QString &name);
|
||||||
|
|||||||
Reference in New Issue
Block a user