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: l'indice e il nome arrivano dalla voce // aperta, cosi' il comando non puo' finire sulla macchina sbagliata. Dialog { id: dialog property int deviceIndex: -1 property string deviceLabel: "" property bool enableAccept: false property int hours: api.delayHours canAccept: enableAccept onAccepted: { api.setDelayHours(hours) api.sendDelayAt(deviceIndex) } Column { width: parent.width spacing: Theme.paddingMedium DialogHeader { title: dialog.deviceLabel.length > 0 ? dialog.deviceLabel : 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) } } }