Merge PR #633: Disable main view configuration with branding

This commit is contained in:
Jenkins nymea 2021-08-10 23:18:07 +02:00
commit 5782bb3fc9
2 changed files with 13 additions and 4 deletions

View File

@ -161,7 +161,8 @@ Drawer {
text: qsTr("Configure main view")
iconName: "../images/configure.svg"
progressive: false
visible: root.currentEngine && root.currentEngine.jsonRpcClient.currentHost
visible: root.currentEngine && root.currentEngine.jsonRpcClient.currentHost &&
!Configuration.hasOwnProperty("mainViewsFilter")
onClicked: {
root.configureMainView();
root.close();

View File

@ -44,7 +44,14 @@ Page {
id: root
function configureViews() {
if (Configuration.hasOwnProperty("mainViewsFilter")) {
console.warn("Main views configuration is disabled by app configuration")
return
}
PlatformHelper.vibrate(PlatformHelper.HapticsFeedbackSelection)
d.configOverlay = configComponent.createObject(contentContainer)
mainHeader.menuOpen = false;
}
header: ToolBar {
@ -287,9 +294,7 @@ Page {
iconSource: "../images/" + model.icon + ".svg"
onPressAndHold: {
PlatformHelper.vibrate(PlatformHelper.HapticsFeedbackSelection)
d.configOverlay = configComponent.createObject(contentContainer)
mainHeader.menuOpen = false;
root.configureViews();
}
}
}
@ -464,8 +469,11 @@ Page {
header: RowLayout {
id: headerRow
width: parent.width
Label {
text: model.displayName
Layout.fillWidth: true
elide: Text.ElideRight
}
}