Update singal connection handlers to the new syntax

This commit is contained in:
Simon Stürz 2026-03-03 15:50:59 +01:00
parent f58e16639b
commit 0f4f5f1805
78 changed files with 158 additions and 156 deletions

View File

@ -26,8 +26,8 @@
#define NYMEAJSONRPCCLIENT_H
#include <QObject>
#include <QVariantMap>
#include <QPointer>
#include <QVariantMap>
#include <QVersionNumber>
#include "connection/nymeaconnection.h"
@ -43,8 +43,8 @@ class JsonRpcClient : public QObject
Q_PROPERTY(NymeaConnection::BearerTypes availableBearerTypes READ availableBearerTypes NOTIFY availableBearerTypesChanged)
Q_PROPERTY(NymeaConnection::ConnectionStatus connectionStatus READ connectionStatus NOTIFY connectionStatusChanged)
Q_PROPERTY(bool connected READ connected NOTIFY connectedChanged)
Q_PROPERTY(NymeaHost* currentHost READ currentHost NOTIFY currentHostChanged)
Q_PROPERTY(Connection* currentConnection READ currentConnection NOTIFY currentConnectionChanged)
Q_PROPERTY(NymeaHost *currentHost READ currentHost NOTIFY currentHostChanged)
Q_PROPERTY(Connection *currentConnection READ currentConnection NOTIFY currentConnectionChanged)
Q_PROPERTY(bool initialSetupRequired READ initialSetupRequired NOTIFY initialSetupRequiredChanged)
Q_PROPERTY(bool authenticationRequired READ authenticationRequired NOTIFY authenticationRequiredChanged)
Q_PROPERTY(bool pushButtonAuthAvailable READ pushButtonAuthAvailable NOTIFY pushButtonAuthAvailableChanged)
@ -104,7 +104,6 @@ public:
Q_INVOKABLE int authenticate(const QString &username, const QString &password, const QString &deviceName);
Q_INVOKABLE int requestPushButtonAuth(const QString &deviceName);
signals:
void availableBearerTypesChanged();
void connectionStatusChanged();
@ -181,15 +180,14 @@ private:
bool loadPem(const QUuid &serverUud, QByteArray &pem);
bool storePem(const QUuid &serverUuid, const QByteArray &pem);
};
class JsonRpcReply : public QObject
{
Q_OBJECT
public:
explicit JsonRpcReply(int commandId, QString nameSpace, QString method, QVariantMap params = QVariantMap(), QPointer<QObject> caller = QPointer<QObject>(), const QString &callback = QString());
explicit JsonRpcReply(
int commandId, QString nameSpace, QString method, QVariantMap params = QVariantMap(), QPointer<QObject> caller = QPointer<QObject>(), const QString &callback = QString());
~JsonRpcReply();
int commandId() const;
@ -211,5 +209,4 @@ private:
QString m_callback;
};
#endif // NYMEAJSONRPCCLIENT_H

View File

@ -73,8 +73,8 @@ protected:
signals:
void countChanged();
void thingAdded(Thing *device);
void thingRemoved(Thing *device);
void thingAdded(Thing *thing);
void thingRemoved(Thing *thing);
private:
QList<Thing *> m_things;

View File

