blob: 0bff7aef040f73256bab18ff78d00f479640175f [file] [log] [blame]
Sébastien Blin1f915762020-08-03 13:27:42 -04001/*
2 * Copyright (C) 2020 by Savoir-faire Linux
3 * Author: Yang Wang <yang.wang@savoirfairelinux.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
19import QtQuick 2.14
20import QtQuick.Layouts 1.3
21import QtQuick.Controls 2.14
22
23import "../../constant"
24import "../../commoncomponents"
25
26ColumnLayout {
27 property alias connectAccountManagerButtonAlias: connectAccountManagerButton
28 property alias newSIPAccountButtonAlias: newSIPAccountButton
29
30 Layout.fillWidth: true
31 Layout.fillHeight: true
32 spacing: 6
33
34 signal welcomePageRedirectPage(int toPageIndex)
35
36 Item {
37 // put a spacer to make the buttons closs to the middle
38 Layout.minimumHeight: 57
39 Layout.maximumHeight: 57
40 Layout.preferredHeight: 57
41 Layout.fillWidth: true
42 }
43 RowLayout {
44 Layout.fillWidth: true
45 Layout.alignment: Qt.AlignHCenter
46 Label {
47 id: welcomeLabel
48 Layout.maximumHeight: 40
49 Layout.alignment: Qt.AlignCenter
50 text: qsTr("Welcome to")
51 font.pointSize: 30
52 font.kerning: true
53 }
54 }
55 Item {
56 Layout.minimumHeight: 17
57 Layout.maximumHeight: 17
58 Layout.preferredHeight: 17
59 Layout.fillWidth: true
60 }
61
62 RowLayout {
63 Layout.fillWidth: true
64 Layout.alignment: Qt.AlignHCenter
65 Label {
66 id: welcomeLogo
67 Layout.alignment: Qt.AlignCenter
68 Layout.minimumWidth: 100
69 Layout.minimumHeight: 100
70 Layout.maximumWidth: 16777215
71 Layout.maximumHeight: 16777215
72 Layout.preferredWidth: 300
73 Layout.preferredHeight: 150
74 color: "transparent"
75 background: Image {
76 id: logoIMG
77 source: "qrc:/images/logo-jami-standard-coul.png"
78 fillMode: Image.PreserveAspectFit
79 mipmap: true
80 }
81 }
82 }
83 Item {
84 // put a spacer to make the buttons closs to the middle
85 Layout.preferredHeight: 57
86 Layout.fillWidth: true
87 Layout.fillHeight: true
88 }
89 RowLayout {
90 spacing: 6
91 Layout.fillWidth: true
92 Layout.maximumHeight: 30
93 Layout.alignment: Qt.AlignHCenter
94 HoverableGradientButton {
95 id: newAccountButton
96
97 Layout.alignment: Qt.AlignCenter
98 Layout.preferredWidth: 256
99 Layout.preferredHeight: 30
100 text: qsTr("Create local account")
101 font.pointSize: 10
102 font.kerning: true
103 radius: height / 2
104
Yang Wangb97bde42020-08-07 11:24:18 -0400105 toolTipText: qsTr("Create new Jami account")
106
Sébastien Blin1f915762020-08-03 13:27:42 -0400107 onClicked: {
108 welcomePageRedirectPage(1)
109 }
110 }
111 }
112 RowLayout {
113 spacing: 6
114 Layout.fillWidth: true
115
116 Layout.maximumHeight: 30
117 Layout.alignment: Qt.AlignHCenter
118 HoverableGradientButton {
119 id: fromDeviceButton
120 Layout.alignment: Qt.AlignCenter
121 Layout.preferredWidth: 256
122 Layout.preferredHeight: 30
123 text: qsTr("Import from device")
124 font.pointSize: 10
125 font.kerning: true
126
127 backgroundColor: JamiTheme.releaseColor
128 radius: height / 2
129
Yang Wangb97bde42020-08-07 11:24:18 -0400130 toolTipText: qsTr("Import account from other device")
131
Sébastien Blin1f915762020-08-03 13:27:42 -0400132 onClicked: {
133 welcomePageRedirectPage(5)
134 }
135 }
136 }
137 RowLayout {
138 spacing: 6
139 Layout.fillWidth: true
140
141 Layout.maximumHeight: 30
142 Layout.alignment: Qt.AlignHCenter
143 HoverableGradientButton {
144 id: fromBackupButton
145 Layout.alignment: Qt.AlignCenter
146 Layout.preferredWidth: 256
147 Layout.preferredHeight: 30
148 text: qsTr("Import from backup")
149 font.pointSize: 10
150 font.kerning: true
151
152 backgroundColor: JamiTheme.releaseColor
153 radius: height / 2
154
Yang Wangb97bde42020-08-07 11:24:18 -0400155 toolTipText: qsTr("Import account from backup file")
156
Sébastien Blin1f915762020-08-03 13:27:42 -0400157 onClicked: {
158 welcomePageRedirectPage(3)
159 }
160 }
161 }
162 RowLayout {
163 spacing: 6
164 Layout.fillWidth: true
165
166 Layout.maximumHeight: 30
167 Layout.alignment: Qt.AlignHCenter
168 Button {
169 id: showAdvancedButton
170 Layout.preferredWidth: 256
171 Layout.preferredHeight: 30
172 Layout.alignment: Qt.AlignCenter
173 text: qsTr("Show Advanced")
174 font.pointSize: 8
175 font.kerning: true
176
177 background: Rectangle{
178 anchors.fill: parent
179
180 color: "transparent"
181 radius: height /2
182 }
183
Yang Wangb97bde42020-08-07 11:24:18 -0400184 hoverEnabled: true
185
186 ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
187 ToolTip.visible: hovered
188 ToolTip.text: qsTr("Show advanced options")
189
Sébastien Blin1f915762020-08-03 13:27:42 -0400190 onClicked: {
191 connectAccountManagerButton.visible = !connectAccountManagerButton.visible
192 newSIPAccountButton.visible = !newSIPAccountButton.visible
193 }
194 }
195 }
196 RowLayout {
197 spacing: 6
198 Layout.fillWidth: true
199 Layout.alignment: Qt.AlignHCenter
200
201 Layout.maximumHeight: 30
202 HoverableGradientButton {
203 id: connectAccountManagerButton
204 Layout.preferredWidth: 256
205 Layout.preferredHeight: 30
206 Layout.alignment: Qt.AlignCenter
207 text: qsTr("Connect to account manager")
208 visible: false
209 font.pointSize: 10
210 font.kerning: true
211
212 backgroundColor: JamiTheme.releaseColor
213 radius: height / 2
214
Yang Wangb97bde42020-08-07 11:24:18 -0400215 toolTipText: qsTr("Login to account manager")
216
Sébastien Blin1f915762020-08-03 13:27:42 -0400217 onClicked: {
218 welcomePageRedirectPage(6)
219 }
220 }
221 }
222 RowLayout {
223 spacing: 6
224 Layout.fillWidth: true
225 Layout.alignment: Qt.AlignHCenter
226 Layout.maximumHeight: 30
227
228 HoverableGradientButton {
229 id: newSIPAccountButton
230 Layout.preferredWidth: 256
231 Layout.preferredHeight: 30
232 Layout.alignment: Qt.AlignCenter
233 text: qsTr("Add a new SIP account")
234 visible: false
235 font.pointSize: 10
236 font.kerning: true
237
238 radius: height / 2
239 backgroundColor: JamiTheme.releaseColor
240
Yang Wangb97bde42020-08-07 11:24:18 -0400241 toolTipText: qsTr("Create new SIP account")
242
Sébastien Blin1f915762020-08-03 13:27:42 -0400243 onClicked: {
244 welcomePageRedirectPage(2)
245 }
246 }
247 }
248 Item {
249 // put a spacer to make the buttons closs to the middle
250 Layout.fillHeight: true
251 Layout.preferredHeight: 65
252 Layout.fillWidth: true
253 }
254}