Update device names when changed by the plugin
This commit is contained in:
parent
6cdcd47f9b
commit
b3ebbc18c0
@ -463,8 +463,6 @@ Device::DeviceError DeviceManagerImplementation::editDevice(const DeviceId &devi
|
|||||||
return Device::DeviceErrorDeviceNotFound;
|
return Device::DeviceErrorDeviceNotFound;
|
||||||
|
|
||||||
device->setName(name);
|
device->setName(name);
|
||||||
storeConfiguredDevices();
|
|
||||||
emit deviceChanged(device);
|
|
||||||
|
|
||||||
return Device::DeviceErrorNoError;
|
return Device::DeviceErrorNoError;
|
||||||
}
|
}
|
||||||
@ -1522,6 +1520,16 @@ void DeviceManagerImplementation::slotDeviceSettingChanged(const ParamTypeId &pa
|
|||||||
emit deviceSettingChanged(device->id(), paramTypeId, value);
|
emit deviceSettingChanged(device->id(), paramTypeId, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DeviceManagerImplementation::slotDeviceNameChanged()
|
||||||
|
{
|
||||||
|
Device *device = qobject_cast<Device*>(sender());
|
||||||
|
if (!device) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
storeConfiguredDevices();
|
||||||
|
emit deviceChanged(device);
|
||||||
|
}
|
||||||
|
|
||||||
ParamList DeviceManagerImplementation::buildParams(const ParamTypes &types, const ParamList &first, const ParamList &second)
|
ParamList DeviceManagerImplementation::buildParams(const ParamTypes &types, const ParamList &first, const ParamList &second)
|
||||||
{
|
{
|
||||||
// Merge params from discovered descriptor and additional overrides provided on API call. User provided params have higher priority than discovery params.
|
// Merge params from discovered descriptor and additional overrides provided on API call. User provided params have higher priority than discovery params.
|
||||||
@ -1603,6 +1611,7 @@ DeviceSetupInfo* DeviceManagerImplementation::setupDevice(Device *device)
|
|||||||
|
|
||||||
connect(device, &Device::stateValueChanged, this, &DeviceManagerImplementation::slotDeviceStateValueChanged);
|
connect(device, &Device::stateValueChanged, this, &DeviceManagerImplementation::slotDeviceStateValueChanged);
|
||||||
connect(device, &Device::settingChanged, this, &DeviceManagerImplementation::slotDeviceSettingChanged);
|
connect(device, &Device::settingChanged, this, &DeviceManagerImplementation::slotDeviceSettingChanged);
|
||||||
|
connect(device, &Device::nameChanged, this, &DeviceManagerImplementation::slotDeviceNameChanged);
|
||||||
|
|
||||||
|
|
||||||
DeviceSetupInfo *info = new DeviceSetupInfo(device, this, 30000);
|
DeviceSetupInfo *info = new DeviceSetupInfo(device, this, 30000);
|
||||||
|
|||||||
@ -132,6 +132,7 @@ private slots:
|
|||||||
// Only connect this to Devices. It will query the sender()
|
// Only connect this to Devices. It will query the sender()
|
||||||
void slotDeviceStateValueChanged(const StateTypeId &stateTypeId, const QVariant &value);
|
void slotDeviceStateValueChanged(const StateTypeId &stateTypeId, const QVariant &value);
|
||||||
void slotDeviceSettingChanged(const ParamTypeId ¶mTypeId, const QVariant &value);
|
void slotDeviceSettingChanged(const ParamTypeId ¶mTypeId, const QVariant &value);
|
||||||
|
void slotDeviceNameChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Builds a list of params ready to create a device.
|
// Builds a list of params ready to create a device.
|
||||||
|
|||||||
Reference in New Issue
Block a user