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 |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 88 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 89 | onClicked: { |
| 90 | welcomePageRedirectPage(1) |
| 91 | } |
| 92 | } |
| 93 | } |
| 94 | RowLayout { |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 95 | spacing: 8 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 96 | Layout.fillWidth: true |
| 97 | |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 98 | Layout.maximumHeight: 36 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 99 | Layout.alignment: Qt.AlignHCenter |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 100 | MaterialButton { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 101 | id: fromDeviceButton |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 102 | |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 103 | text: qsTr("IMPORT FROM ANOTHER DEVICE") |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 104 | toolTipText: qsTr("Import account from other device") |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 105 | source: "qrc:/images/icons/devices-24px.svg" |
| 106 | color: JamiTheme.buttonTintedBlue |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 107 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 108 | onClicked: { |
| 109 | welcomePageRedirectPage(5) |
| 110 | } |
| 111 | } |
| 112 | } |
| 113 | RowLayout { |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 114 | spacing: 8 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 115 | Layout.fillWidth: true |
| 116 | |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 117 | Layout.maximumHeight: 36 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 118 | Layout.alignment: Qt.AlignHCenter |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 119 | MaterialButton { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 120 | id: fromBackupButton |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 121 | |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 122 | text: qsTr("CONNECT FROM BACKUP") |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 123 | toolTipText: qsTr("Import account from backup file") |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 124 | source: "qrc:/images/icons/backup-24px.svg" |
| 125 | color: JamiTheme.buttonTintedBlue |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 126 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 127 | onClicked: { |
| 128 | welcomePageRedirectPage(3) |
| 129 | } |
| 130 | } |
| 131 | } |
| 132 | RowLayout { |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 133 | spacing: 8 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 134 | Layout.fillWidth: true |
| 135 | |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 136 | Layout.maximumHeight: 36 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 137 | Layout.alignment: Qt.AlignHCenter |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 138 | MaterialButton { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 139 | id: showAdvancedButton |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 140 | |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 141 | text: qsTr("SHOW ADVANCED") |
| 142 | toolTipText: qsTr("Show advanced options") |
| 143 | color: JamiTheme.buttonTintedBlue |
| 144 | outlined: true |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 145 | |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 146 | hoverEnabled: true |
| 147 | |
| 148 | ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval |
| 149 | ToolTip.visible: hovered |
| 150 | ToolTip.text: qsTr("Show advanced options") |
| 151 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 152 | onClicked: { |
| 153 | connectAccountManagerButton.visible = !connectAccountManagerButton.visible |
| 154 | newSIPAccountButton.visible = !newSIPAccountButton.visible |
| 155 | } |
| 156 | } |
| 157 | } |
| 158 | RowLayout { |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 159 | spacing: 8 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 160 | Layout.fillWidth: true |
| 161 | Layout.alignment: Qt.AlignHCenter |
| 162 | |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 163 | Layout.maximumHeight: 36 |
| 164 | MaterialButton { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 165 | id: connectAccountManagerButton |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 166 | visible: false |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 167 | |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 168 | text: qsTr("CONNECT TO MANAGEMENT SERVER") |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 169 | toolTipText: qsTr("Login to account manager") |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 170 | source: "qrc:/images/icons/router-24px.svg" |
| 171 | color: JamiTheme.buttonTintedBlue |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 172 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 173 | onClicked: { |
| 174 | welcomePageRedirectPage(6) |
| 175 | } |
| 176 | } |
| 177 | } |
| 178 | RowLayout { |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 179 | spacing: 8 |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 180 | Layout.fillWidth: true |
| 181 | Layout.alignment: Qt.AlignHCenter |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 182 | Layout.maximumHeight: 36 |
| 183 | MaterialButton { |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 184 | id: newSIPAccountButton |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 185 | visible: false |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 186 | |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 187 | text: qsTr("CREATE A SIP ACCOUNT") |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 188 | toolTipText: qsTr("Create new SIP account") |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 189 | source: "qrc:/images/default_avatar_overlay.svg" |
| 190 | color: JamiTheme.buttonTintedBlue |
Yang Wang | b97bde4 | 2020-08-07 11:24:18 -0400 | [diff] [blame] | 191 | |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 192 | onClicked: { |
| 193 | welcomePageRedirectPage(2) |
| 194 | } |
| 195 | } |
| 196 | } |
| 197 | Item { |
| 198 | // put a spacer to make the buttons closs to the middle |
| 199 | Layout.fillHeight: true |
| 200 | Layout.preferredHeight: 65 |
| 201 | Layout.fillWidth: true |
| 202 | } |
Sébastien Blin | c75335f | 2020-08-04 20:54:02 -0400 | [diff] [blame] | 203 | |
| 204 | HoverableButton { |
| 205 | id: cancelButton |
| 206 | z: 2 |
| 207 | |
| 208 | visible: { |
| 209 | return ClientWrapper.utilsAdaptor.getAccountListSize() > 0 |
| 210 | } |
| 211 | |
| 212 | anchors.right: parent.right |
| 213 | anchors.top: parent.top |
| 214 | |
| 215 | rightPadding: 40 |
| 216 | topPadding: 40 |
| 217 | |
| 218 | Layout.preferredWidth: 96 |
| 219 | Layout.preferredHeight: 96 |
| 220 | |
| 221 | backgroundColor: "transparent" |
| 222 | onEnterColor: "transparent" |
| 223 | onPressColor: "transparent" |
| 224 | onReleaseColor: "transparent" |
| 225 | onExitColor: "transparent" |
| 226 | |
| 227 | buttonImageHeight: 48 |
| 228 | buttonImageWidth: 48 |
| 229 | source: "qrc:/images/icons/ic_close_white_24dp.png" |
| 230 | radius: 48 |
| 231 | baseColor: "#7c7c7c" |
| 232 | toolTipText: qsTr("Close") |
| 233 | |
| 234 | Action { |
| 235 | enabled: parent.visible |
| 236 | shortcut: StandardKey.Cancel |
| 237 | onTriggered: leavePage() |
| 238 | } |
| 239 | |
| 240 | onClicked: { |
| 241 | leavePage() |
| 242 | } |
| 243 | } |
Sébastien Blin | 1f91576 | 2020-08-03 13:27:42 -0400 | [diff] [blame] | 244 | } |