-
Notifications
You must be signed in to change notification settings - Fork 0
/
Introduction.qml
159 lines (140 loc) · 4.39 KB
/
Introduction.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
import QtQuick 2.0
import Ubuntu.Components 1.3
import Ubuntu.Components.Popups 1.3
import com.canonical.Oxide 1.0
import Ubuntu.Web 0.2
Page {
header: PageHeader {
id: pageHeader
title: i18n.tr("Setup")
StyleHints {
foregroundColor: "white"
backgroundColor: "#00adda"
dividerColor: "#00adda"
}
}
id: walkthrough
property string appName
property bool isFirstRun: true
signal finished
onFinished: {
mainView.firstRun=false
pageStack.clear()
pageStack.push(mainPage)
selector.selectedIndex = 10
speedSelector.selectedIndex = 2
}
Component.onCompleted: mainView.automaticOrientation = false
Component.onDestruction: mainView.automaticOrientation = true
Label {
id: label
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: parent.height/30
width: parent.width/1.1
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap
text: "Welcome to Voice! Voice is the first native text to speech app for Ubuntu Touch.\n \nThe only thing you'll need is a free API-Key from Voice RSS."
}
Label {
id: finishLabel
visible: false
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: parent.height/30
width: parent.width/1.1
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap
text: "Voice is configurated!\n \nDo you want to change the API-Key? Just go to the settings menu."
}
Button {
id: createButton
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: haveoneButton.top
anchors.bottomMargin: units.gu(3)
text: "Create an API-Key"
color: "#00adda"
onClicked: {
haveoneButton.visible = false
createButton.visible = false
label.visible = false
createkeyView.visible = true
doneButton.visible = true
}
}
Button {
id: haveoneButton
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: units.gu(5)
text: "I already have an API-Key"
color: "#00adda"
onClicked: {
PopupUtils.open(apiDialog)
}
}
WebView {
id: createkeyView
visible: false
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: doneButton.top
anchors.top: pageHeader.bottom
anchors.bottomMargin: units.gu(1)
url: "http://www.voicerss.org/registration.aspx"
}
Button {
id: doneButton
visible: false
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: units.gu(3)
text: "Done"
color: "#00adda"
onClicked: {
PopupUtils.open(apiDialog)
}
}
Component {
id: apiDialog
Dialog {
id: dialogue
title: "API-Key"
text: "Please enter your API-Key and click on 'Continue'."
TextField {
id: apikeyField
placeholderText: "API-Key"
}
Button {
text: "Continue"
color: "#00adda"
onClicked: {
apiDoc.contents = { 'apikey': apikeyField.text }
doneButton.visible = false
label.visible = false
haveoneButton.visible = false
createButton.visible = false
createkeyView.visible = false
finishButton.visible = true
finishLabel.visible = true
PopupUtils.close(dialogue)
}
}
Button {
text: "Cancel"
color: "#888888"
onClicked: PopupUtils.close(dialogue)
}
}
}
Button {
id: finishButton
visible: false
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: units.gu(3)
text: "Finish"
color: "#00adda"
onClicked: walkthrough.finished()
}
}