mirror of https://github.com/nymea/nymea.git
Merge PR #243: Update device names when changed by the plugin
commit
670bda1e28
|
|
@ -473,8 +473,6 @@ Device::DeviceError DeviceManagerImplementation::editDevice(const DeviceId &devi
|
|||
return Device::DeviceErrorDeviceNotFound;
|
||||
|
||||
device->setName(name);
|
||||
storeConfiguredDevices();
|
||||
emit deviceChanged(device);
|
||||
|
||||
return Device::DeviceErrorNoError;
|
||||
}
|
||||
|
|
@ -1567,6 +1565,16 @@ void DeviceManagerImplementation::slotDeviceSettingChanged(const ParamTypeId &pa
|
|||
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)
|
||||
{
|
||||
// Merge params from discovered descriptor and additional overrides provided on API call. User provided params have higher priority than discovery params.
|
||||
|
|
@ -1648,6 +1656,7 @@ DeviceSetupInfo* DeviceManagerImplementation::setupDevice(Device *device)
|
|||
|
||||
connect(device, &Device::stateValueChanged, this, &DeviceManagerImplementation::slotDeviceStateValueChanged);
|
||||
connect(device, &Device::settingChanged, this, &DeviceManagerImplementation::slotDeviceSettingChanged);
|
||||
connect(device, &Device::nameChanged, this, &DeviceManagerImplementation::slotDeviceNameChanged);
|
||||
|
||||
|
||||
DeviceSetupInfo *info = new DeviceSetupInfo(device, this, 30000);
|
||||
|
|
|
|||
|
|
@ -129,6 +129,7 @@ private slots:
|
|||
// Only connect this to Devices. It will query the sender()
|
||||
void slotDeviceStateValueChanged(const StateTypeId &stateTypeId, const QVariant &value);
|
||||
void slotDeviceSettingChanged(const ParamTypeId ¶mTypeId, const QVariant &value);
|
||||
void slotDeviceNameChanged();
|
||||
|
||||
private:
|
||||
// Builds a list of params ready to create a device.
|
||||
|
|
|
|||
Loading…
Reference in New Issue