- datastore: export/import JSON con le chiavi camelCase dell'app Android (breedSettings/reservations/customers), scorte e ultimo aggiornamento preservati al ripristino - settings: flag 'introduzione vista' - desktop: permesso Documents (dove finisce il backup) - nuovi controlli: tools/check_qml.py (chiavi di traduzione, simboli JS, pagine, componenti) e qmllint nella suite - versione 0.2.0
75 lines
2.4 KiB
QML
75 lines
2.4 KiB
QML
import QtQuick 2.2
|
|
import Sailfish.Silica 1.0
|
|
import "../js/i18n.js" as I18N
|
|
|
|
// Introduzione: i quattro passi dell'app Flutter (registro galline, uova,
|
|
// clienti, ordini). Si apre da sola al primo avvio e resta raggiungibile
|
|
// dalle impostazioni; in quel caso il pulsante finale torna indietro.
|
|
Page {
|
|
id: page
|
|
allowedOrientations: Orientation.All
|
|
|
|
property bool firstRun: true
|
|
property string lang: "en"
|
|
|
|
function tr(key, arg) { return I18N.t(key, arg, page.lang) }
|
|
|
|
function finish() {
|
|
if (page.firstRun)
|
|
appSettings.introSeen = true
|
|
pageStack.pop()
|
|
}
|
|
|
|
Component.onCompleted: page.lang = I18N.langFor(appSettings.language, Qt.locale().name)
|
|
|
|
SilicaFlickable {
|
|
anchors.fill: parent
|
|
contentHeight: intro.height
|
|
|
|
Column {
|
|
id: intro
|
|
width: parent.width
|
|
spacing: Theme.paddingMedium
|
|
|
|
PageHeader { title: page.tr("welcome") }
|
|
|
|
Repeater {
|
|
model: 4
|
|
delegate: Column {
|
|
x: Theme.horizontalPageMargin
|
|
width: intro.width - 2 * Theme.horizontalPageMargin
|
|
spacing: Theme.paddingSmall
|
|
|
|
SectionHeader {
|
|
text: index === 0 ? page.tr("intro_step1_title")
|
|
: index === 1 ? page.tr("intro_step2_title")
|
|
: index === 2 ? page.tr("intro_step3_title")
|
|
: page.tr("intro_step4_title")
|
|
}
|
|
|
|
Label {
|
|
width: parent.width
|
|
text: index === 0 ? page.tr("intro_step1_desc")
|
|
: index === 1 ? page.tr("intro_step2_desc")
|
|
: index === 2 ? page.tr("intro_step3_desc")
|
|
: page.tr("intro_step4_desc")
|
|
color: Theme.secondaryColor
|
|
font.pixelSize: Theme.fontSizeSmall
|
|
wrapMode: Text.Wrap
|
|
}
|
|
}
|
|
}
|
|
|
|
Button {
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
text: page.tr("start_app")
|
|
onClicked: page.finish()
|
|
}
|
|
|
|
Item { width: parent.width; height: Theme.paddingLarge }
|
|
}
|
|
|
|
VerticalScrollDecorator {}
|
|
}
|
|
}
|