Group methods are now updated when devices are added/removed, when a group has been edited. Note: Group methods will not be updated if a child device has its type changed or if a child group has its methods changed.

This commit is contained in:
Stefan Persson 2011-03-02 08:42:40 +00:00
parent 8aeebf4de5
commit a69f11df8f
4 changed files with 6 additions and 3 deletions

View file

@ -27,7 +27,7 @@ QScriptValue ScriptFunctionWrapper::call() {
} }
QScriptValue ScriptFunctionWrapper::callWith(const QScriptValue &val) { QScriptValue ScriptFunctionWrapper::callWith(const QScriptValue &val) {
qDebug() << "Call called" << d->name; //qDebug() << "Call called" << d->name;
QScriptEngine *eng = val.engine(); QScriptEngine *eng = val.engine();
if (!eng) { if (!eng) {
qDebug() << "We cannot access the script-engine, fail!"; qDebug() << "We cannot access the script-engine, fail!";

View file

@ -22,7 +22,7 @@ __postInit__ = function() {
} }
function deviceChangeEvent( deviceId, eventType ) { function deviceChangeEvent( deviceId, eventType ) {
print("DeviceChangeEvent", deviceId, eventType); //print("DeviceChangeEvent", deviceId, eventType);
if (eventType == com.telldus.core.TELLSTICK_DEVICE_ADDED) { if (eventType == com.telldus.core.TELLSTICK_DEVICE_ADDED) {
devices.push(new Device(com.telldus.core.getDeviceId(i))); devices.push(new Device(com.telldus.core.getDeviceId(i)));
return; return;

View file

@ -81,6 +81,9 @@ QString &Device::name() const {
} }
void Device::setParameter( const QString &name, const QString &value ) { void Device::setParameter( const QString &name, const QString &value ) {
if(name == "devices"){
d->protocolChanged = true;
}
d->settings[name] = value; d->settings[name] = value;
} }

View file

@ -96,7 +96,7 @@ MethodWidget::MethodWidget( Device *device, QWidget *parent )
connect(d->execute, SIGNAL(clicked()), device, SLOT(execute())); connect(d->execute, SIGNAL(clicked()), device, SLOT(execute()));
connect(d->up, SIGNAL(clicked()), device, SLOT(up())); connect(d->up, SIGNAL(clicked()), device, SLOT(up()));
connect(d->down, SIGNAL(clicked()), device, SLOT(down())); connect(d->down, SIGNAL(clicked()), device, SLOT(down()));
connect(d->stop, SIGNAL(clicked()), device, SLOT(stop())); //TODO connect(d->stop, SIGNAL(clicked()), device, SLOT(stop()));
updateMethods(device->methods()); updateMethods(device->methods());