Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2020 by Savoir-faire Linux |
| 3 | * Author: Yang Wang <yang.wang@savoirfairelinux.com> |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 4 | * Author: Sébastien blin <sebastien.blin@savoirfairelinux.com> |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 3 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 18 | */ |
| 19 | |
| 20 | import QtQuick 2.14 |
| 21 | import QtQuick.Layouts 1.3 |
| 22 | import QtQuick.Controls 2.14 |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 23 | import QtGraphicalEffects 1.15 |
| 24 | import net.jami.Models 1.0 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 25 | |
| 26 | import "../../constant" |
| 27 | import "../../commoncomponents" |
| 28 | |
| 29 | ColumnLayout { |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 30 | anchors.fill: parent |
| 31 | anchors.verticalCenter: parent.verticalCenter |
| 32 | anchors.horizontalCenter: parent.horizontalCenter |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 33 | |
| 34 | signal welcomePageRedirectPage(int toPageIndex) |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 35 | signal leavePage |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 36 | |
| 37 | Item { |
| 38 | // put a spacer to make the buttons closs to the middle |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 39 | Layout.preferredHeight: 48 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 40 | Layout.fillWidth: true |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 41 | Layout.fillHeight: true |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 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 | } |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 55 | RowLayout { |
| 56 | Layout.fillWidth: true |
| 57 | Layout.alignment: Qt.AlignHCenter |
| 58 | Label { |
| 59 | id: welcomeLogo |
| 60 | Layout.alignment: Qt.AlignCenter |
| 61 | Layout.minimumWidth: 100 |
| 62 | Layout.minimumHeight: 100 |
| 63 | Layout.maximumWidth: 16777215 |
| 64 | Layout.maximumHeight: 16777215 |
| 65 | Layout.preferredWidth: 300 |
| 66 | Layout.preferredHeight: 150 |
| 67 | color: "transparent" |
| 68 | background: Image { |
| 69 | id: logoIMG |
| 70 | source: "qrc:/images/logo-jami-standard-coul.png" |
| 71 | fillMode: Image.PreserveAspectFit |
| 72 | mipmap: true |
| 73 | } |
| 74 | } |
| 75 | } |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 76 | RowLayout { |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 77 | spacing: 8 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 78 | Layout.fillWidth: true |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 79 | Layout.maximumHeight: 36 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 80 | Layout.alignment: Qt.AlignHCenter |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 81 | MaterialButton { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 82 | id: newAccountButton |
| 83 | |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 84 | text: qsTr("CREATE A JAMI ACCOUNT") |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 85 | toolTipText: qsTr("Create new Jami account") |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 86 | source: "qrc:/images/default_avatar_overlay.svg" |
| 87 | color: JamiTheme.buttonTintedBlue |
Sébastien Blin | c2220f8 | 2020-08-25 21:12:14 -0400 | [diff] [blame^] | 88 | hoveredColor: JamiTheme.buttonTintedBlueHovered |
| 89 | pressedColor: JamiTheme.buttonTintedBluePressed |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 90 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 91 | onClicked: { |
| 92 | welcomePageRedirectPage(1) |
| 93 | } |
| 94 | } |
| 95 | } |
| 96 | RowLayout { |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 97 | spacing: 8 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 98 | Layout.fillWidth: true |
| 99 | |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 100 | Layout.maximumHeight: 36 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 101 | Layout.alignment: Qt.AlignHCenter |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 102 | MaterialButton { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 103 | id: fromDeviceButton |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 104 | |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 105 | text: qsTr("IMPORT FROM ANOTHER DEVICE") |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 106 | toolTipText: qsTr("Import account from other device") |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 107 | source: "qrc:/images/icons/devices-24px.svg" |
| 108 | color: JamiTheme.buttonTintedBlue |
Sébastien Blin | c2220f8 | 2020-08-25 21:12:14 -0400 | [diff] [blame^] | 109 | hoveredColor: JamiTheme.buttonTintedBlueHovered |
| 110 | pressedColor: JamiTheme.buttonTintedBluePressed |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 111 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 112 | onClicked: { |
| 113 | welcomePageRedirectPage(5) |
| 114 | } |
| 115 | } |
| 116 | } |
| 117 | RowLayout { |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 118 | spacing: 8 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 119 | Layout.fillWidth: true |
| 120 | |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 121 | Layout.maximumHeight: 36 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 122 | Layout.alignment: Qt.AlignHCenter |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 123 | MaterialButton { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 124 | id: fromBackupButton |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 125 | |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 126 | text: qsTr("CONNECT FROM BACKUP") |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 127 | toolTipText: qsTr("Import account from backup file") |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 128 | source: "qrc:/images/icons/backup-24px.svg" |
| 129 | color: JamiTheme.buttonTintedBlue |
Sébastien Blin | c2220f8 | 2020-08-25 21:12:14 -0400 | [diff] [blame^] | 130 | hoveredColor: JamiTheme.buttonTintedBlueHovered |
| 131 | pressedColor: JamiTheme.buttonTintedBluePressed |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 132 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 133 | onClicked: { |
| 134 | welcomePageRedirectPage(3) |
| 135 | } |
| 136 | } |
| 137 | } |
| 138 | RowLayout { |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 139 | spacing: 8 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 140 | Layout.fillWidth: true |
| 141 | |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 142 | Layout.maximumHeight: 36 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 143 | Layout.alignment: Qt.AlignHCenter |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 144 | MaterialButton { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 145 | id: showAdvancedButton |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 146 | |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 147 | text: qsTr("SHOW ADVANCED") |
| 148 | toolTipText: qsTr("Show advanced options") |
| 149 | color: JamiTheme.buttonTintedBlue |
Sébastien Blin | c2220f8 | 2020-08-25 21:12:14 -0400 | [diff] [blame^] | 150 | hoveredColor: JamiTheme.buttonTintedBlueHovered |
| 151 | pressedColor: JamiTheme.buttonTintedBluePressed |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 152 | outlined: true |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 153 | |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 154 | hoverEnabled: true |
| 155 | |
| 156 | ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval |
| 157 | ToolTip.visible: hovered |
| 158 | ToolTip.text: qsTr("Show advanced options") |
| 159 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 160 | onClicked: { |
| 161 | connectAccountManagerButton.visible = !connectAccountManagerButton.visible |
| 162 | newSIPAccountButton.visible = !newSIPAccountButton.visible |
| 163 | } |
| 164 | } |
| 165 | } |
| 166 | RowLayout { |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 167 | spacing: 8 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 168 | Layout.fillWidth: true |
| 169 | Layout.alignment: Qt.AlignHCenter |
| 170 | |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 171 | Layout.maximumHeight: 36 |
| 172 | MaterialButton { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 173 | id: connectAccountManagerButton |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 174 | visible: false |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 175 | |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 176 | text: qsTr("CONNECT TO MANAGEMENT SERVER") |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 177 | toolTipText: qsTr("Login to account manager") |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 178 | source: "qrc:/images/icons/router-24px.svg" |
| 179 | color: JamiTheme.buttonTintedBlue |
Sébastien Blin | c2220f8 | 2020-08-25 21:12:14 -0400 | [diff] [blame^] | 180 | hoveredColor: JamiTheme.buttonTintedBlueHovered |
| 181 | pressedColor: JamiTheme.buttonTintedBluePressed |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 182 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 183 | onClicked: { |
| 184 | welcomePageRedirectPage(6) |
| 185 | } |
| 186 | } |
| 187 | } |
| 188 | RowLayout { |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 189 | spacing: 8 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 190 | Layout.fillWidth: true |
| 191 | Layout.alignment: Qt.AlignHCenter |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 192 | Layout.maximumHeight: 36 |
| 193 | MaterialButton { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 194 | id: newSIPAccountButton |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 195 | visible: false |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 196 | |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 197 | text: qsTr("CREATE A SIP ACCOUNT") |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 198 | toolTipText: qsTr("Create new SIP account") |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 199 | source: "qrc:/images/default_avatar_overlay.svg" |
| 200 | color: JamiTheme.buttonTintedBlue |
Sébastien Blin | c2220f8 | 2020-08-25 21:12:14 -0400 | [diff] [blame^] | 201 | hoveredColor: JamiTheme.buttonTintedBlueHovered |
| 202 | pressedColor: JamiTheme.buttonTintedBluePressed |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 203 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 204 | onClicked: { |
| 205 | welcomePageRedirectPage(2) |
| 206 | } |
| 207 | } |
| 208 | } |
| 209 | Item { |
| 210 | // put a spacer to make the buttons closs to the middle |
| 211 | Layout.fillHeight: true |
| 212 | Layout.preferredHeight: 65 |
| 213 | Layout.fillWidth: true |
| 214 | } |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 215 | |
| 216 | HoverableButton { |
| 217 | id: cancelButton |
| 218 | z: 2 |
| 219 | |
| 220 | visible: { |
| 221 | return ClientWrapper.utilsAdaptor.getAccountListSize() > 0 |
| 222 | } |
| 223 | |
| 224 | anchors.right: parent.right |
| 225 | anchors.top: parent.top |
| 226 | |
| 227 | rightPadding: 40 |
| 228 | topPadding: 40 |
| 229 | |
| 230 | Layout.preferredWidth: 96 |
| 231 | Layout.preferredHeight: 96 |
| 232 | |
| 233 | backgroundColor: "transparent" |
| 234 | onEnterColor: "transparent" |
| 235 | onPressColor: "transparent" |
| 236 | onReleaseColor: "transparent" |
| 237 | onExitColor: "transparent" |
| 238 | |
| 239 | buttonImageHeight: 48 |
| 240 | buttonImageWidth: 48 |
| 241 | source: "qrc:/images/icons/ic_close_white_24dp.png" |
| 242 | radius: 48 |
| 243 | baseColor: "#7c7c7c" |
| 244 | toolTipText: qsTr("Close") |
| 245 | |
| 246 | Action { |
| 247 | enabled: parent.visible |
| 248 | shortcut: StandardKey.Cancel |
| 249 | onTriggered: leavePage() |
| 250 | } |
| 251 | |
| 252 | onClicked: { |
| 253 | leavePage() |
| 254 | } |
| 255 | } |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 256 | } |