import QtQuick 2.0 import Sailfish.Silica 1.0 // Creare una cartella sotto l'account. Il motore crea una Maildir vera // (tmp, new, cur), non un contenitore vuoto. Page { id: page property int parent: 0 property int livello: 0 allowedOrientations: Orientation.All Column { anchors.top: parent.top anchors.topMargin: Theme.itemSizeLarge width: parent.width spacing: Theme.paddingLarge PageHeader { title: qsTr("Nuova cartella") description: qsTr("Dentro l'account") } TextField { id: nome width: parent.width - 2 * Theme.horizontalPageMargin anchors.horizontalCenter: parent.horizontalCenter label: qsTr("Nome") placeholderText: qsTr("per esempio: Progetti") inputMethodHints: Qt.ImhNoAutoUppercase EnterKey.enabled: true EnterKey.text: qsTr("Crea") EnterKey.onClicked: page.crea() } Button { anchors.horizontalCenter: parent.horizontalCenter text: qsTr("Crea") preferredWidth: Theme.buttonWidthSmall onClicked: page.crea() } Label { width: parent.width - 2 * Theme.horizontalPageMargin anchors.horizontalCenter: parent.horizontalCenter horizontalAlignment: Text.AlignHCenter text: page.errore visible: page.errore.length > 0 wrapMode: Text.Wrap font.pixelSize: Theme.fontSizeExtraSmall color: Theme.highlightColor } } property string errore: "" function crea() { page.errore = engine.creaCartella(page.parent, nome.text); if (page.errore.length === 0) pageStack.pop(); } }