@ -100,7 +100,7 @@ Page {
Connections {
target: engine.ruleManager
onAddRuleReply: (commandId, ruleError, ruleId) => {
function onAddRuleReply(commandId, ruleError, ruleId) {
if (ruleError === RuleManager.RuleErrorNoError) {
// print("should tag rule now:", d.editRulePage.rule.id, d.editRulePage.ruleIcon, d.editRulePage.ruleColor)
// engine.tagsManager.tagRule(ruleId, "color", d.editRulePage.ruleColor)
@ -113,7 +113,7 @@ Page {
d.editRulePage.busy = false;
}
onEditRuleReply: (commandId, ruleError) => {
function onEditRuleReply(commandId, ruleError) {
if (ruleError === RuleManager.RuleErrorNoError) {
// print("should tag rule now:", d.editRulePage.ruleIcon, d.editRulePage.ruleColor)
engine.tagsManager.tagRule(d.editRulePage.rule.id, "color", d.editRulePage.ruleColor)
@ -147,7 +147,7 @@ Page {
property var iconTag: model.executable ? engine.tagsManager.tags.findRuleTag(model.id, "icon") : null
Connections {
target: engine.tagsManager.tags
onCountChanged: {
function onCountChanged() {
colorTag = engine.tagsManager.tags.findRuleTag(model.id, "color")
iconTag = engine.tagsManager.tags.findRuleTag(model.id, "icon")
}

View File

@ -127,7 +127,7 @@ Page {
Connections {
target: engine.ruleManager
onAddRuleReply: (commandId, ruleError, ruleId) => {
function onAddRuleReply(commandId, ruleError, ruleId) {
d.editRulePage.busy = false
if (d.editRulePage) {
pageStack.pop();

View File

@ -593,7 +593,7 @@ ApplicationWindow {
}
Connections {
target: Qt.application
onStateChanged: closeTimer.stop()
function onStateChanged(state) { closeTimer.stop(); }
}
FolderListModel {

View File

@ -47,7 +47,7 @@ Page {
Connections {
target: engine.jsonRpcClient
onPushButtonAuthFailed: {
function onPushButtonAuthFailed() {
var popup = errorDialog.createObject(root)
popup.text = qsTr("Sorry, something went wrong during the setup. Try again please.")
popup.open();

View File

@ -309,10 +309,10 @@ Item {
Connections {
target: engine.jsonRpcClient
onCurrentHostChanged: {
init();
}
onVerifyConnectionCertificate: {
function onCurrentHostChanged() { init(); }
function onVerifyConnectionCertificate(serverUuid, issuerInfo, pem) {
print("Asking user to verify certificate:", serverUuid, issuerInfo, pem)
var certDialogComponent = Qt.createComponent(Qt.resolvedUrl("connection/CertificateErrorDialog.qml"));
var popup = certDialogComponent.createObject(root);
@ -322,14 +322,15 @@ Item {
})
popup.open();
}
onConnectedChanged: {
function onConnectedChanged(connected) {
print("json client connected changed", engine.jsonRpcClient.connected, engine.jsonRpcClient.serverUuid)
if (engine.jsonRpcClient.connected) {
nymeaDiscovery.cacheHost(engine.jsonRpcClient.currentHost)
configuredHost.uuid = engine.jsonRpcClient.serverUuid
for (var i = 0; i < configuredHostsModel.count; i++) {
if (i != index && configuredHostsModel.get(i).uuid == engine.jsonRpcClient.serverUuid) {
if (i != index && configuredHostsModel.get(i).uuid === engine.jsonRpcClient.serverUuid) {
configuredHostsModel.removeHost(i);
break;
}
@ -338,28 +339,31 @@ Item {
init();
}
onAuthenticationRequiredChanged: {
function onAuthenticationRequiredChanged() {
print("auth required changed")
init();
}
onInitialSetupRequiredChanged: {
function onInitialSetupRequiredChanged() {
print("setup required changed")
init();
}
onInvalidMinimumVersion: {
function onInvalidMinimumVersion(actualVersion, minVersion) {
var popup = invalidVersionComponent.createObject(app.contentItem);
popup.actualVersion = actualVersion;
popup.minVersion = minVersion;
popup.open()
}
onInvalidMaximumVersion: {
function onInvalidMaximumVersion(actualVersion, maxVersion) {
var popup = invalidVersionComponent.createObject(app.contentItem);
popup.actualVersion = actualVersion;
popup.maxVersion = maxVersion;
popup.open()
}
onInvalidServerUuid: {
function onInvalidServerUuid(uuid) {
var connection = engine.jsonRpcClient.currentConnection;
engine.jsonRpcClient.disconnectFromHost();
engine.jsonRpcClient.currentHost.connections.removeConnection(connection);
@ -369,7 +373,7 @@ Item {
Connections {
target: engine.nymeaConfiguration
onFetchingDataChanged: {
function onFetchingDataChanged() {
print("fetching NymeaConfigration:", engine.nymeaConfiguration.fetchingData)
if (!engine.nymeaConfiguration.fetchingData) {
syncRemoteConnection()
@ -378,7 +382,7 @@ Item {
}
Connections {
target: engine.nymeaConfiguration.tunnelProxyServerConfigurations
onCountChanged: {
function onCountChanged() {
print("tunnel proxy count changed:", engine.nymeaConfiguration.tunnelProxyServerConfigurations.count)
if (!engine.nymeaConfiguration.fetchingData) {
syncRemoteConnection();
@ -394,7 +398,9 @@ Item {
return;
}
for (var i = 0; i < engine.jsonRpcClient.currentHost.connections.count; i++) {
var i = 0;
for (i = 0; i < engine.jsonRpcClient.currentHost.connections.count; i++) {
var connection = engine.jsonRpcClient.currentHost.connections.get(i)
if (connection.url.toString().startsWith("tunnel")) {
console.log("Removing tunnel proxy connection:", connection.url)
@ -402,7 +408,7 @@ Item {
}
}
for (var i = 0; i < engine.nymeaConfiguration.tunnelProxyServerConfigurations.count; i++) {
for (i = 0; i < engine.nymeaConfiguration.tunnelProxyServerConfigurations.count; i++) {
var tunnelProxyConfig = engine.nymeaConfiguration.tunnelProxyServerConfigurations.get(i);
console.debug("tunnelProxyConfig:", JSON.stringify(tunnelProxyConfig))
var url = tunnelProxyConfig.sslEnabled ? "tunnels://" : "tunnel://";
@ -418,7 +424,7 @@ Item {
Connections {
target: Qt.application
enabled: engine.jsonRpcClient.connected && settings.returnToHome
onStateChanged: {
function onStateChanged(state) {
print("App active state changed:", state)
if (state !== Qt.ApplicationActive) {
init();
@ -428,7 +434,7 @@ Item {
Connections {
target: engine.thingManager
onFetchingDataChanged: {
function onFetchingDataChanged() {
if (!engine.thingManager.fetchingData) {
processPendingPushNotificationActions();
updatePushNotificationThings()
@ -439,10 +445,11 @@ Item {
Connections {
target: PlatformHelper
onPendingNotificationActionsChanged: {
function onPendingNotificationActionsChanged() {
processPendingPushNotificationActions()
}
}
function processPendingPushNotificationActions() {
print("pending notification actions changed:", PlatformHelper.pendingNotificationActions)
if (PlatformHelper.pendingNotificationActions.length > 0) {
@ -475,7 +482,6 @@ Item {
engine.thingManager.things.getThing(thingId).executeAction(action, actionParams);
}
PlatformHelper.notificationActionHandled(notificationAction.id)
}
}

View File

@ -40,13 +40,13 @@ SettingsPageBase {
Connections {
target: AWSClient
onLoginResult: {
function onLoginResult(error) {
root.busy = false;
if (error === AWSClient.LoginErrorNoError) {
AWSClient.fetchDevices();
}
}
onDeleteAccountResult: {
function onDeleteAccountResult(error) {
root.busy = false;
if (error !== AWSClient.LoginErrorNoError) {
var errorDialog = Qt.createComponent(Qt.resolvedUrl("../components/ErrorDialog.qml"));
@ -199,7 +199,7 @@ SettingsPageBase {
Connections {
target: AWSClient
onLoginResult: {
function onLoginResult(error) {
switch (error) {
case AWSClient.LoginErrorInvalidUserOrPass:
errorLabel.text = qsTr("Failed to log in. Please try again. Do you perhaps have <a href=\"#\">forgotten your password?</a>")
@ -256,7 +256,7 @@ SettingsPageBase {
Connections {
target: AWSClient
onSignupResult: {
function onSignupResult(error) {
signupPage.busy = false;
var text;
switch (error) {
@ -385,7 +385,7 @@ SettingsPageBase {
Connections {
target: AWSClient
onConfirmationResult: {
function onConfirmationResult(error) {
root.busy = false;
var text
switch (error) {
@ -423,7 +423,7 @@ SettingsPageBase {
Connections {
target: AWSClient
onForgotPasswordResult: {
function onForgotPasswordResult(error) {
resetPasswordPage.busy = false
if (error !== AWSClient.LoginErrorNoError) {
var errorDialog = Qt.createComponent(Qt.resolvedUrl("../components/ErrorDialog.qml"));
@ -476,7 +476,7 @@ SettingsPageBase {
Connections {
target: AWSClient
onConfirmForgotPasswordResult: {
function onConfirmForgotPasswordResult(error) {
confirmResetPasswordPage.busy = false
if (error !== AWSClient.LoginErrorNoError) {
var errorDialog = Qt.createComponent(Qt.resolvedUrl("../components/ErrorDialog.qml"));

View File

@ -58,7 +58,7 @@ SettingsPageBase {
Connections {
target: styleController
onCurrentStyleChanged: {
function onCurrentStyleChanged() {
var popup = styleChangedDialog.createObject(root)
popup.open()
}

View File

@ -38,7 +38,7 @@ Item {
Connections {
target: colorState
onValueChanged: {
function onValueChanged() {
if (actionQueue.pendingValue === null) {
actionQueue.useStoredPoint = false
}

View File

@ -37,7 +37,7 @@ Item {
Connections {
target: model
onCountChanged: canvas.requestPaint()
function onCountChanged() { canvas.requestPaint(); }
}
onModelChanged: canvas.requestPaint()

View File

@ -62,7 +62,7 @@ Item {
Connections {
target: engine.thingManager
onExecuteBrowserItemReply: {
function onExecuteBrowserItemReply(commandId, thingError, displayMessage) {
if (commandId == d.pendingItemExecutionId) {
if (thingError === Thing.ThingErrorNoError) {
root.itemLaunched();

View File

@ -73,7 +73,7 @@ Item {
Connections {
target: engine.thingManager
onExecuteActionReply: (commandId, thingError, displayMessage) => {
function onExecuteActionReply(commandId, thingError, displayMessage) {
if (commandId === d.pendingCallId) {
if (thingError !== Thing.ThingErrorNoError) {
var errorDialog = Qt.createComponent(Qt.resolvedUrl("../components/ErrorDialog.qml"));

View File

@ -145,7 +145,7 @@ Item {
onProgressChanged: requestPaint()
Connections {
target: buttonDelegate
onPressedChanged: {
function onPressedChanged() {
if (!buttonDelegate.pressed) {
canvas.progress = 0;
canvas.requestPaint()

View File

@ -48,7 +48,7 @@ ChartView {
Connections {
target: meters
onCountChanged: root.refresh()
function onCountChanged() { root.refresh(); }
}
Component.onCompleted: {

View File

@ -68,7 +68,7 @@ Item {
Connections {
target: root.progressState
onValueChanged: {
function onValueChanged() {
canvas.requestPaint()
}
}

View File

@ -106,7 +106,7 @@ InfoPaneBase {
}
Connections {
target: engine.thingManager
onExecuteActionReply: (commandId, thingError, displayMessage) => {
function onExecuteActionReply(commandId, thingError, displayMessage) {
if (commandId === childLockIcon.pendingAction) {
childLockIcon.pendingAction = -1
}

View File

@ -775,7 +775,7 @@ WizardPageBase {
Connections {
target: nymeaDiscovery.nymeaHosts
onCountChanged: updateNextButton();
function onCountChanged() { updateNextButton(); }
}
function updateNextButton() {

View File

@ -41,16 +41,16 @@ SettingsPageBase {
Connections {
target: engine.jsonRpcClient
onAuthenticationFailed: {
function onAuthenticationFailed() {
var popup = errorDialog.createObject(root)
popup.text = qsTr("Sorry, that wasn't right. Try again please.")
popup.open();
}
onCreateUserSucceeded: {
function onCreateUserSucceeded() {
engine.jsonRpcClient.authenticate(usernameTextField.text, passwordTextField.password, "nymea-app (" + PlatformHelper.deviceModel + ")");
}
onCreateUserFailed: {
function onCreateUserFailed(error) {
print("createUser failed")
var message;
switch (error) {

View File

@ -205,7 +205,7 @@ Item {
Connections {
target: selectionTabs
onTabSelected: {
function onTabSelected(index) {
logsModel.clear()
logsModel.fetchLogs()
}

View File

@ -46,11 +46,11 @@ Item {
Connections {
target: targetTemperatureState
onValueChanged: canvas.requestPaint()
function onValueChanged() { canvas.requestPaint(); }
}
Connections {
target: temperatureState
onValueChanged: canvas.requestPaint()
function onValueChanged() { canvas.requestPaint(); }
}
ActionQueue {
id: actionQueue

View File

@ -39,7 +39,7 @@ BigThingTile {
Connections {
target: itemDelegate
onThingChanged: stateModel.update()
function onThingChanged() { stateModel.update(); }
}
ListModel {

View File

@ -35,12 +35,12 @@ NymeaSwipeDelegate {
iconName: thing && thing.thingClass ? app.interfacesToIcon(thing.thingClass.interfaces) : ""
text: thing ? thing.name : ""
progressive: true
secondaryIconName: thing.setupStatus == Thing.ThingSetupStatusComplete && batteryCritical ? "qrc:/icons/battery/battery-010.svg" : ""
secondaryIconName: thing.setupStatus === Thing.ThingSetupStatusComplete && batteryCritical ? "qrc:/icons/battery/battery-010.svg" : ""
tertiaryIconName: {
if (thing.setupStatus == Thing.ThingSetupStatusFailed) {
if (thing.setupStatus === Thing.ThingSetupStatusFailed) {
return "qrc:/icons/dialog-warning-symbolic.svg";
}
if (thing.setupStatus == Thing.ThingSetupStatusInProgress) {
if (thing.setupStatus === Thing.ThingSetupStatusInProgress) {
return "qrc:/icons/settings.svg"
}
if (connectedState && connectedState.value === false) {
@ -53,10 +53,10 @@ NymeaSwipeDelegate {
}
tertiaryIconColor: {
if (thing.setupStatus == Thing.ThingSetupStatusFailed) {
if (thing.setupStatus === Thing.ThingSetupStatusFailed) {
return Style.red
}
if (thing.setupStatus == Thing.ThingSetupStatusInProgress) {
if (thing.setupStatus === Thing.ThingSetupStatusInProgress) {
return Style.iconColor
}
if (connectedState && connectedState.value === false) {

View File

@ -46,7 +46,7 @@ ThingPageBase {
Connections {
target: logsModelNg
onCountChanged: {
function onCountChanged() {
codeLabel.text = logsModelNg.get(0).value
timestampLabel.text = Qt.formatDateTime(logsModelNg.get(0).timestamp)
}

View File

@ -125,7 +125,7 @@ ThingPageBase {
Connections {
target: root.robotState
onValueChanged: robot.evaluateState()
function onValueChanged() { robot.evaluateState(); }
}
function travel(toHome) {
@ -341,7 +341,7 @@ ThingPageBase {
property BrowserItems boundaries: engine.thingManager.browseThing(root.thing.id, map.id)
Connections {
target: boundaries
onCountChanged: {
function onCountChanged() {
canvas.requestPaint();
}
}

View File

@ -62,8 +62,8 @@ Page {
Connections {
target: engine.thingManager
onExecuteBrowserItemReply: actionExecuted(commandId, thingError, displayMessage)
onExecuteBrowserItemActionReply: actionExecuted(commandId, thingError, displayMessage)
function onExecuteBrowserItemReply(commandId, thingError, displayMessage) { actionExecuted(commandId, thingError, displayMessage); }
function onExecuteBrowserItemActionReply(commandId, thingError, displayMessage) { actionExecuted(commandId, thingError, displayMessage); }
}
function actionExecuted(commandId, thingError, displayMessage) {
if (commandId === d.pendingBrowserItemId) {

View File

@ -264,7 +264,7 @@ Page {
}
Connections {
target: root.thing
onEventTriggered: {
function onEventTriggered(eventTypeId, params) {
if (eventTypeId === eventComponentItem.eventType.id) {
flashlightAnimation.start();
}

View File

@ -67,7 +67,7 @@ ThingPageBase {
Connections {
target: root.thing
onEventTriggered: {
function onEventTriggered(eventTypeId, params) {
print("evenEmitted", params)
if (eventTypeId == root.doorbellPressedType.id) {
ringAnimation.start();

View File

@ -184,7 +184,7 @@ ThingPageBase {
Connections {
target: engine.thingManager
onExecuteActionReply: (commandId, thingError, displayMessage) => {
function onExecuteActionReply(commandId, thingError, displayMessage) {
addUserPage.error = thingError !== Thing.ThingErrorNoError
var masks =[]
masks.push({x: 0, y: 0, width: 1, height: 1});

View File

@ -121,7 +121,7 @@ ThingPageBase {
}
Connections {
target: flickable
onContentYChanged: if (swipe.completed) swipe.close()
function onContentYChanged() { if (swipe.completed) swipe.close(); }
}
onPressAndHold: swipe.open(SwipeDelegate.Right)
@ -352,14 +352,14 @@ ThingPageBase {
Connections {
target: stateDelegateLoader.item && stateDelegateLoader.item.hasOwnProperty("changed") ? stateDelegateLoader.item : null
onChanged: {
function onChanged(value) {
print("Value changed:", value)
stateDelegate.enqueueSetValue(value)
}
}
Connections {
target: engine.thingManager
onExecuteActionReply: (commandId, thingError, displayMessage) => {
function onExecuteActionReply(commandId, thingError, displayMessage) {
if (stateDelegate.pendingActionId === commandId) {
stateDelegate.pendingActionId = -1
if (stateDelegate.valueCacheDirty) {
@ -384,7 +384,7 @@ ThingPageBase {
Connections {
target: engine.thingManager
onExecuteActionReply: (commandId, thingError, displayMessage) => {
function onExecuteActionReply(commandId, thingError, displayMessage) {
if (commandId === actionDelegate.pendingActionId) {
pendingTimer.start();
actionDelegate.lastSuccess = thingError === Thing.ThingErrorNoError
@ -514,7 +514,7 @@ ThingPageBase {
}
Connections {
target: root.thing
onEventTriggered: {
function onEventTriggered(eventTypeId, params) {
if (eventTypeId === eventComponentItem.eventType.id) {
flashlightAnimation.start();
}

View File

@ -103,7 +103,7 @@ ThingPageBase {
Connections {
target: engine.ruleManager
onAddRuleReply: {
function onAddRuleReply(commandId, ruleError, ruleId) {
if (commandId == d.pendingRuleCreationId) {
d.pendingRuleCreationId = -1
if (ruleError != RuleManager.RuleErrorNoError) {
@ -125,7 +125,7 @@ ThingPageBase {
Connections {
target: root.powerState
onValueChanged: cleanupRules()
function onValueChanged() { cleanupRules(); }
}
LogsModelNg {

View File

@ -40,7 +40,7 @@ ThingPageBase {
Connections {
target: engine.thingManager
onExecuteActionReply: (commandId, thingError, displayMessage) => {
function onExecuteActionReply(commandId, thingError, displayMessage) {
if (commandId === d.pendingAction) {
d.pendingAction = -1
}

View File

@ -73,8 +73,8 @@ Page {
Connections {
target: engine.thingManager.things
onThingRemoved:{
if (thing == root.thing) {
function onThingRemoved(thing) {
if (thing === root.thing) {
print("Thing destroyed")
pageStack.pop()
}

View File

@ -113,7 +113,7 @@ Item {
Connections {
target: engine.thingManager
onExecuteActionReply: (commandId, thingError, displayMessage) => {
function onExecuteActionReply(commandId, thingError, displayMessage) {
print("executeActionReply:", commandId)
if (commandId === d.pendingCallId) {
d.pendingCallId = -1;

View File

@ -143,14 +143,14 @@ Page {
Connections {
target: engine.scriptManager
onAddScriptReply: {
function onAddScriptReply(id, status, scriptId, errors) {
print("Add reply", status)
deployReply(id, status, errors)
if (status == ScriptManager.ScriptErrorNoError) {
d.scriptId = scriptId;
}
}
onEditScriptReply: {
function onEditScriptReply(id, status, errors) {
print("Edit reply", status)
deployReply(id, status, errors)
}
@ -168,7 +168,7 @@ Page {
}
}
onFetchScriptReply: (id, status, content) => {
function onFetchScriptReply(id, status, content) {
if (id === d.callId && status === ScriptManager.ScriptErrorNoError) {
d.callId = -1;
d.oldContent = content;
@ -183,13 +183,13 @@ Page {
autoSaver.active = true;
}
}
onRenameScriptReply: {
function onRenameScriptReply(id, status) {
if (id == d.callId) {
d.callId = -1;
}
}
onScriptMessage: {
function onScriptMessage(scriptId, type, message) {
print("scriptMessage:", scriptId, d.scriptId)
if (scriptId !== d.scriptId) {
return;

View File

@ -49,7 +49,7 @@ Page {
Connections {
target: engine.scriptManager
onRemoveScriptReply: {
function onRemoveScriptReply(id, status) {
if (id == d.pendingAction) {
d.pendingAction = -1;
}

View File

@ -99,7 +99,7 @@ Page {
Connections {
target: engine.ruleManager
onAddRuleReply: {
function onAddRuleReply(commandId, ruleError, ruleId) {
if (ruleError == RuleManager.RuleErrorNoError) {
pageStack.pop(root);
} else {
@ -110,7 +110,7 @@ Page {
d.editRulePage.busy = false;
}
onEditRuleReply: {
function onEditRuleReply(commandId, ruleError) {
if (ruleError == RuleManager.RuleErrorNoError) {
pageStack.pop(root);
} else {

View File

@ -48,7 +48,7 @@ Rectangle {
Connections {
target: root.model
onCountChanged: {
function onCountChanged() {
d.hidden = false;
d.currentIndex = 0;
if (root.model.count == 0) {

View File

@ -83,7 +83,7 @@ Item {
}
Connections {
target: contentContainer.data[index]
onRaise: {
function onRaise() {
panelTabs.currentIndex = index
d.autoWouldShow = true;
}

View File

@ -112,7 +112,7 @@ MainViewBase {
Connections {
target: acManager
onAddZoneReply: {
function onAddZoneReply(commandId, error, zoneId) {
if (commandId == noZonePlaceHolder.pendingAddCall) {
print("zone added", zoneId)
var zone = acManager.zoneInfos.getZoneInfo(zoneId)

View File

@ -43,7 +43,7 @@ Item {
}
Connections {
target: currentPowerState
onValueChanged: {
function onValueChanged() {
if (currentPowerState.value >= 0) {
consumerSlice.value = currentPowerState.value
producerSlice.value = 0

View File

@ -207,7 +207,7 @@ MainViewBase {
property int pendingCommand: -1
Connections {
target: engine.tagsManager
onAddTagReply: {
function onAddTagReply(commandId, error) {
if (commandId == dropArea.pendingCommand) {
dropArea.pendingCommand = -1
}

View File

@ -67,7 +67,7 @@ MainViewBase {
Connections {
target: engine.tagsManager.tags
onCountChanged: {
function onCountChanged() {
colorTag = engine.tagsManager.tags.findRuleTag(model.id, "color")
iconTag = engine.tagsManager.tags.findRuleTag(model.id, "icon")
}

View File

@ -58,7 +58,7 @@ SettingsPageBase {
Connections {
target: acManager
onAddZoneReply: {
function onAddZoneReply(commandId, error, zoneId) {
if (commandId == pendingAddCall) {
print("zone added", zoneId)
var zone = acManager.zoneInfos.getZoneInfo(zoneId)

View File

@ -48,13 +48,13 @@ SettingsPageBase {
Connections {
target: acManager
onSetZoneNameReply: {
function onSetZoneNameReply(commandId, error) {
if (commandId == d.pendingCommandId) {
d.pendingCommandId = -1
}
}
onRemoveZoneReply: {
function onRemoveZoneReply(commandId, error) {
if (commandId == d.pendingCommandId) {
d.pendingCommandId = -1
pageStack.pop()

View File

@ -51,7 +51,7 @@ SettingsPageBase {
Connections {
target: acManager
onSetZoneNameReply: {
function onSetZoneNameReply(commandId, error) {
if (commandId == d.pendingCommandId) {
d.pendingCommandId = -1
}
@ -276,7 +276,7 @@ SettingsPageBase {
Connections {
target: acManager
onSetZoneThingsReply: {
function onSetZoneThingsReply(commandId, error) {
if (commandId == d.pendingCommandId) {
d.pendingCommandId = -1
}

View File

@ -144,7 +144,7 @@ MainViewBase {
}
Connections {
target: loader.item
onOpenDialog: {
function onOpenDialog(dialogComponent) {
dialogComponent.createObject(root).open()
}
}

View File

@ -375,7 +375,7 @@ NymeaDialog {
Connections {
target: okButton
onClicked: {
function onClicked() {
root.dashboardModel.addFolderItem(folderNameTextField.text, iconsGrid.currentIcon, root.index)
root.close();
}
@ -558,7 +558,7 @@ NymeaDialog {
Connections {
target: okButton
onClicked: {
function onClicked() {
root.dashboardModel.addWebViewItem(urlTextField.text, columnsTabs.currentValue, rowsTabs.currentValue, interactiveSwitch.checked, root.index)
root.close();
}

View File

@ -54,7 +54,7 @@ DashboardDelegateBase {
Connections {
target: engine.tagsManager.tags
onCountChanged: {
function onCountChanged() {
colorTag = engine.tagsManager.tags.findRuleTag(root.item.ruleId, "color")
iconTag = engine.tagsManager.tags.findRuleTag(root.item.ruleId, "icon")
}

View File

@ -121,7 +121,7 @@ StatsBase {
Connections {
target: d
onStartOffsetChanged: refresh()
function onStartOffsetChanged() { refresh(); }
}
function refreshLabels() {

View File

@ -137,7 +137,7 @@ Item {
Connections {
target: engine.tagsManager
onBusyChanged: d.update()
function onBusyChanged() { d.update(); }
}
Component {

View File

@ -46,7 +46,7 @@ Item {
Connections {
target: engine.thingManager
onFetchingDataChanged: {
function onFetchingDataChanged() {
if (!engine.thingManager.fetchingData) {
updateConsumers()
}
@ -55,7 +55,7 @@ Item {
Connections {
target: root.consumers
onCountChanged: {
function onCountChanged() {
if (!engine.thingManager.fetchingData) {
updateConsumers()
}
@ -64,7 +64,7 @@ Item {
Connections {
target: energyManager
onPowerBalanceChanged: {
function onPowerBalanceChanged() {
var consumersSummation = 0
for (var i = 0; i < consumers.count; i++) {
consumersSummation += consumers.get(i).stateByName("currentPower").value

View File

@ -105,7 +105,7 @@ Item {
Connections {
target: powerBalanceLogs
onEntriesAddedIdx: (index, count) => {
function onEntriesAddedIdx(index, count) {
// print("entries added", index, count)
selfProductionConsumptionSeries.upperSeries = null
selfProductionConsumptionSeries.lowerSeries = null
@ -147,7 +147,7 @@ Item {
acquisitionSeries.lowerSeries = fromStorageUpperSeries
}
onEntriesRemoved: (index, count) => {
function onEntriesRemoved(index, count) {
// Note QtCharts crash when calling removePoints() for points that don't exist.
// Additionally it may decide to ignore values we add, e.g. if we try to add an Inf or undefined value for whatever reason
// So, even though in theory the series should always 1:1 reflect the model, it may not do so in practice and we'll have to make sure not crash here

View File

@ -185,7 +185,7 @@ StatsBase {
Connections {
target: energyManager
onPowerBalanceChanged: {
function onPowerBalanceChanged() {
// print("updating because of power balance change. fetchingData", powerBalanceLogs.fetchingData, "fetchPending", d.fetchPending)
d.refresh();
}

View File

@ -92,7 +92,7 @@ Item {
Connections {
target: powerBalanceLogs
onEntriesAdded: {
function onEntriesAdded(index, entries) {
// print("entries added", index, entries.length)
for (var i = 0; i < entries.length; i++) {
var entry = entries[i]
@ -110,7 +110,7 @@ Item {
}
}
onEntriesRemoved: (index, count) => {
function onEntriesRemoved(index, count) {
acquisitionUpperSeries.removePoints(index, count)
storageUpperSeries.removePoints(index, count)
selfProductionUpperSeries.removePoints(index, count)

View File

@ -93,7 +93,7 @@ Item {
Connections {
target: powerBalanceLogs
onEntriesAdded: {
function onEntriesAdded(index, entries) {
// print("entries added", index, entries.length)
for (var i = 0; i < entries.length; i++) {
var entry = entries[i]
@ -111,7 +111,7 @@ Item {
}
}
onEntriesRemoved: (index, count) => {
function onEntriesRemoved(index, count) {
acquisitionUpperSeries.removePoints(index, count)
storageUpperSeries.removePoints(index, count)
selfConsumptionUpperSeries.removePoints(index, count)

View File

@ -38,7 +38,7 @@ SettingsPageBase {
Connections {
target: engine.jsonRpcClient
onCloudConnectionStateChanged: {
function onCloudConnectionStateChanged() {
print("cloud connection state changed", engine.jsonRpcClient.cloudConnectionState)
if (engine.jsonRpcClient.cloudConnectionState === JsonRpcClient.CloudConnectionStateConnected) {
d.deploymentStarted = false;

View File

@ -182,7 +182,7 @@ SettingsPageBase {
Connections {
target: evDashManager
onAddUserReply: (commandId, error) => {
function onAddUserReply(commandId, error) {
if (error === EvDashManager.EvDashErrorNoError)
return
@ -203,7 +203,7 @@ SettingsPageBase {
popup.open()
}
onRemoveUserReply: (commandId, error) => {
function onRemoveUserReply(commandId, error) {
if (error === EvDashManager.EvDashErrorNoError)
return

View File

@ -42,9 +42,9 @@ SettingsPageBase {
Connections {
target: engine.systemController
onRestartReply: handleReply(id, success)
onRebootReply: handleReply(id, success)
onShutdownReply: handleReply(id, success)
function onRestartReply(id, success) { handleReply(id, success); }
function onRebootReply(id, success) { handleReply(id, success); }
function onShutdownReply(id, success) { handleReply(id, success); }
function handleReply(id, success) {
if (id === d.pendingCommand) {

View File

@ -95,7 +95,7 @@ SettingsPageBase {
Connections {
target: root.modbusRtuManager
onAddModbusRtuMasterReply: {
function onAddModbusRtuMasterReply(commandId, error, modbusUuid) {
if (commandId === d.pendingCommandId) {
d.pendingCommandId = -1
if (modbusRtuManager.handleModbusError(error)) {

View File

@ -102,7 +102,7 @@ SettingsPageBase {
Connections {
target: root.modbusRtuManager
onReconfigureModbusRtuMasterReply: {
function onReconfigureModbusRtuMasterReply(commandId, error) {
if (commandId === d.pendingCommandId) {
d.pendingCommandId = -1
if (modbusRtuManager.handleModbusError(error)) {

View File

@ -274,7 +274,7 @@ SettingsPageBase {
Connections {
target: root.modbusRtuManager
onRemoveModbusRtuMasterReply: {
function onRemoveModbusRtuMasterReply(commandId, error) {
if (commandId === d.pendingCommandId) {
d.pendingCommandId = -1
if (modbusRtuManager.handleModbusError(error)) {

View File

@ -50,7 +50,7 @@ SettingsPageBase {
Connections {
target: engine.thingManager
onSavePluginConfigReply: {
function onSavePluginConfigReply(commandId, thingError) {
if (thingError === Thing.ThingErrorNoError) {
pageStack.pop();
} else {

View File

@ -49,7 +49,7 @@ Page {
Connections {
target: engine.systemController
onEnableRepositoryFinished: (id, success) => {
function onEnableRepositoryFinished(id, success) {
if (!success) {
var popup = errorDialogComponent.createObject(app, {errorCode: qsTr("Failure adding repository.") })
popup.open();

View File

@ -174,7 +174,7 @@ SettingsPageBase {
Connections {
target: userManager
onSetUserInfoReply: (id, error) => {
function onSetUserInfoReply(id, error) {
editUserInfoPage.busy = false
if (error !== UserManager.UserErrorNoError) {
var component = Qt.createComponent("../components/ErrorDialog.qml")
@ -513,7 +513,7 @@ SettingsPageBase {
Connections {
target: userManager
onRemoveUserReply: (id, error) => {
function onRemoveUserReply(id, error) {
userDetailsPage.busy = false
if (error !== UserManager.UserErrorNoError) {
var component = Qt.createComponent("../components/ErrorDialog.qml")
@ -646,7 +646,7 @@ SettingsPageBase {
}
Connections {
target: userManager
onCreateUserReply: (id, error) => {
function onCreateUserReply(id, error) {
createUserPage.busy = false
if (error !== UserManager.UserErrorNoError) {
var component = Qt.createComponent("../components/ErrorDialog.qml")

View File

@ -146,7 +146,7 @@ SettingsPageBase {
Connections {
target: root.zigbeeManager
onAddNetworkReply: {
function onAddNetworkReply(commandId, error, networkUuid) {
if (commandId == d.pendingCommandId) {
d.pendingCommandId = -1
var props = {};

View File

@ -75,7 +75,7 @@ SettingsPageBase {
Connections {
target: root.zigbeeManager
onRemoveNodeReply: {
function onRemoveNodeReply(commandId, error) {
if (commandId == d.pendingCommandId) {
d.pendingCommandId = -1
var props = {};
@ -331,7 +331,7 @@ SettingsPageBase {
Connections {
target: node
onLastSeenChanged: communicationIndicatorLedTimer.start()
function onLastSeenChanged(lastSeen) { communicationIndicatorLedTimer.start(); }
}
Timer {

View File

@ -39,7 +39,7 @@ SettingsPageBase {
Connections {
target: zigbeeManager
onFactoryResetNetworkReply: {
function onFactoryResetNetworkReply(commandId, error) {
busy = false;
// if (error != ZigbeeManager.ZigbeeErrorNoError) {
// }

View File

@ -72,7 +72,7 @@ Page {
Connections {
target: root.network.nodes
onNodeAdded: {
function onNodeAdded(node) {
root.reload()
node.neighborsChanged.connect(root.reloadDelayed);
}

View File

@ -77,7 +77,7 @@ SettingsPageBase {
Connections {
target: root.zigbeeManager
onCreateBindingReply: {
function onCreateBindingReply(commandId, error) {
print("**** create binding reply", error)
if (commandId == d.pendingCommandId) {
d.pendingCommandId = -1
@ -99,7 +99,7 @@ SettingsPageBase {
popup.open();
}
}
onRemoveBindingReply: {
function onRemoveBindingReply(commandId, error) {
if (commandId == d.pendingCommandId) {
d.pendingCommandId = -1
@ -122,7 +122,7 @@ SettingsPageBase {
}
}
onRemoveNodeReply: {
function onRemoveNodeReply(commandId, error) {
if (commandId == d.pendingCommandId) {
var props = {};
switch (error) {

View File

@ -45,7 +45,7 @@ SettingsPageBase {
Connections {
target: root.zwaveManager
onAddNetworkReply: {
function onAddNetworkReply(commandId, error, networkUuid) {
if (commandId == d.pendingCallId) {
d.pendingCallId = -1
var props = {};

View File

@ -76,19 +76,19 @@ SettingsPageBase {
Connections {
target: root.zwaveManager
onAddNodeReply: {
function onAddNodeReply(commandId, error) {
if (commandId == d.pendingCommandId) {
d.pendingCommandId = -1
processStatusCode(error)
}
}
onRemoveNodeReply: {
function onRemoveNodeReply(commandId, error) {
if (commandId == d.pendingCommandId) {
d.pendingCommandId = -1
processStatusCode(error)
}
}
onRemoveFailedNodeReply: {
function onRemoveFailedNodeReply(commandId, error) {
if (commandId == d.pendingCommandId) {
d.pendingCommandId = -1
processStatusCode(error)
@ -117,7 +117,7 @@ SettingsPageBase {
Connections {
target: root.network
onWaitingForNodeAdditionChanged: {
function onWaitingForNodeAdditionChanged() {
if (root.network.waitingForNodeAddition) {
var props = {
title: qsTr("Include Z-Wave device"),
@ -131,7 +131,7 @@ SettingsPageBase {
}
}
}
onWaitingForNodeRemovalChanged: {
function onWaitingForNodeRemovalChanged() {
if (root.network.waitingForNodeRemoval) {
var props = {
title: qsTr("Exclude Z-Wave device"),

View File

@ -54,7 +54,7 @@ SettingsPageBase {
Connections {
target: root.zwaveManager
onRemoveNetworkReply: {
function onRemoveNetworkReply(commandId, error) {
if (commandId === d.pendingCommandId) {
d.pendingCommandId = -1;
if (!processError(error)) {
@ -63,7 +63,7 @@ SettingsPageBase {
}
}
onFactoryResetNetworkReply: {
function onFactoryResetNetworkReply(commandId, error) {
if (commandId === d.pendingCommandId) {
d.pendingCommandId = -1;
if (!processError(error)) {
@ -71,7 +71,7 @@ SettingsPageBase {
}
}
}
onSoftResetControllerReply: {
function onSoftResetControllerReply(commandId, error) {
if (commandId === d.pendingCommandId) {
d.pendingCommandId = -1;
processError(error)

View File

@ -56,8 +56,8 @@ Page {
Connections {
target: engine.thingManager
onRemoveThingReply: {
if (commandId != d.pendingCommandId) {
function onRemoveThingReply(commandId, thingError, ruleIds) {
if (commandId !== d.pendingCommandId) {
return;
}
@ -121,7 +121,7 @@ Page {
property Thing thing: null
onAccepted: {
d.pendingCommand = engine.thingManager.removeThing(thing.id)
d.pendingCommandId = engine.thingManager.removeThing(thing.id)
}
}
}

View File

@ -175,7 +175,7 @@ Page {
anchors.centerIn: parent
width: parent.width - Style.margins * 2
opacity: packagesFilterModel.count > 0 &&
(thingClassesProxy.count == 0 || listView.contentY >= listView.contentHeight + listView.originY)
(thingClassesProxy.count === 0 || listView.contentY >= listView.contentHeight + listView.originY)
? 1 : 0
Behavior on opacity { NumberAnimation { duration: Style.shortAnimationDuration } }
visible: opacity > 0

View File

@ -97,7 +97,6 @@ Page {
}
busyOverlay.shown = true;
}
}

View File

@ -68,7 +68,7 @@ Item {
Connections {
target: root.thing
onExecuteActionReply: (commandId, thingError, displayMessage) => {
function onExecuteActionReply(commandId, thingError, displayMessage) {
if (d.pendingCommand === commandId) {
// print("command finished")
d.pendingCommand = -1;

View File

@ -1,2 +1,2 @@
1.11.7
713
714