From 0f4f5f180513f1a108cf693f997b776cbd7f48b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Tue, 3 Mar 2026 15:50:59 +0100 Subject: [PATCH] Update singal connection handlers to the new syntax --- libnymea-app/jsonrpc/jsonrpcclient.h | 13 +++--- libnymea-app/things.h | 4 +- nymea-app/ui/MagicPage.qml | 6 +-- nymea-app/ui/MainPage.qml | 2 +- nymea-app/ui/Nymea.qml | 2 +- nymea-app/ui/PushButtonAuthPage.qml | 2 +- nymea-app/ui/RootItem.qml | 44 +++++++++++-------- nymea-app/ui/appsettings/CloudLoginPage.qml | 14 +++--- .../appsettings/LookAndFeelSettingsPage.qml | 2 +- nymea-app/ui/components/ColorPicker.qml | 2 +- nymea-app/ui/components/Graph.qml | 2 +- nymea-app/ui/components/MediaBrowser.qml | 2 +- nymea-app/ui/components/MediaPlayer.qml | 2 +- nymea-app/ui/components/ProgressButton.qml | 2 +- nymea-app/ui/components/SmartMeterChart.qml | 2 +- nymea-app/ui/components/StateDial.qml | 2 +- nymea-app/ui/components/ThingInfoPane.qml | 2 +- nymea-app/ui/connection/ConnectionWizard.qml | 2 +- nymea-app/ui/connection/LoginPage.qml | 6 +-- nymea-app/ui/customviews/MultiStateChart.qml | 2 +- .../ui/customviews/ThermostatController.qml | 4 +- nymea-app/ui/delegates/SensorListDelegate.qml | 2 +- nymea-app/ui/delegates/ThingDelegate.qml | 10 ++--- .../devicepages/BarcodeScannerThingPage.qml | 2 +- .../ui/devicepages/CleaningRobotThingPage.qml | 4 +- .../ui/devicepages/DeviceBrowserPage.qml | 4 +- .../ui/devicepages/DeviceDetailsPage.qml | 2 +- .../ui/devicepages/DoorbellDevicePage.qml | 2 +- .../FingerprintReaderDevicePage.qml | 2 +- nymea-app/ui/devicepages/GenericThingPage.qml | 10 ++--- .../ui/devicepages/IrrigationDevicePage.qml | 4 +- .../ui/devicepages/NotificationsThingPage.qml | 2 +- nymea-app/ui/devicepages/ThingPageBase.qml | 4 +- nymea-app/ui/experiences/heating/Main.qml | 2 +- nymea-app/ui/magic/ScriptEditor.qml | 10 ++--- nymea-app/ui/magic/ScriptsPage.qml | 2 +- nymea-app/ui/magic/ThingRulesPage.qml | 4 +- .../ui/magic/scripting/CompletionBox.qml | 2 +- nymea-app/ui/magic/scripting/EditorPane.qml | 2 +- .../ui/mainviews/AirConditioningView.qml | 2 +- .../ui/mainviews/EnergyPieChartDelegate.qml | 2 +- nymea-app/ui/mainviews/FavoritesView.qml | 2 +- nymea-app/ui/mainviews/ScenesView.qml | 2 +- .../airconditioning/ACSettingsPage.qml | 2 +- .../airconditioning/EditZonePage.qml | 4 +- .../airconditioning/EditZoneThingsPage.qml | 4 +- .../ui/mainviews/dashboard/Dashboard.qml | 2 +- .../dashboard/DashboardAddWizard.qml | 4 +- .../dashboard/DashboardSceneDelegate.qml | 2 +- .../ui/mainviews/energy/ConsumerStats.qml | 2 +- .../ui/mainviews/energy/ConsumersHistory.qml | 2 +- .../ui/mainviews/energy/ConsumersPieChart.qml | 6 +-- .../mainviews/energy/PowerBalanceHistory.qml | 4 +- .../ui/mainviews/energy/PowerBalanceStats.qml | 2 +- .../energy/PowerConsumptionBalanceHistory.qml | 4 +- .../energy/PowerProductionBalanceHistory.qml | 4 +- nymea-app/ui/system/CloudSettingsPage.qml | 2 +- nymea-app/ui/system/EvDashSettingsPage.qml | 4 +- nymea-app/ui/system/GeneralSettingsPage.qml | 6 +-- .../ui/system/ModbusRtuAddMasterPage.qml | 2 +- .../system/ModbusRtuReconfigureMasterPage.qml | 2 +- nymea-app/ui/system/ModbusRtuSettingsPage.qml | 2 +- nymea-app/ui/system/PluginParamsPage.qml | 2 +- nymea-app/ui/system/SystemUpdatePage.qml | 2 +- nymea-app/ui/system/UsersSettingsPage.qml | 6 +-- .../ui/system/zigbee/ZigbeeAddNetworkPage.qml | 2 +- .../ui/system/zigbee/ZigbeeNetworkPage.qml | 4 +- .../zigbee/ZigbeeNetworkSettingsPage.qml | 2 +- .../zigbee/ZigbeeNetworkTopologyPage.qml | 2 +- nymea-app/ui/system/zigbee/ZigbeeNodePage.qml | 6 +-- .../ui/system/zwave/ZWaveAddNetworkPage.qml | 2 +- .../ui/system/zwave/ZWaveNetworkPage.qml | 10 ++--- .../system/zwave/ZWaveNetworkSettingsPage.qml | 6 +-- .../ui/thingconfiguration/EditThingsPage.qml | 6 +-- .../ui/thingconfiguration/NewThingPage.qml | 2 +- .../ui/thingconfiguration/SetupWizard.qml | 1 - nymea-app/ui/utils/ActionQueue.qml | 2 +- version.txt | 2 +- 78 files changed, 158 insertions(+), 156 deletions(-) diff --git a/libnymea-app/jsonrpc/jsonrpcclient.h b/libnymea-app/jsonrpc/jsonrpcclient.h index 9cd4cabd..840049b5 100644 --- a/libnymea-app/jsonrpc/jsonrpcclient.h +++ b/libnymea-app/jsonrpc/jsonrpcclient.h @@ -26,8 +26,8 @@ #define NYMEAJSONRPCCLIENT_H #include -#include #include +#include #include #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 caller = QPointer(), const QString &callback = QString()); + explicit JsonRpcReply( + int commandId, QString nameSpace, QString method, QVariantMap params = QVariantMap(), QPointer caller = QPointer(), const QString &callback = QString()); ~JsonRpcReply(); int commandId() const; @@ -211,5 +209,4 @@ private: QString m_callback; }; - #endif // NYMEAJSONRPCCLIENT_H diff --git a/libnymea-app/things.h b/libnymea-app/things.h index 1b9af1eb..abb7e88e 100644 --- a/libnymea-app/things.h +++ b/libnymea-app/things.h @@ -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 m_things; diff --git a/nymea-app/ui/MagicPage.qml b/nymea-app/ui/MagicPage.qml index 642a627f..87cbfe36 100644 --- a/nymea-app/ui/MagicPage.qml +++ b/nymea-app/ui/MagicPage.qml @@ -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") } diff --git a/nymea-app/ui/MainPage.qml b/nymea-app/ui/MainPage.qml index c4b7ad0c..1f4ff0e6 100644 --- a/nymea-app/ui/MainPage.qml +++ b/nymea-app/ui/MainPage.qml @@ -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(); diff --git a/nymea-app/ui/Nymea.qml b/nymea-app/ui/Nymea.qml index e16d27d6..04cfb5aa 100644 --- a/nymea-app/ui/Nymea.qml +++ b/nymea-app/ui/Nymea.qml @@ -593,7 +593,7 @@ ApplicationWindow { } Connections { target: Qt.application - onStateChanged: closeTimer.stop() + function onStateChanged(state) { closeTimer.stop(); } } FolderListModel { diff --git a/nymea-app/ui/PushButtonAuthPage.qml b/nymea-app/ui/PushButtonAuthPage.qml index 01ebd627..08fb74cc 100644 --- a/nymea-app/ui/PushButtonAuthPage.qml +++ b/nymea-app/ui/PushButtonAuthPage.qml @@ -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(); diff --git a/nymea-app/ui/RootItem.qml b/nymea-app/ui/RootItem.qml index 0920bf9d..7474478f 100644 --- a/nymea-app/ui/RootItem.qml +++ b/nymea-app/ui/RootItem.qml @@ -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) } } diff --git a/nymea-app/ui/appsettings/CloudLoginPage.qml b/nymea-app/ui/appsettings/CloudLoginPage.qml index 8b629239..9a533dd1 100644 --- a/nymea-app/ui/appsettings/CloudLoginPage.qml +++ b/nymea-app/ui/appsettings/CloudLoginPage.qml @@ -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 forgotten your password?") @@ -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")); diff --git a/nymea-app/ui/appsettings/LookAndFeelSettingsPage.qml b/nymea-app/ui/appsettings/LookAndFeelSettingsPage.qml index 07688e9d..a702404e 100644 --- a/nymea-app/ui/appsettings/LookAndFeelSettingsPage.qml +++ b/nymea-app/ui/appsettings/LookAndFeelSettingsPage.qml @@ -58,7 +58,7 @@ SettingsPageBase { Connections { target: styleController - onCurrentStyleChanged: { + function onCurrentStyleChanged() { var popup = styleChangedDialog.createObject(root) popup.open() } diff --git a/nymea-app/ui/components/ColorPicker.qml b/nymea-app/ui/components/ColorPicker.qml index b2c221e0..21aefe2e 100644 --- a/nymea-app/ui/components/ColorPicker.qml +++ b/nymea-app/ui/components/ColorPicker.qml @@ -38,7 +38,7 @@ Item { Connections { target: colorState - onValueChanged: { + function onValueChanged() { if (actionQueue.pendingValue === null) { actionQueue.useStoredPoint = false } diff --git a/nymea-app/ui/components/Graph.qml b/nymea-app/ui/components/Graph.qml index dbbb363b..fcc3a377 100644 --- a/nymea-app/ui/components/Graph.qml +++ b/nymea-app/ui/components/Graph.qml @@ -37,7 +37,7 @@ Item { Connections { target: model - onCountChanged: canvas.requestPaint() + function onCountChanged() { canvas.requestPaint(); } } onModelChanged: canvas.requestPaint() diff --git a/nymea-app/ui/components/MediaBrowser.qml b/nymea-app/ui/components/MediaBrowser.qml index e5b651dd..ec42794e 100644 --- a/nymea-app/ui/components/MediaBrowser.qml +++ b/nymea-app/ui/components/MediaBrowser.qml @@ -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(); diff --git a/nymea-app/ui/components/MediaPlayer.qml b/nymea-app/ui/components/MediaPlayer.qml index bf7d7810..e43fa807 100644 --- a/nymea-app/ui/components/MediaPlayer.qml +++ b/nymea-app/ui/components/MediaPlayer.qml @@ -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")); diff --git a/nymea-app/ui/components/ProgressButton.qml b/nymea-app/ui/components/ProgressButton.qml index f6bfeab5..dc25521b 100644 --- a/nymea-app/ui/components/ProgressButton.qml +++ b/nymea-app/ui/components/ProgressButton.qml @@ -145,7 +145,7 @@ Item { onProgressChanged: requestPaint() Connections { target: buttonDelegate - onPressedChanged: { + function onPressedChanged() { if (!buttonDelegate.pressed) { canvas.progress = 0; canvas.requestPaint() diff --git a/nymea-app/ui/components/SmartMeterChart.qml b/nymea-app/ui/components/SmartMeterChart.qml index 26df40e3..bd49a98d 100644 --- a/nymea-app/ui/components/SmartMeterChart.qml +++ b/nymea-app/ui/components/SmartMeterChart.qml @@ -48,7 +48,7 @@ ChartView { Connections { target: meters - onCountChanged: root.refresh() + function onCountChanged() { root.refresh(); } } Component.onCompleted: { diff --git a/nymea-app/ui/components/StateDial.qml b/nymea-app/ui/components/StateDial.qml index 2225ee1e..e9121015 100644 --- a/nymea-app/ui/components/StateDial.qml +++ b/nymea-app/ui/components/StateDial.qml @@ -68,7 +68,7 @@ Item { Connections { target: root.progressState - onValueChanged: { + function onValueChanged() { canvas.requestPaint() } } diff --git a/nymea-app/ui/components/ThingInfoPane.qml b/nymea-app/ui/components/ThingInfoPane.qml index 094a674c..b5c21175 100644 --- a/nymea-app/ui/components/ThingInfoPane.qml +++ b/nymea-app/ui/components/ThingInfoPane.qml @@ -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 } diff --git a/nymea-app/ui/connection/ConnectionWizard.qml b/nymea-app/ui/connection/ConnectionWizard.qml index d6baada5..b869f034 100644 --- a/nymea-app/ui/connection/ConnectionWizard.qml +++ b/nymea-app/ui/connection/ConnectionWizard.qml @@ -775,7 +775,7 @@ WizardPageBase { Connections { target: nymeaDiscovery.nymeaHosts - onCountChanged: updateNextButton(); + function onCountChanged() { updateNextButton(); } } function updateNextButton() { diff --git a/nymea-app/ui/connection/LoginPage.qml b/nymea-app/ui/connection/LoginPage.qml index 1fec8c32..0787546c 100644 --- a/nymea-app/ui/connection/LoginPage.qml +++ b/nymea-app/ui/connection/LoginPage.qml @@ -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) { diff --git a/nymea-app/ui/customviews/MultiStateChart.qml b/nymea-app/ui/customviews/MultiStateChart.qml index 28607082..e81f4446 100644 --- a/nymea-app/ui/customviews/MultiStateChart.qml +++ b/nymea-app/ui/customviews/MultiStateChart.qml @@ -205,7 +205,7 @@ Item { Connections { target: selectionTabs - onTabSelected: { + function onTabSelected(index) { logsModel.clear() logsModel.fetchLogs() } diff --git a/nymea-app/ui/customviews/ThermostatController.qml b/nymea-app/ui/customviews/ThermostatController.qml index b0799958..b7e727cd 100644 --- a/nymea-app/ui/customviews/ThermostatController.qml +++ b/nymea-app/ui/customviews/ThermostatController.qml @@ -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 diff --git a/nymea-app/ui/delegates/SensorListDelegate.qml b/nymea-app/ui/delegates/SensorListDelegate.qml index eafe0a31..bc267b50 100644 --- a/nymea-app/ui/delegates/SensorListDelegate.qml +++ b/nymea-app/ui/delegates/SensorListDelegate.qml @@ -39,7 +39,7 @@ BigThingTile { Connections { target: itemDelegate - onThingChanged: stateModel.update() + function onThingChanged() { stateModel.update(); } } ListModel { diff --git a/nymea-app/ui/delegates/ThingDelegate.qml b/nymea-app/ui/delegates/ThingDelegate.qml index 5535631d..1af50861 100644 --- a/nymea-app/ui/delegates/ThingDelegate.qml +++ b/nymea-app/ui/delegates/ThingDelegate.qml @@ -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) { diff --git a/nymea-app/ui/devicepages/BarcodeScannerThingPage.qml b/nymea-app/ui/devicepages/BarcodeScannerThingPage.qml index d33d61e9..31b5f2e3 100644 --- a/nymea-app/ui/devicepages/BarcodeScannerThingPage.qml +++ b/nymea-app/ui/devicepages/BarcodeScannerThingPage.qml @@ -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) } diff --git a/nymea-app/ui/devicepages/CleaningRobotThingPage.qml b/nymea-app/ui/devicepages/CleaningRobotThingPage.qml index a4054f2d..bdb79936 100644 --- a/nymea-app/ui/devicepages/CleaningRobotThingPage.qml +++ b/nymea-app/ui/devicepages/CleaningRobotThingPage.qml @@ -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(); } } diff --git a/nymea-app/ui/devicepages/DeviceBrowserPage.qml b/nymea-app/ui/devicepages/DeviceBrowserPage.qml index 29360162..6e5c7ccf 100644 --- a/nymea-app/ui/devicepages/DeviceBrowserPage.qml +++ b/nymea-app/ui/devicepages/DeviceBrowserPage.qml @@ -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) { diff --git a/nymea-app/ui/devicepages/DeviceDetailsPage.qml b/nymea-app/ui/devicepages/DeviceDetailsPage.qml index f9fb1fbd..ca980872 100644 --- a/nymea-app/ui/devicepages/DeviceDetailsPage.qml +++ b/nymea-app/ui/devicepages/DeviceDetailsPage.qml @@ -264,7 +264,7 @@ Page { } Connections { target: root.thing - onEventTriggered: { + function onEventTriggered(eventTypeId, params) { if (eventTypeId === eventComponentItem.eventType.id) { flashlightAnimation.start(); } diff --git a/nymea-app/ui/devicepages/DoorbellDevicePage.qml b/nymea-app/ui/devicepages/DoorbellDevicePage.qml index 3830b69f..f90d9e1b 100644 --- a/nymea-app/ui/devicepages/DoorbellDevicePage.qml +++ b/nymea-app/ui/devicepages/DoorbellDevicePage.qml @@ -67,7 +67,7 @@ ThingPageBase { Connections { target: root.thing - onEventTriggered: { + function onEventTriggered(eventTypeId, params) { print("evenEmitted", params) if (eventTypeId == root.doorbellPressedType.id) { ringAnimation.start(); diff --git a/nymea-app/ui/devicepages/FingerprintReaderDevicePage.qml b/nymea-app/ui/devicepages/FingerprintReaderDevicePage.qml index 608d9b7c..b35432b6 100644 --- a/nymea-app/ui/devicepages/FingerprintReaderDevicePage.qml +++ b/nymea-app/ui/devicepages/FingerprintReaderDevicePage.qml @@ -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}); diff --git a/nymea-app/ui/devicepages/GenericThingPage.qml b/nymea-app/ui/devicepages/GenericThingPage.qml index f18a23ad..888decff 100644 --- a/nymea-app/ui/devicepages/GenericThingPage.qml +++ b/nymea-app/ui/devicepages/GenericThingPage.qml @@ -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(); } diff --git a/nymea-app/ui/devicepages/IrrigationDevicePage.qml b/nymea-app/ui/devicepages/IrrigationDevicePage.qml index 050ad844..ed66102d 100644 --- a/nymea-app/ui/devicepages/IrrigationDevicePage.qml +++ b/nymea-app/ui/devicepages/IrrigationDevicePage.qml @@ -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 { diff --git a/nymea-app/ui/devicepages/NotificationsThingPage.qml b/nymea-app/ui/devicepages/NotificationsThingPage.qml index cb787842..b82b371b 100644 --- a/nymea-app/ui/devicepages/NotificationsThingPage.qml +++ b/nymea-app/ui/devicepages/NotificationsThingPage.qml @@ -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 } diff --git a/nymea-app/ui/devicepages/ThingPageBase.qml b/nymea-app/ui/devicepages/ThingPageBase.qml index 9cefae4a..45e03b20 100644 --- a/nymea-app/ui/devicepages/ThingPageBase.qml +++ b/nymea-app/ui/devicepages/ThingPageBase.qml @@ -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() } diff --git a/nymea-app/ui/experiences/heating/Main.qml b/nymea-app/ui/experiences/heating/Main.qml index 3893e5d5..7eee565e 100644 --- a/nymea-app/ui/experiences/heating/Main.qml +++ b/nymea-app/ui/experiences/heating/Main.qml @@ -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; diff --git a/nymea-app/ui/magic/ScriptEditor.qml b/nymea-app/ui/magic/ScriptEditor.qml index e14341d5..958b4131 100644 --- a/nymea-app/ui/magic/ScriptEditor.qml +++ b/nymea-app/ui/magic/ScriptEditor.qml @@ -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; diff --git a/nymea-app/ui/magic/ScriptsPage.qml b/nymea-app/ui/magic/ScriptsPage.qml index 52989d0b..973aa766 100644 --- a/nymea-app/ui/magic/ScriptsPage.qml +++ b/nymea-app/ui/magic/ScriptsPage.qml @@ -49,7 +49,7 @@ Page { Connections { target: engine.scriptManager - onRemoveScriptReply: { + function onRemoveScriptReply(id, status) { if (id == d.pendingAction) { d.pendingAction = -1; } diff --git a/nymea-app/ui/magic/ThingRulesPage.qml b/nymea-app/ui/magic/ThingRulesPage.qml index 4de8d6fb..6a43ebe7 100644 --- a/nymea-app/ui/magic/ThingRulesPage.qml +++ b/nymea-app/ui/magic/ThingRulesPage.qml @@ -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 { diff --git a/nymea-app/ui/magic/scripting/CompletionBox.qml b/nymea-app/ui/magic/scripting/CompletionBox.qml index 1b33a756..95548be7 100644 --- a/nymea-app/ui/magic/scripting/CompletionBox.qml +++ b/nymea-app/ui/magic/scripting/CompletionBox.qml @@ -48,7 +48,7 @@ Rectangle { Connections { target: root.model - onCountChanged: { + function onCountChanged() { d.hidden = false; d.currentIndex = 0; if (root.model.count == 0) { diff --git a/nymea-app/ui/magic/scripting/EditorPane.qml b/nymea-app/ui/magic/scripting/EditorPane.qml index e32cd5dd..a8f1d094 100644 --- a/nymea-app/ui/magic/scripting/EditorPane.qml +++ b/nymea-app/ui/magic/scripting/EditorPane.qml @@ -83,7 +83,7 @@ Item { } Connections { target: contentContainer.data[index] - onRaise: { + function onRaise() { panelTabs.currentIndex = index d.autoWouldShow = true; } diff --git a/nymea-app/ui/mainviews/AirConditioningView.qml b/nymea-app/ui/mainviews/AirConditioningView.qml index d64ee169..974311f2 100644 --- a/nymea-app/ui/mainviews/AirConditioningView.qml +++ b/nymea-app/ui/mainviews/AirConditioningView.qml @@ -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) diff --git a/nymea-app/ui/mainviews/EnergyPieChartDelegate.qml b/nymea-app/ui/mainviews/EnergyPieChartDelegate.qml index 0382e73a..aceb97d9 100644 --- a/nymea-app/ui/mainviews/EnergyPieChartDelegate.qml +++ b/nymea-app/ui/mainviews/EnergyPieChartDelegate.qml @@ -43,7 +43,7 @@ Item { } Connections { target: currentPowerState - onValueChanged: { + function onValueChanged() { if (currentPowerState.value >= 0) { consumerSlice.value = currentPowerState.value producerSlice.value = 0 diff --git a/nymea-app/ui/mainviews/FavoritesView.qml b/nymea-app/ui/mainviews/FavoritesView.qml index ca645b55..59ce20ac 100644 --- a/nymea-app/ui/mainviews/FavoritesView.qml +++ b/nymea-app/ui/mainviews/FavoritesView.qml @@ -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 } diff --git a/nymea-app/ui/mainviews/ScenesView.qml b/nymea-app/ui/mainviews/ScenesView.qml index 3e3656e3..fdd502c3 100644 --- a/nymea-app/ui/mainviews/ScenesView.qml +++ b/nymea-app/ui/mainviews/ScenesView.qml @@ -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") } diff --git a/nymea-app/ui/mainviews/airconditioning/ACSettingsPage.qml b/nymea-app/ui/mainviews/airconditioning/ACSettingsPage.qml index 6f318c0e..0d3bb4c7 100644 --- a/nymea-app/ui/mainviews/airconditioning/ACSettingsPage.qml +++ b/nymea-app/ui/mainviews/airconditioning/ACSettingsPage.qml @@ -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) diff --git a/nymea-app/ui/mainviews/airconditioning/EditZonePage.qml b/nymea-app/ui/mainviews/airconditioning/EditZonePage.qml index 190ff808..b2da78d2 100644 --- a/nymea-app/ui/mainviews/airconditioning/EditZonePage.qml +++ b/nymea-app/ui/mainviews/airconditioning/EditZonePage.qml @@ -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() diff --git a/nymea-app/ui/mainviews/airconditioning/EditZoneThingsPage.qml b/nymea-app/ui/mainviews/airconditioning/EditZoneThingsPage.qml index 0bde9b39..26cd4150 100644 --- a/nymea-app/ui/mainviews/airconditioning/EditZoneThingsPage.qml +++ b/nymea-app/ui/mainviews/airconditioning/EditZoneThingsPage.qml @@ -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 } diff --git a/nymea-app/ui/mainviews/dashboard/Dashboard.qml b/nymea-app/ui/mainviews/dashboard/Dashboard.qml index a0575b13..e064c92b 100644 --- a/nymea-app/ui/mainviews/dashboard/Dashboard.qml +++ b/nymea-app/ui/mainviews/dashboard/Dashboard.qml @@ -144,7 +144,7 @@ MainViewBase { } Connections { target: loader.item - onOpenDialog: { + function onOpenDialog(dialogComponent) { dialogComponent.createObject(root).open() } } diff --git a/nymea-app/ui/mainviews/dashboard/DashboardAddWizard.qml b/nymea-app/ui/mainviews/dashboard/DashboardAddWizard.qml index 9b91bc90..a779d342 100644 --- a/nymea-app/ui/mainviews/dashboard/DashboardAddWizard.qml +++ b/nymea-app/ui/mainviews/dashboard/DashboardAddWizard.qml @@ -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(); } diff --git a/nymea-app/ui/mainviews/dashboard/DashboardSceneDelegate.qml b/nymea-app/ui/mainviews/dashboard/DashboardSceneDelegate.qml index f011e51f..88d8776c 100644 --- a/nymea-app/ui/mainviews/dashboard/DashboardSceneDelegate.qml +++ b/nymea-app/ui/mainviews/dashboard/DashboardSceneDelegate.qml @@ -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") } diff --git a/nymea-app/ui/mainviews/energy/ConsumerStats.qml b/nymea-app/ui/mainviews/energy/ConsumerStats.qml index 804690fc..3740ee66 100644 --- a/nymea-app/ui/mainviews/energy/ConsumerStats.qml +++ b/nymea-app/ui/mainviews/energy/ConsumerStats.qml @@ -121,7 +121,7 @@ StatsBase { Connections { target: d - onStartOffsetChanged: refresh() + function onStartOffsetChanged() { refresh(); } } function refreshLabels() { diff --git a/nymea-app/ui/mainviews/energy/ConsumersHistory.qml b/nymea-app/ui/mainviews/energy/ConsumersHistory.qml index 113059c7..d0c10ddf 100644 --- a/nymea-app/ui/mainviews/energy/ConsumersHistory.qml +++ b/nymea-app/ui/mainviews/energy/ConsumersHistory.qml @@ -137,7 +137,7 @@ Item { Connections { target: engine.tagsManager - onBusyChanged: d.update() + function onBusyChanged() { d.update(); } } Component { diff --git a/nymea-app/ui/mainviews/energy/ConsumersPieChart.qml b/nymea-app/ui/mainviews/energy/ConsumersPieChart.qml index 3483ea58..46c6032d 100644 --- a/nymea-app/ui/mainviews/energy/ConsumersPieChart.qml +++ b/nymea-app/ui/mainviews/energy/ConsumersPieChart.qml @@ -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 diff --git a/nymea-app/ui/mainviews/energy/PowerBalanceHistory.qml b/nymea-app/ui/mainviews/energy/PowerBalanceHistory.qml index 0276cab1..ff69477e 100644 --- a/nymea-app/ui/mainviews/energy/PowerBalanceHistory.qml +++ b/nymea-app/ui/mainviews/energy/PowerBalanceHistory.qml @@ -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 diff --git a/nymea-app/ui/mainviews/energy/PowerBalanceStats.qml b/nymea-app/ui/mainviews/energy/PowerBalanceStats.qml index 1f442296..ad2651a8 100644 --- a/nymea-app/ui/mainviews/energy/PowerBalanceStats.qml +++ b/nymea-app/ui/mainviews/energy/PowerBalanceStats.qml @@ -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(); } diff --git a/nymea-app/ui/mainviews/energy/PowerConsumptionBalanceHistory.qml b/nymea-app/ui/mainviews/energy/PowerConsumptionBalanceHistory.qml index 89c61995..13884611 100644 --- a/nymea-app/ui/mainviews/energy/PowerConsumptionBalanceHistory.qml +++ b/nymea-app/ui/mainviews/energy/PowerConsumptionBalanceHistory.qml @@ -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) diff --git a/nymea-app/ui/mainviews/energy/PowerProductionBalanceHistory.qml b/nymea-app/ui/mainviews/energy/PowerProductionBalanceHistory.qml index aab7f48c..84494c7b 100644 --- a/nymea-app/ui/mainviews/energy/PowerProductionBalanceHistory.qml +++ b/nymea-app/ui/mainviews/energy/PowerProductionBalanceHistory.qml @@ -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) diff --git a/nymea-app/ui/system/CloudSettingsPage.qml b/nymea-app/ui/system/CloudSettingsPage.qml index a1184466..05b2bfc9 100644 --- a/nymea-app/ui/system/CloudSettingsPage.qml +++ b/nymea-app/ui/system/CloudSettingsPage.qml @@ -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; diff --git a/nymea-app/ui/system/EvDashSettingsPage.qml b/nymea-app/ui/system/EvDashSettingsPage.qml index 40d53875..ac908775 100644 --- a/nymea-app/ui/system/EvDashSettingsPage.qml +++ b/nymea-app/ui/system/EvDashSettingsPage.qml @@ -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 diff --git a/nymea-app/ui/system/GeneralSettingsPage.qml b/nymea-app/ui/system/GeneralSettingsPage.qml index 43487d38..e2734d40 100644 --- a/nymea-app/ui/system/GeneralSettingsPage.qml +++ b/nymea-app/ui/system/GeneralSettingsPage.qml @@ -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) { diff --git a/nymea-app/ui/system/ModbusRtuAddMasterPage.qml b/nymea-app/ui/system/ModbusRtuAddMasterPage.qml index 7be622d7..276ea8ad 100644 --- a/nymea-app/ui/system/ModbusRtuAddMasterPage.qml +++ b/nymea-app/ui/system/ModbusRtuAddMasterPage.qml @@ -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)) { diff --git a/nymea-app/ui/system/ModbusRtuReconfigureMasterPage.qml b/nymea-app/ui/system/ModbusRtuReconfigureMasterPage.qml index 942dd0ce..a59548fd 100644 --- a/nymea-app/ui/system/ModbusRtuReconfigureMasterPage.qml +++ b/nymea-app/ui/system/ModbusRtuReconfigureMasterPage.qml @@ -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)) { diff --git a/nymea-app/ui/system/ModbusRtuSettingsPage.qml b/nymea-app/ui/system/ModbusRtuSettingsPage.qml index 0a702a5b..a9ce4aa2 100644 --- a/nymea-app/ui/system/ModbusRtuSettingsPage.qml +++ b/nymea-app/ui/system/ModbusRtuSettingsPage.qml @@ -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)) { diff --git a/nymea-app/ui/system/PluginParamsPage.qml b/nymea-app/ui/system/PluginParamsPage.qml index c3454610..d2362b57 100644 --- a/nymea-app/ui/system/PluginParamsPage.qml +++ b/nymea-app/ui/system/PluginParamsPage.qml @@ -50,7 +50,7 @@ SettingsPageBase { Connections { target: engine.thingManager - onSavePluginConfigReply: { + function onSavePluginConfigReply(commandId, thingError) { if (thingError === Thing.ThingErrorNoError) { pageStack.pop(); } else { diff --git a/nymea-app/ui/system/SystemUpdatePage.qml b/nymea-app/ui/system/SystemUpdatePage.qml index ea6be6d2..49a99aa5 100644 --- a/nymea-app/ui/system/SystemUpdatePage.qml +++ b/nymea-app/ui/system/SystemUpdatePage.qml @@ -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(); diff --git a/nymea-app/ui/system/UsersSettingsPage.qml b/nymea-app/ui/system/UsersSettingsPage.qml index 7a0b8664..38d1bd08 100644 --- a/nymea-app/ui/system/UsersSettingsPage.qml +++ b/nymea-app/ui/system/UsersSettingsPage.qml @@ -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") diff --git a/nymea-app/ui/system/zigbee/ZigbeeAddNetworkPage.qml b/nymea-app/ui/system/zigbee/ZigbeeAddNetworkPage.qml index 32f421d9..2bd903c7 100644 --- a/nymea-app/ui/system/zigbee/ZigbeeAddNetworkPage.qml +++ b/nymea-app/ui/system/zigbee/ZigbeeAddNetworkPage.qml @@ -146,7 +146,7 @@ SettingsPageBase { Connections { target: root.zigbeeManager - onAddNetworkReply: { + function onAddNetworkReply(commandId, error, networkUuid) { if (commandId == d.pendingCommandId) { d.pendingCommandId = -1 var props = {}; diff --git a/nymea-app/ui/system/zigbee/ZigbeeNetworkPage.qml b/nymea-app/ui/system/zigbee/ZigbeeNetworkPage.qml index 0d1fe504..0dfd9dff 100644 --- a/nymea-app/ui/system/zigbee/ZigbeeNetworkPage.qml +++ b/nymea-app/ui/system/zigbee/ZigbeeNetworkPage.qml @@ -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 { diff --git a/nymea-app/ui/system/zigbee/ZigbeeNetworkSettingsPage.qml b/nymea-app/ui/system/zigbee/ZigbeeNetworkSettingsPage.qml index b7ed6793..f6ceb227 100644 --- a/nymea-app/ui/system/zigbee/ZigbeeNetworkSettingsPage.qml +++ b/nymea-app/ui/system/zigbee/ZigbeeNetworkSettingsPage.qml @@ -39,7 +39,7 @@ SettingsPageBase { Connections { target: zigbeeManager - onFactoryResetNetworkReply: { + function onFactoryResetNetworkReply(commandId, error) { busy = false; // if (error != ZigbeeManager.ZigbeeErrorNoError) { // } diff --git a/nymea-app/ui/system/zigbee/ZigbeeNetworkTopologyPage.qml b/nymea-app/ui/system/zigbee/ZigbeeNetworkTopologyPage.qml index 6576adf0..01c4828b 100644 --- a/nymea-app/ui/system/zigbee/ZigbeeNetworkTopologyPage.qml +++ b/nymea-app/ui/system/zigbee/ZigbeeNetworkTopologyPage.qml @@ -72,7 +72,7 @@ Page { Connections { target: root.network.nodes - onNodeAdded: { + function onNodeAdded(node) { root.reload() node.neighborsChanged.connect(root.reloadDelayed); } diff --git a/nymea-app/ui/system/zigbee/ZigbeeNodePage.qml b/nymea-app/ui/system/zigbee/ZigbeeNodePage.qml index fad26218..56dc9e4a 100644 --- a/nymea-app/ui/system/zigbee/ZigbeeNodePage.qml +++ b/nymea-app/ui/system/zigbee/ZigbeeNodePage.qml @@ -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) { diff --git a/nymea-app/ui/system/zwave/ZWaveAddNetworkPage.qml b/nymea-app/ui/system/zwave/ZWaveAddNetworkPage.qml index e25e9ba9..1466231d 100644 --- a/nymea-app/ui/system/zwave/ZWaveAddNetworkPage.qml +++ b/nymea-app/ui/system/zwave/ZWaveAddNetworkPage.qml @@ -45,7 +45,7 @@ SettingsPageBase { Connections { target: root.zwaveManager - onAddNetworkReply: { + function onAddNetworkReply(commandId, error, networkUuid) { if (commandId == d.pendingCallId) { d.pendingCallId = -1 var props = {}; diff --git a/nymea-app/ui/system/zwave/ZWaveNetworkPage.qml b/nymea-app/ui/system/zwave/ZWaveNetworkPage.qml index b218027e..eeb2ccca 100644 --- a/nymea-app/ui/system/zwave/ZWaveNetworkPage.qml +++ b/nymea-app/ui/system/zwave/ZWaveNetworkPage.qml @@ -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"), diff --git a/nymea-app/ui/system/zwave/ZWaveNetworkSettingsPage.qml b/nymea-app/ui/system/zwave/ZWaveNetworkSettingsPage.qml index 19796b5f..f15faf47 100644 --- a/nymea-app/ui/system/zwave/ZWaveNetworkSettingsPage.qml +++ b/nymea-app/ui/system/zwave/ZWaveNetworkSettingsPage.qml @@ -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) diff --git a/nymea-app/ui/thingconfiguration/EditThingsPage.qml b/nymea-app/ui/thingconfiguration/EditThingsPage.qml index a9930121..4a2a1417 100644 --- a/nymea-app/ui/thingconfiguration/EditThingsPage.qml +++ b/nymea-app/ui/thingconfiguration/EditThingsPage.qml @@ -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) } } } diff --git a/nymea-app/ui/thingconfiguration/NewThingPage.qml b/nymea-app/ui/thingconfiguration/NewThingPage.qml index 87de113d..d7c7e646 100644 --- a/nymea-app/ui/thingconfiguration/NewThingPage.qml +++ b/nymea-app/ui/thingconfiguration/NewThingPage.qml @@ -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 diff --git a/nymea-app/ui/thingconfiguration/SetupWizard.qml b/nymea-app/ui/thingconfiguration/SetupWizard.qml index de4f472b..14640841 100644 --- a/nymea-app/ui/thingconfiguration/SetupWizard.qml +++ b/nymea-app/ui/thingconfiguration/SetupWizard.qml @@ -97,7 +97,6 @@ Page { } busyOverlay.shown = true; - } } diff --git a/nymea-app/ui/utils/ActionQueue.qml b/nymea-app/ui/utils/ActionQueue.qml index c2eaba85..28a91324 100644 --- a/nymea-app/ui/utils/ActionQueue.qml +++ b/nymea-app/ui/utils/ActionQueue.qml @@ -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; diff --git a/version.txt b/version.txt index 2e755fee..c5523993 100644 --- a/version.txt +++ b/version.txt @@ -1,2 +1,2 @@ 1.11.7 -713 +714