diff --git a/nymea-app/nymea-app.pro b/nymea-app/nymea-app.pro index 252413f0..ed343a79 100644 --- a/nymea-app/nymea-app.pro +++ b/nymea-app/nymea-app.pro @@ -14,12 +14,14 @@ win32:Release:LIBS += -L$$top_builddir/libnymea-app-core/release \ -L$$top_builddir/libnymea-common/release linux:!android:LIBS += -lavahi-client -lavahi-common PRE_TARGETDEPS += ../libnymea-app-core ../libnymea-common + HEADERS += \ stylecontroller.h SOURCES += main.cpp \ stylecontroller.cpp +OTHER_FILES += $$files(*.qml, true) RESOURCES += resources.qrc equals(STYLES_PATH, "") { diff --git a/nymea-app/ui/MainPage.qml b/nymea-app/ui/MainPage.qml index a8eb227d..bb56ae2c 100644 --- a/nymea-app/ui/MainPage.qml +++ b/nymea-app/ui/MainPage.qml @@ -78,17 +78,21 @@ Page { id: swipeView clip: true anchors.fill: parent - currentIndex: settings.currentMainViewIndex - onCurrentIndexChanged: settings.currentMainViewIndex = currentIndex opacity: Engine.deviceManager.fetchingData ? 0 : 1 Behavior on opacity { NumberAnimation { duration: 300 } } + onCurrentIndexChanged: { + settings.currentMainViewIndex = currentIndex + } + Component.onCompleted: { if (Engine.jsonRpcClient.ensureServerVersion(1.6)) { swipeView.insertItem(0, favoritesViewComponent.createObject(swipeView)) - } else if (settings.currentMainViewIndex === 2) { - settings.currentMainViewIndex = 0; } + if (settings.currentMainViewIndex > swipeView.count) { + settings.currentMainViewIndex = swipeView.count - 1; + } + swipeView.currentIndex = Qt.binding(function() { return settings.currentMainViewIndex; }) } Component { diff --git a/nymea-app/ui/magic/EditRulePage.qml b/nymea-app/ui/magic/EditRulePage.qml index 0033ad9c..1e698e8a 100644 --- a/nymea-app/ui/magic/EditRulePage.qml +++ b/nymea-app/ui/magic/EditRulePage.qml @@ -737,7 +737,7 @@ Page { model: ListModel { ListElement { iconName: "../images/action.svg" - text: qsTr("Execute an action on of my things") + text: qsTr("Execute an action on one of my things") method: "addRuleAction" isExitAction: false minimumJsonRpcVersion: "1.0" @@ -751,7 +751,7 @@ Page { } ListElement { iconName: "../images/action.svg" - text: qsTr("Execute an action on of my things") + text: qsTr("Execute an action on one of my things") method: "addRuleExitAction" isExitAction: true minimumJsonRpcVersion: "1.0"