diff --git a/libnymea-app/zwave/zwavemanager.cpp b/libnymea-app/zwave/zwavemanager.cpp index fee8084c..6a361a59 100644 --- a/libnymea-app/zwave/zwavemanager.cpp +++ b/libnymea-app/zwave/zwavemanager.cpp @@ -78,10 +78,10 @@ int ZWaveManager::removeNetwork(const QUuid &networkUuid) return m_engine->jsonRpcClient()->sendCommand("ZWave.RemoveNetwork", params, this, "removeNetworkResponse"); } -void ZWaveManager::addNode(const QUuid &networkUuid) +int ZWaveManager::addNode(const QUuid &networkUuid) { QVariantMap params = {{"networkUuid", networkUuid}}; - m_engine->jsonRpcClient()->sendCommand("ZWave.AddNode", params, this, "addNodeResponse"); + return m_engine->jsonRpcClient()->sendCommand("ZWave.AddNode", params, this, "addNodeResponse"); } void ZWaveManager::cancelPendingOperation(const QUuid &networkUuid) diff --git a/libnymea-app/zwave/zwavemanager.h b/libnymea-app/zwave/zwavemanager.h index cef886ab..295348f4 100644 --- a/libnymea-app/zwave/zwavemanager.h +++ b/libnymea-app/zwave/zwavemanager.h @@ -76,7 +76,7 @@ public: Q_INVOKABLE int addNetwork(const QString &serialPort); Q_INVOKABLE int removeNetwork(const QUuid &networkUuid); - Q_INVOKABLE void addNode(const QUuid &networkUuid); + Q_INVOKABLE int addNode(const QUuid &networkUuid); Q_INVOKABLE void cancelPendingOperation(const QUuid &networkUuid); Q_INVOKABLE int factoryResetNetwork(const QUuid &networkUuid); // Q_INVOKABLE void getNodes(const QUuid &networkUuid); diff --git a/nymea-app/ui/system/zwave/ZWaveNetworkSettingsPage.qml b/nymea-app/ui/system/zwave/ZWaveNetworkSettingsPage.qml index 8c6bd8ca..2f67bcd1 100644 --- a/nymea-app/ui/system/zwave/ZWaveNetworkSettingsPage.qml +++ b/nymea-app/ui/system/zwave/ZWaveNetworkSettingsPage.qml @@ -165,11 +165,11 @@ SettingsPageBase { Layout.rightMargin: app.margins text: qsTr("Remove network") onClicked: { - var dialog = Qt.createComponent(Qt.resolvedUrl("../components/MeaDialog.qml")); + var dialog = Qt.createComponent(Qt.resolvedUrl("/ui/components/MeaDialog.qml")); var text = qsTr("Are you sure you want to remove the network and all associated devices from the system?") var popup = dialog.createObject(app, { - headerIcon: "../images/dialog-warning-symbolic.svg", + headerIcon: "/ui/images/dialog-warning-symbolic.svg", title: qsTr("Remove network"), text: text, standardButtons: Dialog.Ok | Dialog.Cancel @@ -187,11 +187,11 @@ SettingsPageBase { Layout.rightMargin: app.margins text: qsTr("Factory reset controller") onClicked: { - var dialog = Qt.createComponent(Qt.resolvedUrl("../components/MeaDialog.qml")); + var dialog = Qt.createComponent(Qt.resolvedUrl("/ui/components/MeaDialog.qml")); var text = qsTr("Are you sure you want to factory reset the controller? This will recreate the network and remove all associated devices from the system.") var popup = dialog.createObject(app, { - headerIcon: "../images/dialog-warning-symbolic.svg", + headerIcon: "/ui/images/dialog-warning-symbolic.svg", title: qsTr("Reset controller"), text: text, standardButtons: Dialog.Ok | Dialog.Cancel diff --git a/nymea-app/ui/system/zwave/ZWaveSettingsPage.qml b/nymea-app/ui/system/zwave/ZWaveSettingsPage.qml index 1d3ac3ea..53643822 100644 --- a/nymea-app/ui/system/zwave/ZWaveSettingsPage.qml +++ b/nymea-app/ui/system/zwave/ZWaveSettingsPage.qml @@ -65,7 +65,7 @@ SettingsPageBase { Item { Layout.fillWidth: true Layout.preferredHeight: root.height - root.header.height - Style.margins - visible: !zwaveManager.fetchingData || !zwaveManager.zwaveAvailable || zwaveManager.networks.count == 0 + visible: !zwaveManager.fetchingData && (!zwaveManager.zwaveAvailable || zwaveManager.networks.count == 0) BusyIndicator { anchors.centerIn: parent