import QtQuick 2.2 import Sailfish.Silica 1.0 // Stop ritardato: 3-19 ore, gli unici valori che queste macchine accettano. // Si apre dal menu di UNA macchina: senza l'indice il comando andrebbe a // quella sbagliata. Dialog { id: dialog property int deviceIndex: -1 property int hours: api.delayHours canAccept: api.canCommandAt(deviceIndex) onAccepted: { api.setDelayHours(hours) api.sendDelayAt(deviceIndex) } Column { width: parent.width spacing: Theme.paddingMedium DialogHeader { title: api.validIndex(deviceIndex) ? api.labelAt(deviceIndex) : qsTr("Delayed stop") acceptText: qsTr("Set") } Label { x: Theme.horizontalPageMargin width: parent.width - 2 * Theme.horizontalPageMargin wrapMode: Text.WordWrap color: Theme.secondaryColor font.pixelSize: Theme.fontSizeSmall text: qsTr("The machine will stop on its own after the chosen time, then resume its programme.") } Label { x: Theme.horizontalPageMargin width: parent.width - 2 * Theme.horizontalPageMargin horizontalAlignment: Text.AlignHCenter text: dialog.hours + " h" color: Theme.highlightColor font.pixelSize: Theme.fontSizeLarge } Slider { width: parent.width minimumValue: 3 maximumValue: 19 stepSize: 1 value: dialog.hours valueText: value + " h" onValueChanged: dialog.hours = Math.round(value) } } }