Merge branch 'dev' into feature/custom_drawer_component

This commit is contained in:
ronoaer 2023-10-21 09:28:41 +08:00 committed by GitHub
commit 023c3474d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
96 changed files with 3897 additions and 1733 deletions

View file

@ -142,6 +142,7 @@ Button {
PageController.setTriggeredBtConnectButton(true)
ServersModel.currentlyProcessedIndex = ServersModel.getDefaultServerIndex()
InstallController.setShouldCreateServer(false)
PageController.goToPage(PageEnum.PageSetupWizardEasy)
return

View file

@ -23,16 +23,14 @@ Drawer2Type {
anchors.right: parent.right
spacing: 0
Header2TextType {
Header2Type {
Layout.fillWidth: true
Layout.topMargin: 24
Layout.rightMargin: 16
Layout.leftMargin: 16
Layout.bottomMargin: 32
Layout.alignment: Qt.AlignHCenter
Layout.bottomMargin: 16
text: qsTr("Connection data")
wrapMode: Text.WordWrap
headerText: qsTr("Add new connection")
}
LabelWithButtonType {
@ -40,7 +38,7 @@ Drawer2Type {
Layout.fillWidth: true
Layout.topMargin: 16
text: qsTr("Server IP, login and password")
text: qsTr("Configure your server")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
clickedFunction: function() {
@ -54,7 +52,7 @@ Drawer2Type {
LabelWithButtonType {
Layout.fillWidth: true
text: qsTr("QR code, key or configuration file")
text: qsTr("Open config file, key or QR code")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
clickedFunction: function() {

View file

@ -50,35 +50,26 @@ ListView {
imageSource: "qrc:/images/controls/download.svg"
showImage: !isInstalled
checkable: isInstalled
checkable: isInstalled && !ConnectionController.isConnected && isSupported
checked: isDefault
onPressed: function(mouse) {
if (!isSupported) {
PageController.showErrorMessage(qsTr("The selected protocol is not supported on the current platform"))
}
}
onClicked: {
if (checked) {
var needReconnected = false
if (!isDefault) {
needReconnected = true
}
if (ConnectionController.isConnected && isInstalled) {
PageController.showNotificationMessage(qsTr("Unable change protocol while there is an active connection"))
return
}
if (checked) {
isDefault = true
menuContent.currentIndex = index
containersDropDown.menu.close()
if (needReconnected &&
(ConnectionController.isConnected || ConnectionController.isConnectionInProgress)) {
PageController.showNotificationMessage(qsTr("Reconnect via VPN Procotol: ") + name)
PageController.goToPageHome()
ConnectionController.openConnection()
}
} else {
if (!isSupported && isInstalled) {
PageController.showErrorMessage(qsTr("The selected protocol is not supported on the current platform"))
return
}
ContainersModel.setCurrentlyProcessedContainerIndex(proxyContainersModel.mapToSource(index))
InstallController.setShouldCreateServer(false)
PageController.goToPage(PageEnum.PageSetupWizardProtocolSettings)

View file

@ -64,6 +64,11 @@ ListView {
// goToPage(PageEnum.PageProtocolWireGuardSettings)
break
}
case ContainerEnum.Awg: {
AwgConfigModel.updateModel(config)
PageController.goToPage(PageEnum.PageProtocolAwgSettings)
break
}
case ContainerEnum.Ipsec: {
ProtocolsModel.updateModel(config)
PageController.goToPage(PageEnum.PageProtocolRaw)