Update singal connection handlers to the new syntax
This commit is contained in:
parent
f58e16639b
commit
0f4f5f1805
@ -26,8 +26,8 @@
|
|||||||
#define NYMEAJSONRPCCLIENT_H
|
#define NYMEAJSONRPCCLIENT_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QVariantMap>
|
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
#include <QVariantMap>
|
||||||
#include <QVersionNumber>
|
#include <QVersionNumber>
|
||||||
|
|
||||||
#include "connection/nymeaconnection.h"
|
#include "connection/nymeaconnection.h"
|
||||||
@ -43,8 +43,8 @@ class JsonRpcClient : public QObject
|
|||||||
Q_PROPERTY(NymeaConnection::BearerTypes availableBearerTypes READ availableBearerTypes NOTIFY availableBearerTypesChanged)
|
Q_PROPERTY(NymeaConnection::BearerTypes availableBearerTypes READ availableBearerTypes NOTIFY availableBearerTypesChanged)
|
||||||
Q_PROPERTY(NymeaConnection::ConnectionStatus connectionStatus READ connectionStatus NOTIFY connectionStatusChanged)
|
Q_PROPERTY(NymeaConnection::ConnectionStatus connectionStatus READ connectionStatus NOTIFY connectionStatusChanged)
|
||||||
Q_PROPERTY(bool connected READ connected NOTIFY connectedChanged)
|
Q_PROPERTY(bool connected READ connected NOTIFY connectedChanged)
|
||||||
Q_PROPERTY(NymeaHost* currentHost READ currentHost NOTIFY currentHostChanged)
|
Q_PROPERTY(NymeaHost *currentHost READ currentHost NOTIFY currentHostChanged)
|
||||||
Q_PROPERTY(Connection* currentConnection READ currentConnection NOTIFY currentConnectionChanged)
|
Q_PROPERTY(Connection *currentConnection READ currentConnection NOTIFY currentConnectionChanged)
|
||||||
Q_PROPERTY(bool initialSetupRequired READ initialSetupRequired NOTIFY initialSetupRequiredChanged)
|
Q_PROPERTY(bool initialSetupRequired READ initialSetupRequired NOTIFY initialSetupRequiredChanged)
|
||||||
Q_PROPERTY(bool authenticationRequired READ authenticationRequired NOTIFY authenticationRequiredChanged)
|
Q_PROPERTY(bool authenticationRequired READ authenticationRequired NOTIFY authenticationRequiredChanged)
|
||||||
Q_PROPERTY(bool pushButtonAuthAvailable READ pushButtonAuthAvailable NOTIFY pushButtonAuthAvailableChanged)
|
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 authenticate(const QString &username, const QString &password, const QString &deviceName);
|
||||||
Q_INVOKABLE int requestPushButtonAuth(const QString &deviceName);
|
Q_INVOKABLE int requestPushButtonAuth(const QString &deviceName);
|
||||||
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void availableBearerTypesChanged();
|
void availableBearerTypesChanged();
|
||||||
void connectionStatusChanged();
|
void connectionStatusChanged();
|
||||||
@ -181,15 +180,14 @@ private:
|
|||||||
|
|
||||||
bool loadPem(const QUuid &serverUud, QByteArray &pem);
|
bool loadPem(const QUuid &serverUud, QByteArray &pem);
|
||||||
bool storePem(const QUuid &serverUuid, const QByteArray &pem);
|
bool storePem(const QUuid &serverUuid, const QByteArray &pem);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class JsonRpcReply : public QObject
|
class JsonRpcReply : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
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();
|
~JsonRpcReply();
|
||||||
|
|
||||||
int commandId() const;
|
int commandId() const;
|
||||||
@ -211,5 +209,4 @@ private:
|
|||||||
QString m_callback;
|
QString m_callback;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif // NYMEAJSONRPCCLIENT_H
|
#endif // NYMEAJSONRPCCLIENT_H
|
||||||
|
|||||||
@ -73,8 +73,8 @@ protected:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void countChanged();
|
void countChanged();
|
||||||
void thingAdded(Thing *device);
|
void thingAdded(Thing *thing);
|
||||||
void thingRemoved(Thing *device);
|
void thingRemoved(Thing *thing);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<Thing *> m_things;
|
QList<Thing *> m_things;
|
||||||
|
|||||||
@ -100,7 +100,7 @@ Page {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.ruleManager
|
target: engine.ruleManager
|
||||||
onAddRuleReply: (commandId, ruleError, ruleId) => {
|
function onAddRuleReply(commandId, ruleError, ruleId) {
|
||||||
if (ruleError === RuleManager.RuleErrorNoError) {
|
if (ruleError === RuleManager.RuleErrorNoError) {
|
||||||
// print("should tag rule now:", d.editRulePage.rule.id, d.editRulePage.ruleIcon, d.editRulePage.ruleColor)
|
// print("should tag rule now:", d.editRulePage.rule.id, d.editRulePage.ruleIcon, d.editRulePage.ruleColor)
|
||||||
// engine.tagsManager.tagRule(ruleId, "color", d.editRulePage.ruleColor)
|
// engine.tagsManager.tagRule(ruleId, "color", d.editRulePage.ruleColor)
|
||||||
@ -113,7 +113,7 @@ Page {
|
|||||||
d.editRulePage.busy = false;
|
d.editRulePage.busy = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
onEditRuleReply: (commandId, ruleError) => {
|
function onEditRuleReply(commandId, ruleError) {
|
||||||
if (ruleError === RuleManager.RuleErrorNoError) {
|
if (ruleError === RuleManager.RuleErrorNoError) {
|
||||||
// print("should tag rule now:", d.editRulePage.ruleIcon, d.editRulePage.ruleColor)
|
// print("should tag rule now:", d.editRulePage.ruleIcon, d.editRulePage.ruleColor)
|
||||||
engine.tagsManager.tagRule(d.editRulePage.rule.id, "color", 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
|
property var iconTag: model.executable ? engine.tagsManager.tags.findRuleTag(model.id, "icon") : null
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.tagsManager.tags
|
target: engine.tagsManager.tags
|
||||||
onCountChanged: {
|
function onCountChanged() {
|
||||||
colorTag = engine.tagsManager.tags.findRuleTag(model.id, "color")
|
colorTag = engine.tagsManager.tags.findRuleTag(model.id, "color")
|
||||||
iconTag = engine.tagsManager.tags.findRuleTag(model.id, "icon")
|
iconTag = engine.tagsManager.tags.findRuleTag(model.id, "icon")
|
||||||
}
|
}
|
||||||
|
|||||||
@ -127,7 +127,7 @@ Page {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.ruleManager
|
target: engine.ruleManager
|
||||||
onAddRuleReply: (commandId, ruleError, ruleId) => {
|
function onAddRuleReply(commandId, ruleError, ruleId) {
|
||||||
d.editRulePage.busy = false
|
d.editRulePage.busy = false
|
||||||
if (d.editRulePage) {
|
if (d.editRulePage) {
|
||||||
pageStack.pop();
|
pageStack.pop();
|
||||||
|
|||||||
@ -593,7 +593,7 @@ ApplicationWindow {
|
|||||||
}
|
}
|
||||||
Connections {
|
Connections {
|
||||||
target: Qt.application
|
target: Qt.application
|
||||||
onStateChanged: closeTimer.stop()
|
function onStateChanged(state) { closeTimer.stop(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
FolderListModel {
|
FolderListModel {
|
||||||
|
|||||||
@ -47,7 +47,7 @@ Page {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.jsonRpcClient
|
target: engine.jsonRpcClient
|
||||||
onPushButtonAuthFailed: {
|
function onPushButtonAuthFailed() {
|
||||||
var popup = errorDialog.createObject(root)
|
var popup = errorDialog.createObject(root)
|
||||||
popup.text = qsTr("Sorry, something went wrong during the setup. Try again please.")
|
popup.text = qsTr("Sorry, something went wrong during the setup. Try again please.")
|
||||||
popup.open();
|
popup.open();
|
||||||
|
|||||||
@ -309,10 +309,10 @@ Item {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.jsonRpcClient
|
target: engine.jsonRpcClient
|
||||||
onCurrentHostChanged: {
|
|
||||||
init();
|
function onCurrentHostChanged() { init(); }
|
||||||
}
|
|
||||||
onVerifyConnectionCertificate: {
|
function onVerifyConnectionCertificate(serverUuid, issuerInfo, pem) {
|
||||||
print("Asking user to verify certificate:", serverUuid, issuerInfo, pem)
|
print("Asking user to verify certificate:", serverUuid, issuerInfo, pem)
|
||||||
var certDialogComponent = Qt.createComponent(Qt.resolvedUrl("connection/CertificateErrorDialog.qml"));
|
var certDialogComponent = Qt.createComponent(Qt.resolvedUrl("connection/CertificateErrorDialog.qml"));
|
||||||
var popup = certDialogComponent.createObject(root);
|
var popup = certDialogComponent.createObject(root);
|
||||||
@ -322,14 +322,15 @@ Item {
|
|||||||
})
|
})
|
||||||
popup.open();
|
popup.open();
|
||||||
}
|
}
|
||||||
onConnectedChanged: {
|
|
||||||
|
function onConnectedChanged(connected) {
|
||||||
print("json client connected changed", engine.jsonRpcClient.connected, engine.jsonRpcClient.serverUuid)
|
print("json client connected changed", engine.jsonRpcClient.connected, engine.jsonRpcClient.serverUuid)
|
||||||
if (engine.jsonRpcClient.connected) {
|
if (engine.jsonRpcClient.connected) {
|
||||||
nymeaDiscovery.cacheHost(engine.jsonRpcClient.currentHost)
|
nymeaDiscovery.cacheHost(engine.jsonRpcClient.currentHost)
|
||||||
configuredHost.uuid = engine.jsonRpcClient.serverUuid
|
configuredHost.uuid = engine.jsonRpcClient.serverUuid
|
||||||
|
|
||||||
for (var i = 0; i < configuredHostsModel.count; i++) {
|
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);
|
configuredHostsModel.removeHost(i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -338,28 +339,31 @@ Item {
|
|||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
onAuthenticationRequiredChanged: {
|
function onAuthenticationRequiredChanged() {
|
||||||
print("auth required changed")
|
print("auth required changed")
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
onInitialSetupRequiredChanged: {
|
|
||||||
|
function onInitialSetupRequiredChanged() {
|
||||||
print("setup required changed")
|
print("setup required changed")
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
onInvalidMinimumVersion: {
|
function onInvalidMinimumVersion(actualVersion, minVersion) {
|
||||||
var popup = invalidVersionComponent.createObject(app.contentItem);
|
var popup = invalidVersionComponent.createObject(app.contentItem);
|
||||||
popup.actualVersion = actualVersion;
|
popup.actualVersion = actualVersion;
|
||||||
popup.minVersion = minVersion;
|
popup.minVersion = minVersion;
|
||||||
popup.open()
|
popup.open()
|
||||||
}
|
}
|
||||||
onInvalidMaximumVersion: {
|
|
||||||
|
function onInvalidMaximumVersion(actualVersion, maxVersion) {
|
||||||
var popup = invalidVersionComponent.createObject(app.contentItem);
|
var popup = invalidVersionComponent.createObject(app.contentItem);
|
||||||
popup.actualVersion = actualVersion;
|
popup.actualVersion = actualVersion;
|
||||||
popup.maxVersion = maxVersion;
|
popup.maxVersion = maxVersion;
|
||||||
popup.open()
|
popup.open()
|
||||||
}
|
}
|
||||||
onInvalidServerUuid: {
|
|
||||||
|
function onInvalidServerUuid(uuid) {
|
||||||
var connection = engine.jsonRpcClient.currentConnection;
|
var connection = engine.jsonRpcClient.currentConnection;
|
||||||
engine.jsonRpcClient.disconnectFromHost();
|
engine.jsonRpcClient.disconnectFromHost();
|
||||||
engine.jsonRpcClient.currentHost.connections.removeConnection(connection);
|
engine.jsonRpcClient.currentHost.connections.removeConnection(connection);
|
||||||
@ -369,7 +373,7 @@ Item {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.nymeaConfiguration
|
target: engine.nymeaConfiguration
|
||||||
onFetchingDataChanged: {
|
function onFetchingDataChanged() {
|
||||||
print("fetching NymeaConfigration:", engine.nymeaConfiguration.fetchingData)
|
print("fetching NymeaConfigration:", engine.nymeaConfiguration.fetchingData)
|
||||||
if (!engine.nymeaConfiguration.fetchingData) {
|
if (!engine.nymeaConfiguration.fetchingData) {
|
||||||
syncRemoteConnection()
|
syncRemoteConnection()
|
||||||
@ -378,7 +382,7 @@ Item {
|
|||||||
}
|
}
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.nymeaConfiguration.tunnelProxyServerConfigurations
|
target: engine.nymeaConfiguration.tunnelProxyServerConfigurations
|
||||||
onCountChanged: {
|
function onCountChanged() {
|
||||||
print("tunnel proxy count changed:", engine.nymeaConfiguration.tunnelProxyServerConfigurations.count)
|
print("tunnel proxy count changed:", engine.nymeaConfiguration.tunnelProxyServerConfigurations.count)
|
||||||
if (!engine.nymeaConfiguration.fetchingData) {
|
if (!engine.nymeaConfiguration.fetchingData) {
|
||||||
syncRemoteConnection();
|
syncRemoteConnection();
|
||||||
@ -394,7 +398,9 @@ Item {
|
|||||||
return;
|
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)
|
var connection = engine.jsonRpcClient.currentHost.connections.get(i)
|
||||||
if (connection.url.toString().startsWith("tunnel")) {
|
if (connection.url.toString().startsWith("tunnel")) {
|
||||||
console.log("Removing tunnel proxy connection:", connection.url)
|
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);
|
var tunnelProxyConfig = engine.nymeaConfiguration.tunnelProxyServerConfigurations.get(i);
|
||||||
console.debug("tunnelProxyConfig:", JSON.stringify(tunnelProxyConfig))
|
console.debug("tunnelProxyConfig:", JSON.stringify(tunnelProxyConfig))
|
||||||
var url = tunnelProxyConfig.sslEnabled ? "tunnels://" : "tunnel://";
|
var url = tunnelProxyConfig.sslEnabled ? "tunnels://" : "tunnel://";
|
||||||
@ -418,7 +424,7 @@ Item {
|
|||||||
Connections {
|
Connections {
|
||||||
target: Qt.application
|
target: Qt.application
|
||||||
enabled: engine.jsonRpcClient.connected && settings.returnToHome
|
enabled: engine.jsonRpcClient.connected && settings.returnToHome
|
||||||
onStateChanged: {
|
function onStateChanged(state) {
|
||||||
print("App active state changed:", state)
|
print("App active state changed:", state)
|
||||||
if (state !== Qt.ApplicationActive) {
|
if (state !== Qt.ApplicationActive) {
|
||||||
init();
|
init();
|
||||||
@ -428,7 +434,7 @@ Item {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.thingManager
|
target: engine.thingManager
|
||||||
onFetchingDataChanged: {
|
function onFetchingDataChanged() {
|
||||||
if (!engine.thingManager.fetchingData) {
|
if (!engine.thingManager.fetchingData) {
|
||||||
processPendingPushNotificationActions();
|
processPendingPushNotificationActions();
|
||||||
updatePushNotificationThings()
|
updatePushNotificationThings()
|
||||||
@ -439,10 +445,11 @@ Item {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: PlatformHelper
|
target: PlatformHelper
|
||||||
onPendingNotificationActionsChanged: {
|
function onPendingNotificationActionsChanged() {
|
||||||
processPendingPushNotificationActions()
|
processPendingPushNotificationActions()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function processPendingPushNotificationActions() {
|
function processPendingPushNotificationActions() {
|
||||||
print("pending notification actions changed:", PlatformHelper.pendingNotificationActions)
|
print("pending notification actions changed:", PlatformHelper.pendingNotificationActions)
|
||||||
if (PlatformHelper.pendingNotificationActions.length > 0) {
|
if (PlatformHelper.pendingNotificationActions.length > 0) {
|
||||||
@ -475,7 +482,6 @@ Item {
|
|||||||
engine.thingManager.things.getThing(thingId).executeAction(action, actionParams);
|
engine.thingManager.things.getThing(thingId).executeAction(action, actionParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PlatformHelper.notificationActionHandled(notificationAction.id)
|
PlatformHelper.notificationActionHandled(notificationAction.id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,13 +40,13 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: AWSClient
|
target: AWSClient
|
||||||
onLoginResult: {
|
function onLoginResult(error) {
|
||||||
root.busy = false;
|
root.busy = false;
|
||||||
if (error === AWSClient.LoginErrorNoError) {
|
if (error === AWSClient.LoginErrorNoError) {
|
||||||
AWSClient.fetchDevices();
|
AWSClient.fetchDevices();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onDeleteAccountResult: {
|
function onDeleteAccountResult(error) {
|
||||||
root.busy = false;
|
root.busy = false;
|
||||||
if (error !== AWSClient.LoginErrorNoError) {
|
if (error !== AWSClient.LoginErrorNoError) {
|
||||||
var errorDialog = Qt.createComponent(Qt.resolvedUrl("../components/ErrorDialog.qml"));
|
var errorDialog = Qt.createComponent(Qt.resolvedUrl("../components/ErrorDialog.qml"));
|
||||||
@ -199,7 +199,7 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: AWSClient
|
target: AWSClient
|
||||||
onLoginResult: {
|
function onLoginResult(error) {
|
||||||
switch (error) {
|
switch (error) {
|
||||||
case AWSClient.LoginErrorInvalidUserOrPass:
|
case AWSClient.LoginErrorInvalidUserOrPass:
|
||||||
errorLabel.text = qsTr("Failed to log in. Please try again. Do you perhaps have <a href=\"#\">forgotten your password?</a>")
|
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 {
|
Connections {
|
||||||
target: AWSClient
|
target: AWSClient
|
||||||
onSignupResult: {
|
function onSignupResult(error) {
|
||||||
signupPage.busy = false;
|
signupPage.busy = false;
|
||||||
var text;
|
var text;
|
||||||
switch (error) {
|
switch (error) {
|
||||||
@ -385,7 +385,7 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: AWSClient
|
target: AWSClient
|
||||||
onConfirmationResult: {
|
function onConfirmationResult(error) {
|
||||||
root.busy = false;
|
root.busy = false;
|
||||||
var text
|
var text
|
||||||
switch (error) {
|
switch (error) {
|
||||||
@ -423,7 +423,7 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: AWSClient
|
target: AWSClient
|
||||||
onForgotPasswordResult: {
|
function onForgotPasswordResult(error) {
|
||||||
resetPasswordPage.busy = false
|
resetPasswordPage.busy = false
|
||||||
if (error !== AWSClient.LoginErrorNoError) {
|
if (error !== AWSClient.LoginErrorNoError) {
|
||||||
var errorDialog = Qt.createComponent(Qt.resolvedUrl("../components/ErrorDialog.qml"));
|
var errorDialog = Qt.createComponent(Qt.resolvedUrl("../components/ErrorDialog.qml"));
|
||||||
@ -476,7 +476,7 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: AWSClient
|
target: AWSClient
|
||||||
onConfirmForgotPasswordResult: {
|
function onConfirmForgotPasswordResult(error) {
|
||||||
confirmResetPasswordPage.busy = false
|
confirmResetPasswordPage.busy = false
|
||||||
if (error !== AWSClient.LoginErrorNoError) {
|
if (error !== AWSClient.LoginErrorNoError) {
|
||||||
var errorDialog = Qt.createComponent(Qt.resolvedUrl("../components/ErrorDialog.qml"));
|
var errorDialog = Qt.createComponent(Qt.resolvedUrl("../components/ErrorDialog.qml"));
|
||||||
|
|||||||
@ -58,7 +58,7 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: styleController
|
target: styleController
|
||||||
onCurrentStyleChanged: {
|
function onCurrentStyleChanged() {
|
||||||
var popup = styleChangedDialog.createObject(root)
|
var popup = styleChangedDialog.createObject(root)
|
||||||
popup.open()
|
popup.open()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,7 +38,7 @@ Item {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: colorState
|
target: colorState
|
||||||
onValueChanged: {
|
function onValueChanged() {
|
||||||
if (actionQueue.pendingValue === null) {
|
if (actionQueue.pendingValue === null) {
|
||||||
actionQueue.useStoredPoint = false
|
actionQueue.useStoredPoint = false
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,7 +37,7 @@ Item {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: model
|
target: model
|
||||||
onCountChanged: canvas.requestPaint()
|
function onCountChanged() { canvas.requestPaint(); }
|
||||||
}
|
}
|
||||||
onModelChanged: canvas.requestPaint()
|
onModelChanged: canvas.requestPaint()
|
||||||
|
|
||||||
|
|||||||
@ -62,7 +62,7 @@ Item {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.thingManager
|
target: engine.thingManager
|
||||||
onExecuteBrowserItemReply: {
|
function onExecuteBrowserItemReply(commandId, thingError, displayMessage) {
|
||||||
if (commandId == d.pendingItemExecutionId) {
|
if (commandId == d.pendingItemExecutionId) {
|
||||||
if (thingError === Thing.ThingErrorNoError) {
|
if (thingError === Thing.ThingErrorNoError) {
|
||||||
root.itemLaunched();
|
root.itemLaunched();
|
||||||
|
|||||||
@ -73,7 +73,7 @@ Item {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.thingManager
|
target: engine.thingManager
|
||||||
onExecuteActionReply: (commandId, thingError, displayMessage) => {
|
function onExecuteActionReply(commandId, thingError, displayMessage) {
|
||||||
if (commandId === d.pendingCallId) {
|
if (commandId === d.pendingCallId) {
|
||||||
if (thingError !== Thing.ThingErrorNoError) {
|
if (thingError !== Thing.ThingErrorNoError) {
|
||||||
var errorDialog = Qt.createComponent(Qt.resolvedUrl("../components/ErrorDialog.qml"));
|
var errorDialog = Qt.createComponent(Qt.resolvedUrl("../components/ErrorDialog.qml"));
|
||||||
|
|||||||
@ -145,7 +145,7 @@ Item {
|
|||||||
onProgressChanged: requestPaint()
|
onProgressChanged: requestPaint()
|
||||||
Connections {
|
Connections {
|
||||||
target: buttonDelegate
|
target: buttonDelegate
|
||||||
onPressedChanged: {
|
function onPressedChanged() {
|
||||||
if (!buttonDelegate.pressed) {
|
if (!buttonDelegate.pressed) {
|
||||||
canvas.progress = 0;
|
canvas.progress = 0;
|
||||||
canvas.requestPaint()
|
canvas.requestPaint()
|
||||||
|
|||||||
@ -48,7 +48,7 @@ ChartView {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: meters
|
target: meters
|
||||||
onCountChanged: root.refresh()
|
function onCountChanged() { root.refresh(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
|||||||
@ -68,7 +68,7 @@ Item {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root.progressState
|
target: root.progressState
|
||||||
onValueChanged: {
|
function onValueChanged() {
|
||||||
canvas.requestPaint()
|
canvas.requestPaint()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -106,7 +106,7 @@ InfoPaneBase {
|
|||||||
}
|
}
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.thingManager
|
target: engine.thingManager
|
||||||
onExecuteActionReply: (commandId, thingError, displayMessage) => {
|
function onExecuteActionReply(commandId, thingError, displayMessage) {
|
||||||
if (commandId === childLockIcon.pendingAction) {
|
if (commandId === childLockIcon.pendingAction) {
|
||||||
childLockIcon.pendingAction = -1
|
childLockIcon.pendingAction = -1
|
||||||
}
|
}
|
||||||
|
|||||||
@ -775,7 +775,7 @@ WizardPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: nymeaDiscovery.nymeaHosts
|
target: nymeaDiscovery.nymeaHosts
|
||||||
onCountChanged: updateNextButton();
|
function onCountChanged() { updateNextButton(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateNextButton() {
|
function updateNextButton() {
|
||||||
|
|||||||
@ -41,16 +41,16 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.jsonRpcClient
|
target: engine.jsonRpcClient
|
||||||
onAuthenticationFailed: {
|
function onAuthenticationFailed() {
|
||||||
var popup = errorDialog.createObject(root)
|
var popup = errorDialog.createObject(root)
|
||||||
popup.text = qsTr("Sorry, that wasn't right. Try again please.")
|
popup.text = qsTr("Sorry, that wasn't right. Try again please.")
|
||||||
popup.open();
|
popup.open();
|
||||||
}
|
}
|
||||||
onCreateUserSucceeded: {
|
function onCreateUserSucceeded() {
|
||||||
engine.jsonRpcClient.authenticate(usernameTextField.text, passwordTextField.password, "nymea-app (" + PlatformHelper.deviceModel + ")");
|
engine.jsonRpcClient.authenticate(usernameTextField.text, passwordTextField.password, "nymea-app (" + PlatformHelper.deviceModel + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
onCreateUserFailed: {
|
function onCreateUserFailed(error) {
|
||||||
print("createUser failed")
|
print("createUser failed")
|
||||||
var message;
|
var message;
|
||||||
switch (error) {
|
switch (error) {
|
||||||
|
|||||||
@ -205,7 +205,7 @@ Item {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: selectionTabs
|
target: selectionTabs
|
||||||
onTabSelected: {
|
function onTabSelected(index) {
|
||||||
logsModel.clear()
|
logsModel.clear()
|
||||||
logsModel.fetchLogs()
|
logsModel.fetchLogs()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -46,11 +46,11 @@ Item {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: targetTemperatureState
|
target: targetTemperatureState
|
||||||
onValueChanged: canvas.requestPaint()
|
function onValueChanged() { canvas.requestPaint(); }
|
||||||
}
|
}
|
||||||
Connections {
|
Connections {
|
||||||
target: temperatureState
|
target: temperatureState
|
||||||
onValueChanged: canvas.requestPaint()
|
function onValueChanged() { canvas.requestPaint(); }
|
||||||
}
|
}
|
||||||
ActionQueue {
|
ActionQueue {
|
||||||
id: actionQueue
|
id: actionQueue
|
||||||
|
|||||||
@ -39,7 +39,7 @@ BigThingTile {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: itemDelegate
|
target: itemDelegate
|
||||||
onThingChanged: stateModel.update()
|
function onThingChanged() { stateModel.update(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
ListModel {
|
ListModel {
|
||||||
|
|||||||
@ -35,12 +35,12 @@ NymeaSwipeDelegate {
|
|||||||
iconName: thing && thing.thingClass ? app.interfacesToIcon(thing.thingClass.interfaces) : ""
|
iconName: thing && thing.thingClass ? app.interfacesToIcon(thing.thingClass.interfaces) : ""
|
||||||
text: thing ? thing.name : ""
|
text: thing ? thing.name : ""
|
||||||
progressive: true
|
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: {
|
tertiaryIconName: {
|
||||||
if (thing.setupStatus == Thing.ThingSetupStatusFailed) {
|
if (thing.setupStatus === Thing.ThingSetupStatusFailed) {
|
||||||
return "qrc:/icons/dialog-warning-symbolic.svg";
|
return "qrc:/icons/dialog-warning-symbolic.svg";
|
||||||
}
|
}
|
||||||
if (thing.setupStatus == Thing.ThingSetupStatusInProgress) {
|
if (thing.setupStatus === Thing.ThingSetupStatusInProgress) {
|
||||||
return "qrc:/icons/settings.svg"
|
return "qrc:/icons/settings.svg"
|
||||||
}
|
}
|
||||||
if (connectedState && connectedState.value === false) {
|
if (connectedState && connectedState.value === false) {
|
||||||
@ -53,10 +53,10 @@ NymeaSwipeDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tertiaryIconColor: {
|
tertiaryIconColor: {
|
||||||
if (thing.setupStatus == Thing.ThingSetupStatusFailed) {
|
if (thing.setupStatus === Thing.ThingSetupStatusFailed) {
|
||||||
return Style.red
|
return Style.red
|
||||||
}
|
}
|
||||||
if (thing.setupStatus == Thing.ThingSetupStatusInProgress) {
|
if (thing.setupStatus === Thing.ThingSetupStatusInProgress) {
|
||||||
return Style.iconColor
|
return Style.iconColor
|
||||||
}
|
}
|
||||||
if (connectedState && connectedState.value === false) {
|
if (connectedState && connectedState.value === false) {
|
||||||
|
|||||||
@ -46,7 +46,7 @@ ThingPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: logsModelNg
|
target: logsModelNg
|
||||||
onCountChanged: {
|
function onCountChanged() {
|
||||||
codeLabel.text = logsModelNg.get(0).value
|
codeLabel.text = logsModelNg.get(0).value
|
||||||
timestampLabel.text = Qt.formatDateTime(logsModelNg.get(0).timestamp)
|
timestampLabel.text = Qt.formatDateTime(logsModelNg.get(0).timestamp)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -125,7 +125,7 @@ ThingPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root.robotState
|
target: root.robotState
|
||||||
onValueChanged: robot.evaluateState()
|
function onValueChanged() { robot.evaluateState(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
function travel(toHome) {
|
function travel(toHome) {
|
||||||
@ -341,7 +341,7 @@ ThingPageBase {
|
|||||||
property BrowserItems boundaries: engine.thingManager.browseThing(root.thing.id, map.id)
|
property BrowserItems boundaries: engine.thingManager.browseThing(root.thing.id, map.id)
|
||||||
Connections {
|
Connections {
|
||||||
target: boundaries
|
target: boundaries
|
||||||
onCountChanged: {
|
function onCountChanged() {
|
||||||
canvas.requestPaint();
|
canvas.requestPaint();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,8 +62,8 @@ Page {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.thingManager
|
target: engine.thingManager
|
||||||
onExecuteBrowserItemReply: actionExecuted(commandId, thingError, displayMessage)
|
function onExecuteBrowserItemReply(commandId, thingError, displayMessage) { actionExecuted(commandId, thingError, displayMessage); }
|
||||||
onExecuteBrowserItemActionReply: actionExecuted(commandId, thingError, displayMessage)
|
function onExecuteBrowserItemActionReply(commandId, thingError, displayMessage) { actionExecuted(commandId, thingError, displayMessage); }
|
||||||
}
|
}
|
||||||
function actionExecuted(commandId, thingError, displayMessage) {
|
function actionExecuted(commandId, thingError, displayMessage) {
|
||||||
if (commandId === d.pendingBrowserItemId) {
|
if (commandId === d.pendingBrowserItemId) {
|
||||||
|
|||||||
@ -264,7 +264,7 @@ Page {
|
|||||||
}
|
}
|
||||||
Connections {
|
Connections {
|
||||||
target: root.thing
|
target: root.thing
|
||||||
onEventTriggered: {
|
function onEventTriggered(eventTypeId, params) {
|
||||||
if (eventTypeId === eventComponentItem.eventType.id) {
|
if (eventTypeId === eventComponentItem.eventType.id) {
|
||||||
flashlightAnimation.start();
|
flashlightAnimation.start();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,7 +67,7 @@ ThingPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root.thing
|
target: root.thing
|
||||||
onEventTriggered: {
|
function onEventTriggered(eventTypeId, params) {
|
||||||
print("evenEmitted", params)
|
print("evenEmitted", params)
|
||||||
if (eventTypeId == root.doorbellPressedType.id) {
|
if (eventTypeId == root.doorbellPressedType.id) {
|
||||||
ringAnimation.start();
|
ringAnimation.start();
|
||||||
|
|||||||
@ -184,7 +184,7 @@ ThingPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.thingManager
|
target: engine.thingManager
|
||||||
onExecuteActionReply: (commandId, thingError, displayMessage) => {
|
function onExecuteActionReply(commandId, thingError, displayMessage) {
|
||||||
addUserPage.error = thingError !== Thing.ThingErrorNoError
|
addUserPage.error = thingError !== Thing.ThingErrorNoError
|
||||||
var masks =[]
|
var masks =[]
|
||||||
masks.push({x: 0, y: 0, width: 1, height: 1});
|
masks.push({x: 0, y: 0, width: 1, height: 1});
|
||||||
|
|||||||
@ -121,7 +121,7 @@ ThingPageBase {
|
|||||||
}
|
}
|
||||||
Connections {
|
Connections {
|
||||||
target: flickable
|
target: flickable
|
||||||
onContentYChanged: if (swipe.completed) swipe.close()
|
function onContentYChanged() { if (swipe.completed) swipe.close(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
onPressAndHold: swipe.open(SwipeDelegate.Right)
|
onPressAndHold: swipe.open(SwipeDelegate.Right)
|
||||||
@ -352,14 +352,14 @@ ThingPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: stateDelegateLoader.item && stateDelegateLoader.item.hasOwnProperty("changed") ? stateDelegateLoader.item : null
|
target: stateDelegateLoader.item && stateDelegateLoader.item.hasOwnProperty("changed") ? stateDelegateLoader.item : null
|
||||||
onChanged: {
|
function onChanged(value) {
|
||||||
print("Value changed:", value)
|
print("Value changed:", value)
|
||||||
stateDelegate.enqueueSetValue(value)
|
stateDelegate.enqueueSetValue(value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.thingManager
|
target: engine.thingManager
|
||||||
onExecuteActionReply: (commandId, thingError, displayMessage) => {
|
function onExecuteActionReply(commandId, thingError, displayMessage) {
|
||||||
if (stateDelegate.pendingActionId === commandId) {
|
if (stateDelegate.pendingActionId === commandId) {
|
||||||
stateDelegate.pendingActionId = -1
|
stateDelegate.pendingActionId = -1
|
||||||
if (stateDelegate.valueCacheDirty) {
|
if (stateDelegate.valueCacheDirty) {
|
||||||
@ -384,7 +384,7 @@ ThingPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.thingManager
|
target: engine.thingManager
|
||||||
onExecuteActionReply: (commandId, thingError, displayMessage) => {
|
function onExecuteActionReply(commandId, thingError, displayMessage) {
|
||||||
if (commandId === actionDelegate.pendingActionId) {
|
if (commandId === actionDelegate.pendingActionId) {
|
||||||
pendingTimer.start();
|
pendingTimer.start();
|
||||||
actionDelegate.lastSuccess = thingError === Thing.ThingErrorNoError
|
actionDelegate.lastSuccess = thingError === Thing.ThingErrorNoError
|
||||||
@ -514,7 +514,7 @@ ThingPageBase {
|
|||||||
}
|
}
|
||||||
Connections {
|
Connections {
|
||||||
target: root.thing
|
target: root.thing
|
||||||
onEventTriggered: {
|
function onEventTriggered(eventTypeId, params) {
|
||||||
if (eventTypeId === eventComponentItem.eventType.id) {
|
if (eventTypeId === eventComponentItem.eventType.id) {
|
||||||
flashlightAnimation.start();
|
flashlightAnimation.start();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -103,7 +103,7 @@ ThingPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.ruleManager
|
target: engine.ruleManager
|
||||||
onAddRuleReply: {
|
function onAddRuleReply(commandId, ruleError, ruleId) {
|
||||||
if (commandId == d.pendingRuleCreationId) {
|
if (commandId == d.pendingRuleCreationId) {
|
||||||
d.pendingRuleCreationId = -1
|
d.pendingRuleCreationId = -1
|
||||||
if (ruleError != RuleManager.RuleErrorNoError) {
|
if (ruleError != RuleManager.RuleErrorNoError) {
|
||||||
@ -125,7 +125,7 @@ ThingPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root.powerState
|
target: root.powerState
|
||||||
onValueChanged: cleanupRules()
|
function onValueChanged() { cleanupRules(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
LogsModelNg {
|
LogsModelNg {
|
||||||
|
|||||||
@ -40,7 +40,7 @@ ThingPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.thingManager
|
target: engine.thingManager
|
||||||
onExecuteActionReply: (commandId, thingError, displayMessage) => {
|
function onExecuteActionReply(commandId, thingError, displayMessage) {
|
||||||
if (commandId === d.pendingAction) {
|
if (commandId === d.pendingAction) {
|
||||||
d.pendingAction = -1
|
d.pendingAction = -1
|
||||||
}
|
}
|
||||||
|
|||||||
@ -73,8 +73,8 @@ Page {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.thingManager.things
|
target: engine.thingManager.things
|
||||||
onThingRemoved:{
|
function onThingRemoved(thing) {
|
||||||
if (thing == root.thing) {
|
if (thing === root.thing) {
|
||||||
print("Thing destroyed")
|
print("Thing destroyed")
|
||||||
pageStack.pop()
|
pageStack.pop()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -113,7 +113,7 @@ Item {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.thingManager
|
target: engine.thingManager
|
||||||
onExecuteActionReply: (commandId, thingError, displayMessage) => {
|
function onExecuteActionReply(commandId, thingError, displayMessage) {
|
||||||
print("executeActionReply:", commandId)
|
print("executeActionReply:", commandId)
|
||||||
if (commandId === d.pendingCallId) {
|
if (commandId === d.pendingCallId) {
|
||||||
d.pendingCallId = -1;
|
d.pendingCallId = -1;
|
||||||
|
|||||||
@ -143,14 +143,14 @@ Page {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.scriptManager
|
target: engine.scriptManager
|
||||||
onAddScriptReply: {
|
function onAddScriptReply(id, status, scriptId, errors) {
|
||||||
print("Add reply", status)
|
print("Add reply", status)
|
||||||
deployReply(id, status, errors)
|
deployReply(id, status, errors)
|
||||||
if (status == ScriptManager.ScriptErrorNoError) {
|
if (status == ScriptManager.ScriptErrorNoError) {
|
||||||
d.scriptId = scriptId;
|
d.scriptId = scriptId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onEditScriptReply: {
|
function onEditScriptReply(id, status, errors) {
|
||||||
print("Edit reply", status)
|
print("Edit reply", status)
|
||||||
deployReply(id, status, errors)
|
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) {
|
if (id === d.callId && status === ScriptManager.ScriptErrorNoError) {
|
||||||
d.callId = -1;
|
d.callId = -1;
|
||||||
d.oldContent = content;
|
d.oldContent = content;
|
||||||
@ -183,13 +183,13 @@ Page {
|
|||||||
autoSaver.active = true;
|
autoSaver.active = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onRenameScriptReply: {
|
function onRenameScriptReply(id, status) {
|
||||||
if (id == d.callId) {
|
if (id == d.callId) {
|
||||||
d.callId = -1;
|
d.callId = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onScriptMessage: {
|
function onScriptMessage(scriptId, type, message) {
|
||||||
print("scriptMessage:", scriptId, d.scriptId)
|
print("scriptMessage:", scriptId, d.scriptId)
|
||||||
if (scriptId !== d.scriptId) {
|
if (scriptId !== d.scriptId) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -49,7 +49,7 @@ Page {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.scriptManager
|
target: engine.scriptManager
|
||||||
onRemoveScriptReply: {
|
function onRemoveScriptReply(id, status) {
|
||||||
if (id == d.pendingAction) {
|
if (id == d.pendingAction) {
|
||||||
d.pendingAction = -1;
|
d.pendingAction = -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -99,7 +99,7 @@ Page {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.ruleManager
|
target: engine.ruleManager
|
||||||
onAddRuleReply: {
|
function onAddRuleReply(commandId, ruleError, ruleId) {
|
||||||
if (ruleError == RuleManager.RuleErrorNoError) {
|
if (ruleError == RuleManager.RuleErrorNoError) {
|
||||||
pageStack.pop(root);
|
pageStack.pop(root);
|
||||||
} else {
|
} else {
|
||||||
@ -110,7 +110,7 @@ Page {
|
|||||||
d.editRulePage.busy = false;
|
d.editRulePage.busy = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
onEditRuleReply: {
|
function onEditRuleReply(commandId, ruleError) {
|
||||||
if (ruleError == RuleManager.RuleErrorNoError) {
|
if (ruleError == RuleManager.RuleErrorNoError) {
|
||||||
pageStack.pop(root);
|
pageStack.pop(root);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -48,7 +48,7 @@ Rectangle {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root.model
|
target: root.model
|
||||||
onCountChanged: {
|
function onCountChanged() {
|
||||||
d.hidden = false;
|
d.hidden = false;
|
||||||
d.currentIndex = 0;
|
d.currentIndex = 0;
|
||||||
if (root.model.count == 0) {
|
if (root.model.count == 0) {
|
||||||
|
|||||||
@ -83,7 +83,7 @@ Item {
|
|||||||
}
|
}
|
||||||
Connections {
|
Connections {
|
||||||
target: contentContainer.data[index]
|
target: contentContainer.data[index]
|
||||||
onRaise: {
|
function onRaise() {
|
||||||
panelTabs.currentIndex = index
|
panelTabs.currentIndex = index
|
||||||
d.autoWouldShow = true;
|
d.autoWouldShow = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -112,7 +112,7 @@ MainViewBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: acManager
|
target: acManager
|
||||||
onAddZoneReply: {
|
function onAddZoneReply(commandId, error, zoneId) {
|
||||||
if (commandId == noZonePlaceHolder.pendingAddCall) {
|
if (commandId == noZonePlaceHolder.pendingAddCall) {
|
||||||
print("zone added", zoneId)
|
print("zone added", zoneId)
|
||||||
var zone = acManager.zoneInfos.getZoneInfo(zoneId)
|
var zone = acManager.zoneInfos.getZoneInfo(zoneId)
|
||||||
|
|||||||
@ -43,7 +43,7 @@ Item {
|
|||||||
}
|
}
|
||||||
Connections {
|
Connections {
|
||||||
target: currentPowerState
|
target: currentPowerState
|
||||||
onValueChanged: {
|
function onValueChanged() {
|
||||||
if (currentPowerState.value >= 0) {
|
if (currentPowerState.value >= 0) {
|
||||||
consumerSlice.value = currentPowerState.value
|
consumerSlice.value = currentPowerState.value
|
||||||
producerSlice.value = 0
|
producerSlice.value = 0
|
||||||
|
|||||||
@ -207,7 +207,7 @@ MainViewBase {
|
|||||||
property int pendingCommand: -1
|
property int pendingCommand: -1
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.tagsManager
|
target: engine.tagsManager
|
||||||
onAddTagReply: {
|
function onAddTagReply(commandId, error) {
|
||||||
if (commandId == dropArea.pendingCommand) {
|
if (commandId == dropArea.pendingCommand) {
|
||||||
dropArea.pendingCommand = -1
|
dropArea.pendingCommand = -1
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,7 +67,7 @@ MainViewBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.tagsManager.tags
|
target: engine.tagsManager.tags
|
||||||
onCountChanged: {
|
function onCountChanged() {
|
||||||
colorTag = engine.tagsManager.tags.findRuleTag(model.id, "color")
|
colorTag = engine.tagsManager.tags.findRuleTag(model.id, "color")
|
||||||
iconTag = engine.tagsManager.tags.findRuleTag(model.id, "icon")
|
iconTag = engine.tagsManager.tags.findRuleTag(model.id, "icon")
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,7 +58,7 @@ SettingsPageBase {
|
|||||||
Connections {
|
Connections {
|
||||||
target: acManager
|
target: acManager
|
||||||
|
|
||||||
onAddZoneReply: {
|
function onAddZoneReply(commandId, error, zoneId) {
|
||||||
if (commandId == pendingAddCall) {
|
if (commandId == pendingAddCall) {
|
||||||
print("zone added", zoneId)
|
print("zone added", zoneId)
|
||||||
var zone = acManager.zoneInfos.getZoneInfo(zoneId)
|
var zone = acManager.zoneInfos.getZoneInfo(zoneId)
|
||||||
|
|||||||
@ -48,13 +48,13 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: acManager
|
target: acManager
|
||||||
onSetZoneNameReply: {
|
function onSetZoneNameReply(commandId, error) {
|
||||||
if (commandId == d.pendingCommandId) {
|
if (commandId == d.pendingCommandId) {
|
||||||
d.pendingCommandId = -1
|
d.pendingCommandId = -1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onRemoveZoneReply: {
|
function onRemoveZoneReply(commandId, error) {
|
||||||
if (commandId == d.pendingCommandId) {
|
if (commandId == d.pendingCommandId) {
|
||||||
d.pendingCommandId = -1
|
d.pendingCommandId = -1
|
||||||
pageStack.pop()
|
pageStack.pop()
|
||||||
|
|||||||
@ -51,7 +51,7 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: acManager
|
target: acManager
|
||||||
onSetZoneNameReply: {
|
function onSetZoneNameReply(commandId, error) {
|
||||||
if (commandId == d.pendingCommandId) {
|
if (commandId == d.pendingCommandId) {
|
||||||
d.pendingCommandId = -1
|
d.pendingCommandId = -1
|
||||||
}
|
}
|
||||||
@ -276,7 +276,7 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: acManager
|
target: acManager
|
||||||
onSetZoneThingsReply: {
|
function onSetZoneThingsReply(commandId, error) {
|
||||||
if (commandId == d.pendingCommandId) {
|
if (commandId == d.pendingCommandId) {
|
||||||
d.pendingCommandId = -1
|
d.pendingCommandId = -1
|
||||||
}
|
}
|
||||||
|
|||||||
@ -144,7 +144,7 @@ MainViewBase {
|
|||||||
}
|
}
|
||||||
Connections {
|
Connections {
|
||||||
target: loader.item
|
target: loader.item
|
||||||
onOpenDialog: {
|
function onOpenDialog(dialogComponent) {
|
||||||
dialogComponent.createObject(root).open()
|
dialogComponent.createObject(root).open()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -375,7 +375,7 @@ NymeaDialog {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: okButton
|
target: okButton
|
||||||
onClicked: {
|
function onClicked() {
|
||||||
root.dashboardModel.addFolderItem(folderNameTextField.text, iconsGrid.currentIcon, root.index)
|
root.dashboardModel.addFolderItem(folderNameTextField.text, iconsGrid.currentIcon, root.index)
|
||||||
root.close();
|
root.close();
|
||||||
}
|
}
|
||||||
@ -558,7 +558,7 @@ NymeaDialog {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: okButton
|
target: okButton
|
||||||
onClicked: {
|
function onClicked() {
|
||||||
root.dashboardModel.addWebViewItem(urlTextField.text, columnsTabs.currentValue, rowsTabs.currentValue, interactiveSwitch.checked, root.index)
|
root.dashboardModel.addWebViewItem(urlTextField.text, columnsTabs.currentValue, rowsTabs.currentValue, interactiveSwitch.checked, root.index)
|
||||||
root.close();
|
root.close();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -54,7 +54,7 @@ DashboardDelegateBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.tagsManager.tags
|
target: engine.tagsManager.tags
|
||||||
onCountChanged: {
|
function onCountChanged() {
|
||||||
colorTag = engine.tagsManager.tags.findRuleTag(root.item.ruleId, "color")
|
colorTag = engine.tagsManager.tags.findRuleTag(root.item.ruleId, "color")
|
||||||
iconTag = engine.tagsManager.tags.findRuleTag(root.item.ruleId, "icon")
|
iconTag = engine.tagsManager.tags.findRuleTag(root.item.ruleId, "icon")
|
||||||
}
|
}
|
||||||
|
|||||||
@ -121,7 +121,7 @@ StatsBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: d
|
target: d
|
||||||
onStartOffsetChanged: refresh()
|
function onStartOffsetChanged() { refresh(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
function refreshLabels() {
|
function refreshLabels() {
|
||||||
|
|||||||
@ -137,7 +137,7 @@ Item {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.tagsManager
|
target: engine.tagsManager
|
||||||
onBusyChanged: d.update()
|
function onBusyChanged() { d.update(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
|
|||||||
@ -46,7 +46,7 @@ Item {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.thingManager
|
target: engine.thingManager
|
||||||
onFetchingDataChanged: {
|
function onFetchingDataChanged() {
|
||||||
if (!engine.thingManager.fetchingData) {
|
if (!engine.thingManager.fetchingData) {
|
||||||
updateConsumers()
|
updateConsumers()
|
||||||
}
|
}
|
||||||
@ -55,7 +55,7 @@ Item {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root.consumers
|
target: root.consumers
|
||||||
onCountChanged: {
|
function onCountChanged() {
|
||||||
if (!engine.thingManager.fetchingData) {
|
if (!engine.thingManager.fetchingData) {
|
||||||
updateConsumers()
|
updateConsumers()
|
||||||
}
|
}
|
||||||
@ -64,7 +64,7 @@ Item {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: energyManager
|
target: energyManager
|
||||||
onPowerBalanceChanged: {
|
function onPowerBalanceChanged() {
|
||||||
var consumersSummation = 0
|
var consumersSummation = 0
|
||||||
for (var i = 0; i < consumers.count; i++) {
|
for (var i = 0; i < consumers.count; i++) {
|
||||||
consumersSummation += consumers.get(i).stateByName("currentPower").value
|
consumersSummation += consumers.get(i).stateByName("currentPower").value
|
||||||
|
|||||||
@ -105,7 +105,7 @@ Item {
|
|||||||
Connections {
|
Connections {
|
||||||
target: powerBalanceLogs
|
target: powerBalanceLogs
|
||||||
|
|
||||||
onEntriesAddedIdx: (index, count) => {
|
function onEntriesAddedIdx(index, count) {
|
||||||
// print("entries added", index, count)
|
// print("entries added", index, count)
|
||||||
selfProductionConsumptionSeries.upperSeries = null
|
selfProductionConsumptionSeries.upperSeries = null
|
||||||
selfProductionConsumptionSeries.lowerSeries = null
|
selfProductionConsumptionSeries.lowerSeries = null
|
||||||
@ -147,7 +147,7 @@ Item {
|
|||||||
acquisitionSeries.lowerSeries = fromStorageUpperSeries
|
acquisitionSeries.lowerSeries = fromStorageUpperSeries
|
||||||
}
|
}
|
||||||
|
|
||||||
onEntriesRemoved: (index, count) => {
|
function onEntriesRemoved(index, count) {
|
||||||
// Note QtCharts crash when calling removePoints() for points that don't exist.
|
// 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
|
// 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
|
// 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
|
||||||
|
|||||||
@ -185,7 +185,7 @@ StatsBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: energyManager
|
target: energyManager
|
||||||
onPowerBalanceChanged: {
|
function onPowerBalanceChanged() {
|
||||||
// print("updating because of power balance change. fetchingData", powerBalanceLogs.fetchingData, "fetchPending", d.fetchPending)
|
// print("updating because of power balance change. fetchingData", powerBalanceLogs.fetchingData, "fetchPending", d.fetchPending)
|
||||||
d.refresh();
|
d.refresh();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -92,7 +92,7 @@ Item {
|
|||||||
Connections {
|
Connections {
|
||||||
target: powerBalanceLogs
|
target: powerBalanceLogs
|
||||||
|
|
||||||
onEntriesAdded: {
|
function onEntriesAdded(index, entries) {
|
||||||
// print("entries added", index, entries.length)
|
// print("entries added", index, entries.length)
|
||||||
for (var i = 0; i < entries.length; i++) {
|
for (var i = 0; i < entries.length; i++) {
|
||||||
var entry = entries[i]
|
var entry = entries[i]
|
||||||
@ -110,7 +110,7 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onEntriesRemoved: (index, count) => {
|
function onEntriesRemoved(index, count) {
|
||||||
acquisitionUpperSeries.removePoints(index, count)
|
acquisitionUpperSeries.removePoints(index, count)
|
||||||
storageUpperSeries.removePoints(index, count)
|
storageUpperSeries.removePoints(index, count)
|
||||||
selfProductionUpperSeries.removePoints(index, count)
|
selfProductionUpperSeries.removePoints(index, count)
|
||||||
|
|||||||
@ -93,7 +93,7 @@ Item {
|
|||||||
Connections {
|
Connections {
|
||||||
target: powerBalanceLogs
|
target: powerBalanceLogs
|
||||||
|
|
||||||
onEntriesAdded: {
|
function onEntriesAdded(index, entries) {
|
||||||
// print("entries added", index, entries.length)
|
// print("entries added", index, entries.length)
|
||||||
for (var i = 0; i < entries.length; i++) {
|
for (var i = 0; i < entries.length; i++) {
|
||||||
var entry = entries[i]
|
var entry = entries[i]
|
||||||
@ -111,7 +111,7 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onEntriesRemoved: (index, count) => {
|
function onEntriesRemoved(index, count) {
|
||||||
acquisitionUpperSeries.removePoints(index, count)
|
acquisitionUpperSeries.removePoints(index, count)
|
||||||
storageUpperSeries.removePoints(index, count)
|
storageUpperSeries.removePoints(index, count)
|
||||||
selfConsumptionUpperSeries.removePoints(index, count)
|
selfConsumptionUpperSeries.removePoints(index, count)
|
||||||
|
|||||||
@ -38,7 +38,7 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.jsonRpcClient
|
target: engine.jsonRpcClient
|
||||||
onCloudConnectionStateChanged: {
|
function onCloudConnectionStateChanged() {
|
||||||
print("cloud connection state changed", engine.jsonRpcClient.cloudConnectionState)
|
print("cloud connection state changed", engine.jsonRpcClient.cloudConnectionState)
|
||||||
if (engine.jsonRpcClient.cloudConnectionState === JsonRpcClient.CloudConnectionStateConnected) {
|
if (engine.jsonRpcClient.cloudConnectionState === JsonRpcClient.CloudConnectionStateConnected) {
|
||||||
d.deploymentStarted = false;
|
d.deploymentStarted = false;
|
||||||
|
|||||||
@ -182,7 +182,7 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: evDashManager
|
target: evDashManager
|
||||||
onAddUserReply: (commandId, error) => {
|
function onAddUserReply(commandId, error) {
|
||||||
if (error === EvDashManager.EvDashErrorNoError)
|
if (error === EvDashManager.EvDashErrorNoError)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -203,7 +203,7 @@ SettingsPageBase {
|
|||||||
popup.open()
|
popup.open()
|
||||||
}
|
}
|
||||||
|
|
||||||
onRemoveUserReply: (commandId, error) => {
|
function onRemoveUserReply(commandId, error) {
|
||||||
if (error === EvDashManager.EvDashErrorNoError)
|
if (error === EvDashManager.EvDashErrorNoError)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@ -42,9 +42,9 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.systemController
|
target: engine.systemController
|
||||||
onRestartReply: handleReply(id, success)
|
function onRestartReply(id, success) { handleReply(id, success); }
|
||||||
onRebootReply: handleReply(id, success)
|
function onRebootReply(id, success) { handleReply(id, success); }
|
||||||
onShutdownReply: handleReply(id, success)
|
function onShutdownReply(id, success) { handleReply(id, success); }
|
||||||
|
|
||||||
function handleReply(id, success) {
|
function handleReply(id, success) {
|
||||||
if (id === d.pendingCommand) {
|
if (id === d.pendingCommand) {
|
||||||
|
|||||||
@ -95,7 +95,7 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root.modbusRtuManager
|
target: root.modbusRtuManager
|
||||||
onAddModbusRtuMasterReply: {
|
function onAddModbusRtuMasterReply(commandId, error, modbusUuid) {
|
||||||
if (commandId === d.pendingCommandId) {
|
if (commandId === d.pendingCommandId) {
|
||||||
d.pendingCommandId = -1
|
d.pendingCommandId = -1
|
||||||
if (modbusRtuManager.handleModbusError(error)) {
|
if (modbusRtuManager.handleModbusError(error)) {
|
||||||
|
|||||||
@ -102,7 +102,7 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root.modbusRtuManager
|
target: root.modbusRtuManager
|
||||||
onReconfigureModbusRtuMasterReply: {
|
function onReconfigureModbusRtuMasterReply(commandId, error) {
|
||||||
if (commandId === d.pendingCommandId) {
|
if (commandId === d.pendingCommandId) {
|
||||||
d.pendingCommandId = -1
|
d.pendingCommandId = -1
|
||||||
if (modbusRtuManager.handleModbusError(error)) {
|
if (modbusRtuManager.handleModbusError(error)) {
|
||||||
|
|||||||
@ -274,7 +274,7 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root.modbusRtuManager
|
target: root.modbusRtuManager
|
||||||
onRemoveModbusRtuMasterReply: {
|
function onRemoveModbusRtuMasterReply(commandId, error) {
|
||||||
if (commandId === d.pendingCommandId) {
|
if (commandId === d.pendingCommandId) {
|
||||||
d.pendingCommandId = -1
|
d.pendingCommandId = -1
|
||||||
if (modbusRtuManager.handleModbusError(error)) {
|
if (modbusRtuManager.handleModbusError(error)) {
|
||||||
|
|||||||
@ -50,7 +50,7 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.thingManager
|
target: engine.thingManager
|
||||||
onSavePluginConfigReply: {
|
function onSavePluginConfigReply(commandId, thingError) {
|
||||||
if (thingError === Thing.ThingErrorNoError) {
|
if (thingError === Thing.ThingErrorNoError) {
|
||||||
pageStack.pop();
|
pageStack.pop();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -49,7 +49,7 @@ Page {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.systemController
|
target: engine.systemController
|
||||||
onEnableRepositoryFinished: (id, success) => {
|
function onEnableRepositoryFinished(id, success) {
|
||||||
if (!success) {
|
if (!success) {
|
||||||
var popup = errorDialogComponent.createObject(app, {errorCode: qsTr("Failure adding repository.") })
|
var popup = errorDialogComponent.createObject(app, {errorCode: qsTr("Failure adding repository.") })
|
||||||
popup.open();
|
popup.open();
|
||||||
|
|||||||
@ -174,7 +174,7 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: userManager
|
target: userManager
|
||||||
onSetUserInfoReply: (id, error) => {
|
function onSetUserInfoReply(id, error) {
|
||||||
editUserInfoPage.busy = false
|
editUserInfoPage.busy = false
|
||||||
if (error !== UserManager.UserErrorNoError) {
|
if (error !== UserManager.UserErrorNoError) {
|
||||||
var component = Qt.createComponent("../components/ErrorDialog.qml")
|
var component = Qt.createComponent("../components/ErrorDialog.qml")
|
||||||
@ -513,7 +513,7 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: userManager
|
target: userManager
|
||||||
onRemoveUserReply: (id, error) => {
|
function onRemoveUserReply(id, error) {
|
||||||
userDetailsPage.busy = false
|
userDetailsPage.busy = false
|
||||||
if (error !== UserManager.UserErrorNoError) {
|
if (error !== UserManager.UserErrorNoError) {
|
||||||
var component = Qt.createComponent("../components/ErrorDialog.qml")
|
var component = Qt.createComponent("../components/ErrorDialog.qml")
|
||||||
@ -646,7 +646,7 @@ SettingsPageBase {
|
|||||||
}
|
}
|
||||||
Connections {
|
Connections {
|
||||||
target: userManager
|
target: userManager
|
||||||
onCreateUserReply: (id, error) => {
|
function onCreateUserReply(id, error) {
|
||||||
createUserPage.busy = false
|
createUserPage.busy = false
|
||||||
if (error !== UserManager.UserErrorNoError) {
|
if (error !== UserManager.UserErrorNoError) {
|
||||||
var component = Qt.createComponent("../components/ErrorDialog.qml")
|
var component = Qt.createComponent("../components/ErrorDialog.qml")
|
||||||
|
|||||||
@ -146,7 +146,7 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root.zigbeeManager
|
target: root.zigbeeManager
|
||||||
onAddNetworkReply: {
|
function onAddNetworkReply(commandId, error, networkUuid) {
|
||||||
if (commandId == d.pendingCommandId) {
|
if (commandId == d.pendingCommandId) {
|
||||||
d.pendingCommandId = -1
|
d.pendingCommandId = -1
|
||||||
var props = {};
|
var props = {};
|
||||||
|
|||||||
@ -75,7 +75,7 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root.zigbeeManager
|
target: root.zigbeeManager
|
||||||
onRemoveNodeReply: {
|
function onRemoveNodeReply(commandId, error) {
|
||||||
if (commandId == d.pendingCommandId) {
|
if (commandId == d.pendingCommandId) {
|
||||||
d.pendingCommandId = -1
|
d.pendingCommandId = -1
|
||||||
var props = {};
|
var props = {};
|
||||||
@ -331,7 +331,7 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: node
|
target: node
|
||||||
onLastSeenChanged: communicationIndicatorLedTimer.start()
|
function onLastSeenChanged(lastSeen) { communicationIndicatorLedTimer.start(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
|
|||||||
@ -39,7 +39,7 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: zigbeeManager
|
target: zigbeeManager
|
||||||
onFactoryResetNetworkReply: {
|
function onFactoryResetNetworkReply(commandId, error) {
|
||||||
busy = false;
|
busy = false;
|
||||||
// if (error != ZigbeeManager.ZigbeeErrorNoError) {
|
// if (error != ZigbeeManager.ZigbeeErrorNoError) {
|
||||||
// }
|
// }
|
||||||
|
|||||||
@ -72,7 +72,7 @@ Page {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root.network.nodes
|
target: root.network.nodes
|
||||||
onNodeAdded: {
|
function onNodeAdded(node) {
|
||||||
root.reload()
|
root.reload()
|
||||||
node.neighborsChanged.connect(root.reloadDelayed);
|
node.neighborsChanged.connect(root.reloadDelayed);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -77,7 +77,7 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root.zigbeeManager
|
target: root.zigbeeManager
|
||||||
onCreateBindingReply: {
|
function onCreateBindingReply(commandId, error) {
|
||||||
print("**** create binding reply", error)
|
print("**** create binding reply", error)
|
||||||
if (commandId == d.pendingCommandId) {
|
if (commandId == d.pendingCommandId) {
|
||||||
d.pendingCommandId = -1
|
d.pendingCommandId = -1
|
||||||
@ -99,7 +99,7 @@ SettingsPageBase {
|
|||||||
popup.open();
|
popup.open();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onRemoveBindingReply: {
|
function onRemoveBindingReply(commandId, error) {
|
||||||
if (commandId == d.pendingCommandId) {
|
if (commandId == d.pendingCommandId) {
|
||||||
d.pendingCommandId = -1
|
d.pendingCommandId = -1
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ SettingsPageBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onRemoveNodeReply: {
|
function onRemoveNodeReply(commandId, error) {
|
||||||
if (commandId == d.pendingCommandId) {
|
if (commandId == d.pendingCommandId) {
|
||||||
var props = {};
|
var props = {};
|
||||||
switch (error) {
|
switch (error) {
|
||||||
|
|||||||
@ -45,7 +45,7 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root.zwaveManager
|
target: root.zwaveManager
|
||||||
onAddNetworkReply: {
|
function onAddNetworkReply(commandId, error, networkUuid) {
|
||||||
if (commandId == d.pendingCallId) {
|
if (commandId == d.pendingCallId) {
|
||||||
d.pendingCallId = -1
|
d.pendingCallId = -1
|
||||||
var props = {};
|
var props = {};
|
||||||
|
|||||||
@ -76,19 +76,19 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root.zwaveManager
|
target: root.zwaveManager
|
||||||
onAddNodeReply: {
|
function onAddNodeReply(commandId, error) {
|
||||||
if (commandId == d.pendingCommandId) {
|
if (commandId == d.pendingCommandId) {
|
||||||
d.pendingCommandId = -1
|
d.pendingCommandId = -1
|
||||||
processStatusCode(error)
|
processStatusCode(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onRemoveNodeReply: {
|
function onRemoveNodeReply(commandId, error) {
|
||||||
if (commandId == d.pendingCommandId) {
|
if (commandId == d.pendingCommandId) {
|
||||||
d.pendingCommandId = -1
|
d.pendingCommandId = -1
|
||||||
processStatusCode(error)
|
processStatusCode(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onRemoveFailedNodeReply: {
|
function onRemoveFailedNodeReply(commandId, error) {
|
||||||
if (commandId == d.pendingCommandId) {
|
if (commandId == d.pendingCommandId) {
|
||||||
d.pendingCommandId = -1
|
d.pendingCommandId = -1
|
||||||
processStatusCode(error)
|
processStatusCode(error)
|
||||||
@ -117,7 +117,7 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root.network
|
target: root.network
|
||||||
onWaitingForNodeAdditionChanged: {
|
function onWaitingForNodeAdditionChanged() {
|
||||||
if (root.network.waitingForNodeAddition) {
|
if (root.network.waitingForNodeAddition) {
|
||||||
var props = {
|
var props = {
|
||||||
title: qsTr("Include Z-Wave device"),
|
title: qsTr("Include Z-Wave device"),
|
||||||
@ -131,7 +131,7 @@ SettingsPageBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onWaitingForNodeRemovalChanged: {
|
function onWaitingForNodeRemovalChanged() {
|
||||||
if (root.network.waitingForNodeRemoval) {
|
if (root.network.waitingForNodeRemoval) {
|
||||||
var props = {
|
var props = {
|
||||||
title: qsTr("Exclude Z-Wave device"),
|
title: qsTr("Exclude Z-Wave device"),
|
||||||
|
|||||||
@ -54,7 +54,7 @@ SettingsPageBase {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root.zwaveManager
|
target: root.zwaveManager
|
||||||
onRemoveNetworkReply: {
|
function onRemoveNetworkReply(commandId, error) {
|
||||||
if (commandId === d.pendingCommandId) {
|
if (commandId === d.pendingCommandId) {
|
||||||
d.pendingCommandId = -1;
|
d.pendingCommandId = -1;
|
||||||
if (!processError(error)) {
|
if (!processError(error)) {
|
||||||
@ -63,7 +63,7 @@ SettingsPageBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onFactoryResetNetworkReply: {
|
function onFactoryResetNetworkReply(commandId, error) {
|
||||||
if (commandId === d.pendingCommandId) {
|
if (commandId === d.pendingCommandId) {
|
||||||
d.pendingCommandId = -1;
|
d.pendingCommandId = -1;
|
||||||
if (!processError(error)) {
|
if (!processError(error)) {
|
||||||
@ -71,7 +71,7 @@ SettingsPageBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onSoftResetControllerReply: {
|
function onSoftResetControllerReply(commandId, error) {
|
||||||
if (commandId === d.pendingCommandId) {
|
if (commandId === d.pendingCommandId) {
|
||||||
d.pendingCommandId = -1;
|
d.pendingCommandId = -1;
|
||||||
processError(error)
|
processError(error)
|
||||||
|
|||||||
@ -56,8 +56,8 @@ Page {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: engine.thingManager
|
target: engine.thingManager
|
||||||
onRemoveThingReply: {
|
function onRemoveThingReply(commandId, thingError, ruleIds) {
|
||||||
if (commandId != d.pendingCommandId) {
|
if (commandId !== d.pendingCommandId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ Page {
|
|||||||
property Thing thing: null
|
property Thing thing: null
|
||||||
|
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
d.pendingCommand = engine.thingManager.removeThing(thing.id)
|
d.pendingCommandId = engine.thingManager.removeThing(thing.id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -175,7 +175,7 @@ Page {
|
|||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: parent.width - Style.margins * 2
|
width: parent.width - Style.margins * 2
|
||||||
opacity: packagesFilterModel.count > 0 &&
|
opacity: packagesFilterModel.count > 0 &&
|
||||||
(thingClassesProxy.count == 0 || listView.contentY >= listView.contentHeight + listView.originY)
|
(thingClassesProxy.count === 0 || listView.contentY >= listView.contentHeight + listView.originY)
|
||||||
? 1 : 0
|
? 1 : 0
|
||||||
Behavior on opacity { NumberAnimation { duration: Style.shortAnimationDuration } }
|
Behavior on opacity { NumberAnimation { duration: Style.shortAnimationDuration } }
|
||||||
visible: opacity > 0
|
visible: opacity > 0
|
||||||
|
|||||||
@ -97,7 +97,6 @@ Page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
busyOverlay.shown = true;
|
busyOverlay.shown = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -68,7 +68,7 @@ Item {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root.thing
|
target: root.thing
|
||||||
onExecuteActionReply: (commandId, thingError, displayMessage) => {
|
function onExecuteActionReply(commandId, thingError, displayMessage) {
|
||||||
if (d.pendingCommand === commandId) {
|
if (d.pendingCommand === commandId) {
|
||||||
// print("command finished")
|
// print("command finished")
|
||||||
d.pendingCommand = -1;
|
d.pendingCommand = -1;
|
||||||
|
|||||||
@ -1,2 +1,2 @@
|
|||||||
1.11.7
|
1.11.7
|
||||||
713
|
714
|
||||||
|
|||||||
Reference in New Issue
Block a user