fixed display of notification about successful clearing of cached profiles

- limited the input for the Port field to only numeric values, in the range 1-65535
This commit is contained in:
vladimir.kuznetsov 2023-08-28 14:18:41 +03:00
parent fe08fd3f0a
commit 639c18395b
9 changed files with 22 additions and 32 deletions

View file

@ -227,7 +227,7 @@ DrawerType {
visible: ExportController.qrCodesCount > 0 visible: ExportController.qrCodesCount > 0
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: qsTr("To read the QR code in the Amnezia app, select \"Add Server\" → \"I have connection details\"") text: qsTr("To read the QR code in the Amnezia app, select \"Add server\" → \"I have data to connect\" → \"QR code, key or settings file\"")
} }
} }
} }

View file

@ -103,6 +103,7 @@ PageType {
headerText: qsTr("Port") headerText: qsTr("Port")
textFieldText: port textFieldText: port
textField.maximumLength: 5 textField.maximumLength: 5
textField.validator: IntValidator { bottom: 1; top: 65535 }
textField.onEditingFinished: { textField.onEditingFinished: {
if (textFieldText !== port) { if (textFieldText !== port) {

View file

@ -134,6 +134,7 @@ PageType {
headerText: qsTr("Port") headerText: qsTr("Port")
textFieldText: port textFieldText: port
textField.maximumLength: 5 textField.maximumLength: 5
textField.validator: IntValidator { bottom: 1; top: 65535 }
textField.onEditingFinished: { textField.onEditingFinished: {
if (textFieldText !== port) { if (textFieldText !== port) {

View file

@ -89,6 +89,7 @@ PageType {
headerText: qsTr("Port") headerText: qsTr("Port")
textFieldText: port textFieldText: port
textField.maximumLength: 5 textField.maximumLength: 5
textField.validator: IntValidator { bottom: 1; top: 65535 }
textField.onEditingFinished: { textField.onEditingFinished: {
if (textFieldText !== port) { if (textFieldText !== port) {

View file

@ -89,13 +89,15 @@ PageType {
clickedFunction: function() { clickedFunction: function() {
questionDrawer.headerText = qsTr("Clear cached profiles?") questionDrawer.headerText = qsTr("Clear cached profiles?")
questionDrawer.descriptionText = qsTr("some description") questionDrawer.descriptionText = qsTr("")
questionDrawer.yesButtonText = qsTr("Continue") questionDrawer.yesButtonText = qsTr("Continue")
questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.noButtonText = qsTr("Cancel")
questionDrawer.yesButtonFunction = function() { questionDrawer.yesButtonFunction = function() {
questionDrawer.visible = false questionDrawer.visible = false
ContainersModel.clearCachedProfiles() PageController.showBusyIndicator(true)
SettingsController.clearCachedProfiles()
PageController.showBusyIndicator(false)
} }
questionDrawer.noButtonFunction = function() { questionDrawer.noButtonFunction = function() {
questionDrawer.visible = false questionDrawer.visible = false
@ -165,7 +167,7 @@ PageType {
clickedFunction: function() { clickedFunction: function() {
questionDrawer.headerText = qsTr("Clear server from Amnezia software?") questionDrawer.headerText = qsTr("Clear server from Amnezia software?")
questionDrawer.descriptionText = qsTr(" All containers will be deleted on the server. This means that configuration files, keys and certificates will be deleted.") questionDrawer.descriptionText = qsTr("All containers will be deleted on the server. This means that configuration files, keys and certificates will be deleted.")
questionDrawer.yesButtonText = qsTr("Continue") questionDrawer.yesButtonText = qsTr("Continue")
questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.noButtonText = qsTr("Cancel")

View file

@ -49,7 +49,7 @@ PageType {
headerText: qsTr("Server connection") headerText: qsTr("Server connection")
descriptionText: qsTr("Do not use connection code from public sources. It may have been created to intercept your data.\n descriptionText: qsTr("Do not use connection code from public sources. It may have been created to intercept your data.\n
It's okay if a friend passed the code.") It's okay as long as it's from someone you trust.")
} }
Header2TextType { Header2TextType {

View file

@ -107,31 +107,6 @@ PageType {
goToPage(PageEnum.PageSetupWizardEasy) goToPage(PageEnum.PageSetupWizardEasy)
} }
} }
// BasicButtonType {
// Layout.fillWidth: true
// Layout.topMargin: -8
// defaultColor: "transparent"
// hoveredColor: Qt.rgba(1, 1, 1, 0.08)
// pressedColor: Qt.rgba(1, 1, 1, 0.12)
// disabledColor: "#878B91"
// textColor: "#D7D8DB"
// borderWidth: 1
// text: qsTr("Select protocol to install")
// onClicked: function() {
// if (!isCredentialsFilled()) {
// return
// }
// InstallController.setShouldCreateServer(true)
// InstallController.setCurrentlyInstalledServerCredentials(hostname.textField.text, username.textField.text, secretData.textField.text)
// goToPage(PageEnum.PageSetupWizardProtocols)
// }
// }
} }
} }

View file

@ -45,7 +45,7 @@ PageType {
id: fl id: fl
anchors.top: backButton.bottom anchors.top: backButton.bottom
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
contentHeight: content.implicitHeight + continueButton.anchors.bottomMargin contentHeight: content.implicitHeight + setupLaterButton.anchors.bottomMargin
Column { Column {
id: content id: content
@ -126,7 +126,9 @@ PageType {
} }
} }
DividerType {} DividerType {
implicitWidth: parent.width
}
CardType { CardType {
implicitWidth: parent.width implicitWidth: parent.width
@ -141,6 +143,11 @@ PageType {
} }
} }
Item {
implicitWidth: 1
implicitHeight: 1
}
BasicButtonType { BasicButtonType {
id: continueButton id: continueButton
@ -163,6 +170,8 @@ PageType {
} }
BasicButtonType { BasicButtonType {
id: setupLaterButton
implicitWidth: parent.width implicitWidth: parent.width
anchors.topMargin: 8 anchors.topMargin: 8
anchors.bottomMargin: 24 anchors.bottomMargin: 24

View file

@ -212,6 +212,7 @@ PageType {
headerText: qsTr("Port") headerText: qsTr("Port")
textField.maximumLength: 5 textField.maximumLength: 5
textField.validator: IntValidator { bottom: 1; top: 65535 }
} }
Rectangle { Rectangle {