Поддержка протокола Sftp (File Sharing) по ТЗ по гранту от Теплицы
социальных технологий (2021 год) + небольшой рефакторинг
This commit is contained in:
parent
6ee203a21d
commit
3bcc12869b
45 changed files with 645 additions and 338 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import Qt.labs.platform 1.0
|
||||
|
||||
TextField {
|
||||
id: root
|
||||
|
|
@ -8,6 +9,7 @@ TextField {
|
|||
width: parent.width - 80
|
||||
height: 40
|
||||
anchors.topMargin: 5
|
||||
selectByMouse: true
|
||||
|
||||
selectionColor: "darkgray"
|
||||
font.pixelSize: 16
|
||||
|
|
@ -35,4 +37,36 @@ TextField {
|
|||
return "#A7A7A7"
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.RightButton
|
||||
onClicked: contextMenu.open()
|
||||
}
|
||||
|
||||
Menu {
|
||||
id: contextMenu
|
||||
|
||||
onAboutToShow: console.log("aboutToShow")
|
||||
onAboutToHide: console.log("aboutToHide")
|
||||
|
||||
MenuItem {
|
||||
text: qsTr("C&ut")
|
||||
shortcut: StandardKey.Cut
|
||||
enabled: root.selectedText
|
||||
onTriggered: root.cut()
|
||||
}
|
||||
MenuItem {
|
||||
text: qsTr("&Copy")
|
||||
shortcut: StandardKey.Copy
|
||||
enabled: root.selectedText
|
||||
onTriggered: root.copy()
|
||||
}
|
||||
MenuItem {
|
||||
text: qsTr("&Paste")
|
||||
shortcut: StandardKey.Paste
|
||||
enabled: root.canPaste
|
||||
onTriggered: root.paste()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import SortFilterProxyModel 0.2
|
|||
import ContainerProps 1.0
|
||||
import ProtocolProps 1.0
|
||||
import PageEnum 1.0
|
||||
import ProtocolEnum 1.0
|
||||
import "./"
|
||||
import "../Controls"
|
||||
import "../Config"
|
||||
|
|
@ -16,6 +17,18 @@ PageBase {
|
|||
logic: ServerContainersLogic
|
||||
|
||||
enabled: ServerContainersLogic.pageEnabled
|
||||
|
||||
function resetPage() {
|
||||
container_selector.selectedIndex = -1
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: logic
|
||||
function onUpdatePage() {
|
||||
root.resetPage()
|
||||
}
|
||||
}
|
||||
|
||||
BackButton {
|
||||
id: back
|
||||
}
|
||||
|
|
@ -174,7 +187,7 @@ PageBase {
|
|||
|
||||
Caption {
|
||||
id: cap1
|
||||
text: qsTr("Installed VPN containers")
|
||||
text: qsTr("Installed Protocols and Services")
|
||||
font.pixelSize: 20
|
||||
|
||||
}
|
||||
|
|
@ -268,16 +281,13 @@ PageBase {
|
|||
else tb_c.currentIndex = index
|
||||
|
||||
UiLogic.protocolsModel.setSelectedDockerContainer(proxyContainersModel.mapToSource(index))
|
||||
//ServerContainersLogic.setSelectedDockerContainer(proxyContainersModel.mapToSource(index))
|
||||
|
||||
//container_selector.containerSelected(index)
|
||||
//root.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ImageButtonType {
|
||||
id: button_default
|
||||
visible: service_type_role == ProtocolEnum.Vpn
|
||||
|
||||
Layout.alignment: Qt.AlignRight
|
||||
checkable: true
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ PageBase {
|
|||
y: 210
|
||||
width: 300
|
||||
height: 40
|
||||
text: qsTr("Protocols and services")
|
||||
text: qsTr("Protocols and Services")
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.ServerContainers)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Layouts 1.15
|
||||
import ProtocolEnum 1.0
|
||||
import "../"
|
||||
import "../../Controls"
|
||||
|
|
@ -13,113 +14,52 @@ PageProtocolBase {
|
|||
BackButton {
|
||||
id: back
|
||||
}
|
||||
Item {
|
||||
x: 0
|
||||
y: 40
|
||||
width: 380
|
||||
height: 600
|
||||
enabled: logic.pageEnabled
|
||||
CheckBoxType {
|
||||
x: 30
|
||||
y: 280
|
||||
width: 321
|
||||
height: 21
|
||||
text: qsTr("Auto-negotiate encryption")
|
||||
checked: logic.checkBoxProtoOpenVpnAutoEncryptionChecked
|
||||
onCheckedChanged: {
|
||||
logic.checkBoxProtoOpenVpnAutoEncryptionChecked = checked
|
||||
}
|
||||
onClicked: {
|
||||
logic.checkBoxProtoOpenVpnAutoEncryptionClicked()
|
||||
}
|
||||
}
|
||||
CheckBoxType {
|
||||
x: 30
|
||||
y: 430
|
||||
width: 321
|
||||
height: 21
|
||||
text: qsTr("Block DNS requests outside of VPN")
|
||||
checked: logic.checkBoxProtoOpenVpnBlockDnsChecked
|
||||
onCheckedChanged: {
|
||||
logic.checkBoxProtoOpenVpnBlockDnsChecked = checked
|
||||
}
|
||||
}
|
||||
CheckBoxType {
|
||||
x: 30
|
||||
y: 390
|
||||
width: 321
|
||||
height: 21
|
||||
text: qsTr("Enable TLS auth")
|
||||
checked: logic.checkBoxProtoOpenVpnTlsAuthChecked
|
||||
onCheckedChanged: {
|
||||
logic.checkBoxProtoOpenVpnTlsAuthChecked = checked
|
||||
}
|
||||
Caption {
|
||||
id: caption
|
||||
text: qsTr("OpenVPN Settings")
|
||||
}
|
||||
|
||||
}
|
||||
ComboBoxType {
|
||||
Item {
|
||||
enabled: logic.pageEnabled
|
||||
anchors.top: caption.bottom
|
||||
anchors.bottom: parent.bottom
|
||||
width: parent.width
|
||||
|
||||
LabelType {
|
||||
id: lb_subnet
|
||||
x: 30
|
||||
y: 340
|
||||
width: 151
|
||||
height: 31
|
||||
model: [
|
||||
qsTr("AES-256-GCM"),
|
||||
qsTr("AES-192-GCM"),
|
||||
qsTr("AES-128-GCM"),
|
||||
qsTr("AES-256-CBC"),
|
||||
qsTr("AES-192-CBC"),
|
||||
qsTr("AES-128-CBC"),
|
||||
qsTr("ChaCha20-Poly1305"),
|
||||
qsTr("ARIA-256-CBC"),
|
||||
qsTr("CAMELLIA-256-CBC"),
|
||||
qsTr("none")
|
||||
]
|
||||
currentIndex: {
|
||||
for (let i = 0; i < model.length; ++i) {
|
||||
if (logic.comboBoxProtoOpenVpnCipherText === model[i]) {
|
||||
return i
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
onCurrentTextChanged: {
|
||||
logic.comboBoxProtoOpenVpnCipherText = currentText
|
||||
}
|
||||
enabled: logic.comboBoxProtoOpenVpnCipherEnabled
|
||||
anchors.top: parent.top
|
||||
width: parent.width
|
||||
height: 21
|
||||
text: qsTr("VPN Addresses Subnet")
|
||||
}
|
||||
ComboBoxType {
|
||||
x: 200
|
||||
y: 340
|
||||
width: 151
|
||||
TextFieldType {
|
||||
id: tf_subnet
|
||||
x: 30
|
||||
anchors.top: lb_subnet.bottom
|
||||
|
||||
width: parent.width - 60
|
||||
height: 31
|
||||
model: [
|
||||
qsTr("SHA512"),
|
||||
qsTr("SHA384"),
|
||||
qsTr("SHA256"),
|
||||
qsTr("SHA3-512"),
|
||||
qsTr("SHA3-384"),
|
||||
qsTr("SHA3-256"),
|
||||
qsTr("whirlpool"),
|
||||
qsTr("BLAKE2b512"),
|
||||
qsTr("BLAKE2s256"),
|
||||
qsTr("SHA1")
|
||||
]
|
||||
currentIndex: {
|
||||
for (let i = 0; i < model.length; ++i) {
|
||||
if (logic.comboBoxProtoOpenVpnHashText === model[i]) {
|
||||
return i
|
||||
}
|
||||
}
|
||||
return -1
|
||||
text: logic.lineEditProtoOpenVpnSubnetText
|
||||
onEditingFinished: {
|
||||
logic.lineEditProtoOpenVpnSubnetText = text
|
||||
}
|
||||
onCurrentTextChanged: {
|
||||
logic.comboBoxProtoOpenVpnHashText = currentText
|
||||
}
|
||||
enabled: logic.comboBoxProtoOpenVpnHashEnabled
|
||||
}
|
||||
|
||||
//
|
||||
LabelType {
|
||||
id: lb_proto
|
||||
x: 30
|
||||
anchors.top: tf_subnet.bottom
|
||||
width: parent.width
|
||||
height: 21
|
||||
text: qsTr("Network protocol")
|
||||
}
|
||||
Rectangle {
|
||||
id: rect_proto
|
||||
x: 30
|
||||
y: 140
|
||||
width: 321
|
||||
anchors.top: lb_proto.bottom
|
||||
width: parent.width - 60
|
||||
height: 71
|
||||
border.width: 1
|
||||
border.color: "lightgray"
|
||||
|
|
@ -149,68 +89,27 @@ PageProtocolBase {
|
|||
enabled: logic.radioButtonProtoOpenVpnUdpEnabled
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
LabelType {
|
||||
id: lb_port
|
||||
anchors.top: rect_proto.bottom
|
||||
anchors.topMargin: 20
|
||||
|
||||
x: 30
|
||||
y: 110
|
||||
width: 151
|
||||
height: 21
|
||||
text: qsTr("Network protocol")
|
||||
}
|
||||
LabelType {
|
||||
x: 30
|
||||
y: 230
|
||||
width: 151
|
||||
width: root.width / 2 - 10
|
||||
height: 31
|
||||
text: qsTr("Port")
|
||||
}
|
||||
Text {
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 24
|
||||
color: "#100A44"
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: qsTr("OpenVPN Settings")
|
||||
x: 10
|
||||
y: 0
|
||||
width: 340
|
||||
height: 30
|
||||
}
|
||||
LabelType {
|
||||
x: 200
|
||||
y: 310
|
||||
width: 151
|
||||
height: 21
|
||||
text: qsTr("Hash")
|
||||
}
|
||||
LabelType {
|
||||
x: 30
|
||||
y: 40
|
||||
width: 291
|
||||
height: 21
|
||||
text: qsTr("VPN Addresses Subnet")
|
||||
}
|
||||
LabelType {
|
||||
x: 30
|
||||
y: 310
|
||||
width: 151
|
||||
height: 21
|
||||
text: qsTr("Cipher")
|
||||
}
|
||||
LabelType {
|
||||
id: label_proto_openvpn_info
|
||||
x: 30
|
||||
y: 550
|
||||
width: 321
|
||||
height: 41
|
||||
visible: logic.labelProtoOpenVpnInfoVisible
|
||||
text: logic.labelProtoOpenVpnInfoText
|
||||
}
|
||||
TextFieldType {
|
||||
id: lineEdit_proto_openvpn_port
|
||||
x: 200
|
||||
y: 230
|
||||
width: 151
|
||||
id: tf_port
|
||||
anchors.top: rect_proto.bottom
|
||||
anchors.topMargin: 20
|
||||
|
||||
anchors.left: parent.horizontalCenter
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 30
|
||||
|
||||
height: 31
|
||||
text: logic.lineEditProtoOpenVpnPortText
|
||||
onEditingFinished: {
|
||||
|
|
@ -218,19 +117,157 @@ PageProtocolBase {
|
|||
}
|
||||
enabled: logic.lineEditProtoOpenVpnPortEnabled
|
||||
}
|
||||
TextFieldType {
|
||||
id: lineEdit_proto_openvpn_subnet
|
||||
|
||||
//
|
||||
CheckBoxType {
|
||||
id: check_auto_enc
|
||||
anchors.top: lb_port.bottom
|
||||
anchors.topMargin: 20
|
||||
x: 30
|
||||
y: 65
|
||||
width: 321
|
||||
height: 31
|
||||
text: logic.lineEditProtoOpenVpnSubnetText
|
||||
onEditingFinished: {
|
||||
logic.lineEditProtoOpenVpnSubnetText = text
|
||||
width: parent.width
|
||||
height: 21
|
||||
text: qsTr("Auto-negotiate encryption")
|
||||
checked: logic.checkBoxProtoOpenVpnAutoEncryptionChecked
|
||||
onCheckedChanged: {
|
||||
logic.checkBoxProtoOpenVpnAutoEncryptionChecked = checked
|
||||
}
|
||||
onClicked: {
|
||||
logic.checkBoxProtoOpenVpnAutoEncryptionClicked()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
LabelType {
|
||||
id: lb_cipher
|
||||
x: 30
|
||||
anchors.top: check_auto_enc.bottom
|
||||
anchors.topMargin: 20
|
||||
width: parent.width
|
||||
height: 21
|
||||
text: qsTr("Cipher")
|
||||
}
|
||||
|
||||
ComboBoxType {
|
||||
id: cb_cipher
|
||||
x: 30
|
||||
anchors.top: lb_cipher.bottom
|
||||
width: parent.width - 60
|
||||
|
||||
height: 31
|
||||
model: [
|
||||
qsTr("AES-256-GCM"),
|
||||
qsTr("AES-192-GCM"),
|
||||
qsTr("AES-128-GCM"),
|
||||
qsTr("AES-256-CBC"),
|
||||
qsTr("AES-192-CBC"),
|
||||
qsTr("AES-128-CBC"),
|
||||
qsTr("ChaCha20-Poly1305"),
|
||||
qsTr("ARIA-256-CBC"),
|
||||
qsTr("CAMELLIA-256-CBC"),
|
||||
qsTr("none")
|
||||
]
|
||||
currentIndex: {
|
||||
for (let i = 0; i < model.length; ++i) {
|
||||
if (logic.comboBoxProtoOpenVpnCipherText === model[i]) {
|
||||
return i
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
onCurrentTextChanged: {
|
||||
logic.comboBoxProtoOpenVpnCipherText = currentText
|
||||
}
|
||||
enabled: logic.comboBoxProtoOpenVpnCipherEnabled
|
||||
}
|
||||
|
||||
//
|
||||
LabelType {
|
||||
id: lb_hash
|
||||
anchors.top: cb_cipher.bottom
|
||||
anchors.topMargin: 20
|
||||
width: parent.width
|
||||
|
||||
height: 21
|
||||
text: qsTr("Hash")
|
||||
}
|
||||
ComboBoxType {
|
||||
id: cb_hash
|
||||
x: 30
|
||||
height: 31
|
||||
anchors.top: lb_hash.bottom
|
||||
width: parent.width - 60
|
||||
model: [
|
||||
qsTr("SHA512"),
|
||||
qsTr("SHA384"),
|
||||
qsTr("SHA256"),
|
||||
qsTr("SHA3-512"),
|
||||
qsTr("SHA3-384"),
|
||||
qsTr("SHA3-256"),
|
||||
qsTr("whirlpool"),
|
||||
qsTr("BLAKE2b512"),
|
||||
qsTr("BLAKE2s256"),
|
||||
qsTr("SHA1")
|
||||
]
|
||||
currentIndex: {
|
||||
for (let i = 0; i < model.length; ++i) {
|
||||
if (logic.comboBoxProtoOpenVpnHashText === model[i]) {
|
||||
return i
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
onCurrentTextChanged: {
|
||||
logic.comboBoxProtoOpenVpnHashText = currentText
|
||||
}
|
||||
enabled: logic.comboBoxProtoOpenVpnHashEnabled
|
||||
}
|
||||
|
||||
CheckBoxType {
|
||||
id: check_tls
|
||||
x: 30
|
||||
anchors.top: cb_hash.bottom
|
||||
anchors.topMargin: 20
|
||||
width: parent.width
|
||||
height: 21
|
||||
text: qsTr("Enable TLS auth")
|
||||
checked: logic.checkBoxProtoOpenVpnTlsAuthChecked
|
||||
onCheckedChanged: {
|
||||
logic.checkBoxProtoOpenVpnTlsAuthChecked = checked
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
CheckBoxType {
|
||||
id: check_block_dns
|
||||
x: 30
|
||||
anchors.top: check_tls.bottom
|
||||
anchors.topMargin: 20
|
||||
width: parent.width
|
||||
height: 21
|
||||
text: qsTr("Block DNS requests outside of VPN")
|
||||
checked: logic.checkBoxProtoOpenVpnBlockDnsChecked
|
||||
onCheckedChanged: {
|
||||
logic.checkBoxProtoOpenVpnBlockDnsChecked = checked
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// LabelType {
|
||||
// id: label_proto_openvpn_info
|
||||
// x: 30
|
||||
// y: 550
|
||||
// width: 321
|
||||
// height: 41
|
||||
// visible: logic.labelProtoOpenVpnInfoVisible
|
||||
// text: logic.labelProtoOpenVpnInfoText
|
||||
// }
|
||||
|
||||
|
||||
ProgressBar {
|
||||
id: progressBar_proto_openvpn_reset
|
||||
id: progress_save
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 500
|
||||
width: 321
|
||||
|
|
@ -250,7 +287,7 @@ PageProtocolBase {
|
|||
implicitWidth: parent.width
|
||||
implicitHeight: parent.height
|
||||
Rectangle {
|
||||
width: progressBar_proto_openvpn_reset.visualPosition * parent.width
|
||||
width: progress_save.visualPosition * parent.width
|
||||
height: parent.height
|
||||
radius: 4
|
||||
color: Qt.rgba(255, 255, 255, 0.15);
|
||||
|
|
@ -258,9 +295,12 @@ PageProtocolBase {
|
|||
}
|
||||
}
|
||||
BlueButtonType {
|
||||
id: pb_save
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 500
|
||||
width: 321
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 20
|
||||
x: 30
|
||||
width: parent.width - 60
|
||||
height: 40
|
||||
text: qsTr("Save and restart VPN")
|
||||
visible: logic.pushButtonOpenvpnSaveVisible
|
||||
|
|
|
|||
79
client/ui/qml/Pages/Protocols/PageProtoSftp.qml
Normal file
79
client/ui/qml/Pages/Protocols/PageProtoSftp.qml
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import ProtocolEnum 1.0
|
||||
import "../"
|
||||
import "../../Controls"
|
||||
import "../../Config"
|
||||
|
||||
PageProtocolBase {
|
||||
id: root
|
||||
protocol: ProtocolEnum.Sftp
|
||||
logic: UiLogic.protocolLogic(protocol)
|
||||
|
||||
BackButton {
|
||||
id: back
|
||||
}
|
||||
|
||||
Caption {
|
||||
id: caption
|
||||
text: qsTr("SFTF settings")
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: frame_settings
|
||||
width: parent.width
|
||||
anchors.top: caption.bottom
|
||||
anchors.topMargin: 10
|
||||
|
||||
border.width: 1
|
||||
border.color: "lightgray"
|
||||
anchors.bottomMargin: 5
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
radius: 2
|
||||
Grid {
|
||||
id: grid
|
||||
anchors.fill: parent
|
||||
columns: 2
|
||||
horizontalItemAlignment: Grid.AlignHCenter
|
||||
verticalItemAlignment: Grid.AlignVCenter
|
||||
topPadding: 5
|
||||
leftPadding: 10
|
||||
spacing: 5
|
||||
|
||||
|
||||
LabelType {
|
||||
width: 130
|
||||
text: qsTr("Port")
|
||||
}
|
||||
TextFieldType {
|
||||
id: tf_port_num
|
||||
width: parent.width - 130 - parent.spacing - parent.leftPadding * 2
|
||||
text: logic.labelTftpPortText
|
||||
readOnly: true
|
||||
}
|
||||
|
||||
LabelType {
|
||||
width: 130
|
||||
text: qsTr("User Name")
|
||||
}
|
||||
TextFieldType {
|
||||
id: tf_user_name
|
||||
width: parent.width - 130 - parent.spacing - parent.leftPadding * 2
|
||||
text: logic.labelTftpUserNameText
|
||||
readOnly: true
|
||||
}
|
||||
|
||||
LabelType {
|
||||
width: 130
|
||||
text: qsTr("Password")
|
||||
}
|
||||
TextFieldType {
|
||||
id: tf_password
|
||||
width: parent.width - 130 - parent.spacing - parent.leftPadding * 2
|
||||
text: logic.labelTftpPasswordText
|
||||
readOnly: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -31,7 +31,7 @@ Window {
|
|||
function gotoPage(page, reset, slide) {
|
||||
if (reset) {
|
||||
if (page === PageEnum.ServerSettings) {
|
||||
ServerSettingsLogic.updatePage();
|
||||
ServerSettingsLogic.onUpdatePage();
|
||||
}
|
||||
if (page === PageEnum.ShareConnection) {
|
||||
}
|
||||
|
|
@ -39,32 +39,32 @@ Window {
|
|||
WizardLogic.radioButtonMediumChecked = true
|
||||
}
|
||||
if (page === PageEnum.WizardHigh) {
|
||||
WizardLogic.updatePage();
|
||||
WizardLogic.onUpdatePage();
|
||||
}
|
||||
if (page === PageEnum.ServerConfiguringProgress) {
|
||||
ServerConfiguringProgressLogic.progressBarValue = 0;
|
||||
}
|
||||
if (page === PageEnum.GeneralSettings) {
|
||||
GeneralSettingsLogic.updatePage();
|
||||
GeneralSettingsLogic.onUpdatePage();
|
||||
}
|
||||
if (page === PageEnum.ServersList) {
|
||||
ServerListLogic.updatePage();
|
||||
ServerListLogic.onUpdatePage();
|
||||
}
|
||||
if (page === PageEnum.Start) {
|
||||
StartPageLogic.pushButtonBackFromStartVisible = !pageLoader.empty
|
||||
StartPageLogic.updatePage();
|
||||
StartPageLogic.onUpdatePage();
|
||||
}
|
||||
if (page === PageEnum.NewServerProtocols) {
|
||||
NewServerProtocolsLogic.updatePage()
|
||||
NewServerProtocolsLogic.onUpdatePage()
|
||||
}
|
||||
if (page === PageEnum.ServerContainers) {
|
||||
ServerContainersLogic.updateServerContainersPage()
|
||||
ServerContainersLogic.onUpdatePage()
|
||||
}
|
||||
if (page === PageEnum.AppSettings) {
|
||||
AppSettingsLogic.updatePage()
|
||||
AppSettingsLogic.onUpdatePage()
|
||||
}
|
||||
if (page === PageEnum.NetworkSettings) {
|
||||
NetworkSettingsLogic.updatePage()
|
||||
NetworkSettingsLogic.onUpdatePage()
|
||||
}
|
||||
if (page === PageEnum.Sites) {
|
||||
SitesLogic.updateSitesPage()
|
||||
|
|
@ -84,8 +84,8 @@ Window {
|
|||
}
|
||||
|
||||
function gotoProtocolPage(protocol, reset, slide) {
|
||||
if (reset) {
|
||||
protocolPages[protocol].logic.updatePage();
|
||||
if (reset && protocolPages[protocol] !== "undefined") {
|
||||
protocolPages[protocol].logic.onUpdatePage();
|
||||
}
|
||||
|
||||
if (slide) {
|
||||
|
|
@ -113,7 +113,7 @@ Window {
|
|||
}
|
||||
if (page === PageEnum.Start) {
|
||||
UiLogic.pushButtonBackFromStartVisible = !pageLoader.empty
|
||||
UiLogic.updatePage();
|
||||
UiLogic.onUpdatePage();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -154,26 +154,31 @@ Window {
|
|||
|
||||
// initialItem: page_servers
|
||||
onCurrentItemChanged: {
|
||||
console.debug("QML onCurrentItemChanged " + pageLoader.currentItem)
|
||||
UiLogic.currentPageValue = currentItem.page
|
||||
}
|
||||
|
||||
Keys.onReleased: {
|
||||
if (event.key === Qt.Key_Back || event.key === Qt.Key_Escape) {
|
||||
console.debug("Back button captured")
|
||||
if (UiLogic.currentPageValue !== PageEnum.VPN &&
|
||||
UiLogic.currentPageValue !== PageEnum.ServerConfiguring &&
|
||||
!(UiLogic.currentPageValue === PageEnum.Start && pageLoader.depth < 2)) {
|
||||
close_page();
|
||||
}
|
||||
// Keys.onReleased: {
|
||||
// if (event.key === Qt.Key_Back || event.key === Qt.Key_Escape) {
|
||||
// console.debug("Back button captured")
|
||||
// if (UiLogic.currentPageValue !== PageEnum.VPN &&
|
||||
// UiLogic.currentPageValue !== PageEnum.ServerConfiguring &&
|
||||
// !(UiLogic.currentPageValue === PageEnum.Start && pageLoader.depth < 2)) {
|
||||
// close_page();
|
||||
// }
|
||||
|
||||
|
||||
// TODO: fix
|
||||
//if (ui->stackedWidget_main->currentWidget()->isEnabled()) {
|
||||
// closePage();
|
||||
//}
|
||||
// // TODO: fix
|
||||
// //if (ui->stackedWidget_main->currentWidget()->isEnabled()) {
|
||||
// // closePage();
|
||||
// //}
|
||||
|
||||
event.accepted = true
|
||||
}
|
||||
// event.accepted = true
|
||||
// }
|
||||
// }
|
||||
|
||||
Keys.onPressed: {
|
||||
UiLogic.keyPressEvent(event.key)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -220,13 +225,9 @@ Window {
|
|||
obj.visible = false
|
||||
if (isProtocol) {
|
||||
protocolPages[obj.protocol] = obj
|
||||
console.debug("PPP " + obj.protocol + " " + file)
|
||||
|
||||
}
|
||||
else {
|
||||
pages[obj.page] = obj
|
||||
console.debug("AAA " + obj.page + " " + file)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -246,30 +247,30 @@ Window {
|
|||
|
||||
Connections {
|
||||
target: UiLogic
|
||||
onGoToPage: {
|
||||
function onGoToPage(page, reset, slide) {
|
||||
console.debug("Connections onGoToPage " + page);
|
||||
root.gotoPage(page, reset, slide)
|
||||
}
|
||||
onGoToProtocolPage: {
|
||||
function onGoToProtocolPage(protocol, reset, slide) {
|
||||
console.debug("Connections onGoToProtocolPage " + protocol);
|
||||
root.gotoProtocolPage(protocol, reset, slide)
|
||||
}
|
||||
onClosePage: {
|
||||
function onClosePage() {
|
||||
root.close_page()
|
||||
}
|
||||
onSetStartPage: {
|
||||
function onSetStartPage(page, slide) {
|
||||
root.set_start_page(page, slide)
|
||||
}
|
||||
onShowPublicKeyWarning: {
|
||||
function onShowPublicKeyWarning() {
|
||||
publicKeyWarning.visible = true
|
||||
}
|
||||
onShowConnectErrorDialog: {
|
||||
function onShowConnectErrorDialog() {
|
||||
connectErrorDialog.visible = true
|
||||
}
|
||||
onShow: {
|
||||
function onShow() {
|
||||
root.show()
|
||||
}
|
||||
onHide: {
|
||||
function onHide() {
|
||||
root.hide()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue