Merge branch 'dev' of github.com:amnezia-vpn/amnezia-client into feature/qt6-client-management-panel
This commit is contained in:
commit
ada8912a1f
208 changed files with 1860 additions and 1503607 deletions
62
client/ui/qml/Controls/PopupWithTextField.qml
Normal file
62
client/ui/qml/Controls/PopupWithTextField.qml
Normal file
|
@ -0,0 +1,62 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
Popup {
|
||||
id: root
|
||||
|
||||
property alias text: textField.text
|
||||
property alias placeholderText: textField.placeholderText
|
||||
property string yesText: "yes"
|
||||
property string noText: "no"
|
||||
property var yesFunc
|
||||
property var noFunc
|
||||
|
||||
signal editingFinished()
|
||||
|
||||
anchors.centerIn: Overlay.overlay
|
||||
modal: true
|
||||
closePolicy: Popup.NoAutoClose
|
||||
|
||||
width: parent.width - 20
|
||||
|
||||
ColumnLayout {
|
||||
width: parent.width
|
||||
|
||||
TextField {
|
||||
id: textField
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
font.pixelSize: 16
|
||||
echoMode: TextInput.Password
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
BlueButtonType {
|
||||
id: yesButton
|
||||
Layout.preferredWidth: parent.width / 2
|
||||
Layout.fillWidth: true
|
||||
text: yesText
|
||||
onClicked: {
|
||||
root.enabled = false
|
||||
if (yesFunc && typeof yesFunc === "function") {
|
||||
yesFunc()
|
||||
}
|
||||
root.enabled = true
|
||||
}
|
||||
}
|
||||
BlueButtonType {
|
||||
id: noButton
|
||||
Layout.preferredWidth: parent.width / 2
|
||||
Layout.fillWidth: true
|
||||
text: noText
|
||||
onClicked: {
|
||||
if (noFunc && typeof noFunc === "function") {
|
||||
noFunc()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -10,6 +10,14 @@ PageBase {
|
|||
page: PageEnum.Start
|
||||
logic: StartPageLogic
|
||||
|
||||
Connections {
|
||||
target: StartPageLogic
|
||||
|
||||
function onShowPassphraseRequestMessage() {
|
||||
popupWithTextField.open()
|
||||
}
|
||||
}
|
||||
|
||||
BackButton {
|
||||
id: back_from_start
|
||||
visible: pageLoader.depth > 1
|
||||
|
@ -325,4 +333,22 @@ PageBase {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
PopupWithTextField {
|
||||
id: popupWithTextField
|
||||
placeholderText: "Enter private key passphrase"
|
||||
yesFunc: function() {
|
||||
editingFinished()
|
||||
close()
|
||||
StartPageLogic.passphraseDialogClosed()
|
||||
text = ""
|
||||
}
|
||||
noFunc: function() {
|
||||
close()
|
||||
StartPageLogic.passphraseDialogClosed()
|
||||
}
|
||||
onEditingFinished: {
|
||||
StartPageLogic.privateKeyPassphrase = text
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,8 +64,12 @@ Window {
|
|||
|
||||
function close_page() {
|
||||
if (pageLoader.depth <= 1) {
|
||||
if (GC.isMobile()) {
|
||||
root.close()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
pageLoader.currentItem.deactivated()
|
||||
pageLoader.pop()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue