mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-24 02:00:24 +07:00
fix: Welcome screen fix
This commit is contained in:
@@ -25,30 +25,27 @@ PageType {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultActiveFocusItem: focusItem
|
ListView {
|
||||||
|
id: listView
|
||||||
|
|
||||||
FlickableType {
|
anchors.fill: parent
|
||||||
id: fl
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
contentHeight: content.height
|
|
||||||
|
|
||||||
ColumnLayout {
|
property bool isFocusable: true
|
||||||
id: content
|
|
||||||
|
|
||||||
anchors.top: parent.top
|
ScrollBar.vertical: ScrollBarType {}
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
|
|
||||||
spacing: 0
|
model: variants
|
||||||
|
|
||||||
Item {
|
clip: true
|
||||||
id: focusItem
|
|
||||||
KeyNavigation.tab: textKey.textField
|
|
||||||
}
|
|
||||||
|
|
||||||
|
reuseItems: true
|
||||||
|
|
||||||
|
header: ColumnLayout {
|
||||||
|
width: listView.width
|
||||||
|
|
||||||
HeaderType {
|
HeaderType {
|
||||||
|
id: moreButton
|
||||||
|
|
||||||
property bool isVisible: SettingsController.getInstallationUuid() !== "" || PageController.isStartPageVisible()
|
property bool isVisible: SettingsController.getInstallationUuid() !== "" || PageController.isStartPageVisible()
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@@ -60,7 +57,7 @@ PageType {
|
|||||||
|
|
||||||
actionButtonImage: isVisible ? "qrc:/images/controls/more-vertical.svg" : ""
|
actionButtonImage: isVisible ? "qrc:/images/controls/more-vertical.svg" : ""
|
||||||
actionButtonFunction: function() {
|
actionButtonFunction: function() {
|
||||||
moreActionsDrawer.open()
|
moreActionsDrawer.openTriggered()
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawerType2 {
|
DrawerType2 {
|
||||||
@@ -71,7 +68,7 @@ PageType {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
expandedHeight: root.height * 0.5
|
expandedHeight: root.height * 0.5
|
||||||
|
|
||||||
expandedContent: ColumnLayout {
|
expandedStateContent: ColumnLayout {
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
@@ -131,6 +128,8 @@ PageType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ParagraphTextType {
|
ParagraphTextType {
|
||||||
|
objectName: "insertKeyLabel"
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 32
|
Layout.topMargin: 32
|
||||||
Layout.rightMargin: 16
|
Layout.rightMargin: 16
|
||||||
@@ -154,8 +153,6 @@ PageType {
|
|||||||
textField.text = ""
|
textField.text = ""
|
||||||
textField.paste()
|
textField.paste()
|
||||||
}
|
}
|
||||||
|
|
||||||
KeyNavigation.tab: continueButton
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BasicButtonType {
|
BasicButtonType {
|
||||||
@@ -166,13 +163,12 @@ PageType {
|
|||||||
Layout.rightMargin: 16
|
Layout.rightMargin: 16
|
||||||
Layout.leftMargin: 16
|
Layout.leftMargin: 16
|
||||||
|
|
||||||
visible: textKey.textFieldText !== ""
|
visible: textKey.textField.text !== ""
|
||||||
|
|
||||||
text: qsTr("Continue")
|
text: qsTr("Continue")
|
||||||
Keys.onTabPressed: lastItemTabClicked(focusItem)
|
|
||||||
|
|
||||||
clickedFunc: function() {
|
clickedFunc: function() {
|
||||||
if (ImportController.extractConfigFromData(textKey.textFieldText)) {
|
if (ImportController.extractConfigFromData(textKey.textField.text)) {
|
||||||
PageController.goToPage(PageEnum.PageSetupWizardViewConfig)
|
PageController.goToPage(PageEnum.PageSetupWizardViewConfig)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -188,24 +184,77 @@ PageType {
|
|||||||
color: AmneziaStyle.color.charcoalGray
|
color: AmneziaStyle.color.charcoalGray
|
||||||
text: qsTr("Other connection options")
|
text: qsTr("Other connection options")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
delegate: ColumnLayout {
|
||||||
|
width: listView.width
|
||||||
|
|
||||||
CardWithIconsType {
|
CardWithIconsType {
|
||||||
id: apiInstalling
|
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.rightMargin: 16
|
Layout.rightMargin: 16
|
||||||
Layout.leftMargin: 16
|
Layout.leftMargin: 16
|
||||||
Layout.bottomMargin: 16
|
Layout.bottomMargin: 16
|
||||||
|
|
||||||
headerText: qsTr("VPN by Amnezia")
|
visible: isVisible
|
||||||
bodyText: qsTr("Connect to classic paid and free VPN services from Amnezia")
|
|
||||||
|
headerText: title
|
||||||
|
bodyText: description
|
||||||
|
|
||||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||||
leftImageSource: "qrc:/images/controls/amnezia.svg"
|
leftImageSource: imageSource
|
||||||
|
|
||||||
onClicked: function() {
|
onClicked: { handler() }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
footer: ColumnLayout {
|
||||||
|
width: listView.width
|
||||||
|
|
||||||
|
BasicButtonType {
|
||||||
|
id: siteLink2
|
||||||
|
Layout.topMargin: 24
|
||||||
|
Layout.bottomMargin: 16
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
implicitHeight: 32
|
||||||
|
|
||||||
|
visible: Qt.platform.os !== "ios"
|
||||||
|
|
||||||
|
defaultColor: AmneziaStyle.color.transparent
|
||||||
|
hoveredColor: AmneziaStyle.color.translucentWhite
|
||||||
|
pressedColor: AmneziaStyle.color.sheerWhite
|
||||||
|
disabledColor: AmneziaStyle.color.mutedGray
|
||||||
|
textColor: AmneziaStyle.color.goldenApricot
|
||||||
|
|
||||||
|
text: qsTr("Site Amnezia")
|
||||||
|
|
||||||
|
rightImageSource: "qrc:/images/controls/external-link.svg"
|
||||||
|
|
||||||
|
clickedFunc: function() {
|
||||||
|
Qt.openUrlExternally(LanguageModel.getCurrentSiteUrl())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
property list<QtObject> variants: [
|
||||||
|
amneziaVpn,
|
||||||
|
selfHostVpn,
|
||||||
|
backupRestore,
|
||||||
|
fileOpen,
|
||||||
|
qrScan,
|
||||||
|
siteLink
|
||||||
|
]
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
id: amneziaVpn
|
||||||
|
|
||||||
|
property string title: qsTr("VPN by Amnezia")
|
||||||
|
property string description: qsTr("Connect to classic paid and free VPN services from Amnezia")
|
||||||
|
property string imageSource: "qrc:/images/controls/amnezia.svg"
|
||||||
|
property bool isVisible: true
|
||||||
|
property var handler: function() {
|
||||||
PageController.showBusyIndicator(true)
|
PageController.showBusyIndicator(true)
|
||||||
var result = InstallController.fillAvailableServices()
|
var result = ApiConfigsController.fillAvailableServices()
|
||||||
PageController.showBusyIndicator(false)
|
PageController.showBusyIndicator(false)
|
||||||
if (result) {
|
if (result) {
|
||||||
PageController.goToPage(PageEnum.PageSetupWizardApiServicesList)
|
PageController.goToPage(PageEnum.PageSetupWizardApiServicesList)
|
||||||
@@ -213,41 +262,26 @@ PageType {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CardWithIconsType {
|
QtObject {
|
||||||
id: manualInstalling
|
id: selfHostVpn
|
||||||
|
|
||||||
Layout.fillWidth: true
|
property string title: qsTr("Self-hosted VPN")
|
||||||
Layout.rightMargin: 16
|
property string description: qsTr("Configure Amnezia VPN on your own server")
|
||||||
Layout.leftMargin: 16
|
property string imageSource: "qrc:/images/controls/server.svg"
|
||||||
Layout.bottomMargin: 16
|
property bool isVisible: true
|
||||||
|
property var handler: function() {
|
||||||
headerText: qsTr("Self-hosted VPN")
|
|
||||||
bodyText: qsTr("Configure Amnezia VPN on your own server")
|
|
||||||
|
|
||||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
|
||||||
leftImageSource: "qrc:/images/controls/server.svg"
|
|
||||||
|
|
||||||
onClicked: {
|
|
||||||
PageController.goToPage(PageEnum.PageSetupWizardCredentials)
|
PageController.goToPage(PageEnum.PageSetupWizardCredentials)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CardWithIconsType {
|
QtObject {
|
||||||
id: backupRestore
|
id: backupRestore
|
||||||
|
|
||||||
Layout.fillWidth: true
|
property string title: qsTr("Restore from backup")
|
||||||
Layout.rightMargin: 16
|
property string description: qsTr("")
|
||||||
Layout.leftMargin: 16
|
property string imageSource: "qrc:/images/controls/archive-restore.svg"
|
||||||
Layout.bottomMargin: 16
|
property bool isVisible: PageController.isStartPageVisible()
|
||||||
|
property var handler: function() {
|
||||||
visible: PageController.isStartPageVisible()
|
|
||||||
|
|
||||||
headerText: qsTr("Restore from backup")
|
|
||||||
|
|
||||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
|
||||||
leftImageSource: "qrc:/images/controls/archive-restore.svg"
|
|
||||||
|
|
||||||
onClicked: {
|
|
||||||
var filePath = SystemController.getFileName(qsTr("Open backup file"),
|
var filePath = SystemController.getFileName(qsTr("Open backup file"),
|
||||||
qsTr("Backup files (*.backup)"))
|
qsTr("Backup files (*.backup)"))
|
||||||
if (filePath !== "") {
|
if (filePath !== "") {
|
||||||
@@ -258,20 +292,14 @@ PageType {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CardWithIconsType {
|
QtObject {
|
||||||
id: openFile
|
id: fileOpen
|
||||||
|
|
||||||
Layout.fillWidth: true
|
property string title: qsTr("File with connection settings")
|
||||||
Layout.rightMargin: 16
|
property string description: qsTr("")
|
||||||
Layout.leftMargin: 16
|
property string imageSource: "qrc:/images/controls/folder-search-2.svg"
|
||||||
Layout.bottomMargin: 16
|
property bool isVisible: true
|
||||||
|
property var handler: function() {
|
||||||
headerText: qsTr("File with connection settings")
|
|
||||||
|
|
||||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
|
||||||
leftImageSource: "qrc:/images/controls/folder-search-2.svg"
|
|
||||||
|
|
||||||
onClicked: {
|
|
||||||
var nameFilter = !ServersModel.getServersCount() ? "Config or backup files (*.vpn *.ovpn *.conf *.json *.backup)" :
|
var nameFilter = !ServersModel.getServersCount() ? "Config or backup files (*.vpn *.ovpn *.conf *.json *.backup)" :
|
||||||
"Config files (*.vpn *.ovpn *.conf *.json)"
|
"Config files (*.vpn *.ovpn *.conf *.json)"
|
||||||
var fileName = SystemController.getFileName(qsTr("Open config file"), nameFilter)
|
var fileName = SystemController.getFileName(qsTr("Open config file"), nameFilter)
|
||||||
@@ -283,22 +311,14 @@ PageType {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CardWithIconsType {
|
QtObject {
|
||||||
id: scanQr
|
id: qrScan
|
||||||
|
|
||||||
Layout.fillWidth: true
|
property string title: qsTr("QR code")
|
||||||
Layout.rightMargin: 16
|
property string description: qsTr("")
|
||||||
Layout.leftMargin: 16
|
property string imageSource: "qrc:/images/controls/scan-line.svg"
|
||||||
Layout.bottomMargin: 16
|
property bool isVisible: SettingsController.isCameraPresent()
|
||||||
|
property var handler: function() {
|
||||||
visible: (Qt.platform.os === "android" || Qt.platform.os === "ios") && SettingsController.isCameraPresent()
|
|
||||||
|
|
||||||
headerText: qsTr("QR code")
|
|
||||||
|
|
||||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
|
||||||
leftImageSource: "qrc:/images/controls/scan-line.svg"
|
|
||||||
|
|
||||||
onClicked: {
|
|
||||||
ImportController.startDecodingQr()
|
ImportController.startDecodingQr()
|
||||||
if (Qt.platform.os === "ios") {
|
if (Qt.platform.os === "ios") {
|
||||||
PageController.goToPage(PageEnum.PageSetupWizardQrReader)
|
PageController.goToPage(PageEnum.PageSetupWizardQrReader)
|
||||||
@@ -306,25 +326,15 @@ PageType {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CardWithIconsType {
|
QtObject {
|
||||||
id: siteLink
|
id: siteLink
|
||||||
|
|
||||||
Layout.fillWidth: true
|
property string title: qsTr("I have nothing")
|
||||||
Layout.rightMargin: 16
|
property string description: qsTr("")
|
||||||
Layout.leftMargin: 16
|
property string imageSource: "qrc:/images/controls/help-circle.svg"
|
||||||
Layout.bottomMargin: 16
|
property bool isVisible: PageController.isStartPageVisible() && Qt.platform.os !== "ios"
|
||||||
|
property var handler: function() {
|
||||||
visible: PageController.isStartPageVisible()
|
|
||||||
|
|
||||||
headerText: qsTr("I have nothing")
|
|
||||||
|
|
||||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
|
||||||
leftImageSource: "qrc:/images/controls/help-circle.svg"
|
|
||||||
|
|
||||||
onClicked: {
|
|
||||||
Qt.openUrlExternally(LanguageModel.getCurrentSiteUrl())
|
Qt.openUrlExternally(LanguageModel.getCurrentSiteUrl())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user