From a4c4ef71fb2bbc16b944fb5e665a36ae5ca88216 Mon Sep 17 00:00:00 2001 From: vkamn Date: Fri, 26 Dec 2025 22:55:57 +0800 Subject: [PATCH] fix: minor fixes (#2099) * fix: fixed saving i1-i5 fields * fix: fixed default value for s4 * fix: fixed server name when sharing admin config --- client/ui/controllers/installController.cpp | 4 ++-- client/ui/qml/Components/AwgTextField.qml | 2 -- client/ui/qml/Pages2/PageProtocolAwgSettings.qml | 5 +++++ client/ui/qml/Pages2/PageShareConnection.qml | 2 +- client/ui/qml/Pages2/PageShareFullAccess.qml | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/client/ui/controllers/installController.cpp b/client/ui/controllers/installController.cpp index f181c5ae3..a3e10a2c8 100644 --- a/client/ui/controllers/installController.cpp +++ b/client/ui/controllers/installController.cpp @@ -84,7 +84,7 @@ void InstallController::install(DockerContainer container, int port, TransportPr int s1 = QRandomGenerator::global()->bounded(15, 150); int s2 = QRandomGenerator::global()->bounded(15, 150); int s3 = QRandomGenerator::global()->bounded(0, 64); - int s4 = QRandomGenerator::global()->bounded(0, 32); + int s4 = QRandomGenerator::global()->bounded(0, 20); // Ensure all values are unique and don't create equal packet sizes QSet usedValues; @@ -102,7 +102,7 @@ void InstallController::install(DockerContainer container, int port, TransportPr usedValues.insert(s3); while (usedValues.contains(s4)) { - s4 = QRandomGenerator::global()->bounded(0, 32); + s4 = QRandomGenerator::global()->bounded(0, 20); } QString initPacketJunkSize = QString::number(s1); diff --git a/client/ui/qml/Components/AwgTextField.qml b/client/ui/qml/Components/AwgTextField.qml index 87b023d90..e87c3a04a 100644 --- a/client/ui/qml/Components/AwgTextField.qml +++ b/client/ui/qml/Components/AwgTextField.qml @@ -9,7 +9,5 @@ TextFieldWithHeaderType { Layout.fillWidth: true Layout.topMargin: 16 - textField.validator: IntValidator { bottom: 0 } - checkEmptyText: true } diff --git a/client/ui/qml/Pages2/PageProtocolAwgSettings.qml b/client/ui/qml/Pages2/PageProtocolAwgSettings.qml index 9dd559647..1e4bdcb37 100644 --- a/client/ui/qml/Pages2/PageProtocolAwgSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolAwgSettings.qml @@ -390,6 +390,7 @@ PageType { headerText: qsTr("I1 - Special junk 1") textField.text: serverSpecialJunk1 + checkEmptyText: false textField.onEditingFinished: { if (textField.text !== serverSpecialJunk1) { @@ -412,6 +413,7 @@ PageType { headerText: qsTr("I2 - Special junk 2") textField.text: serverSpecialJunk2 + checkEmptyText: false textField.onEditingFinished: { if (textField.text !== serverSpecialJunk2) { @@ -434,6 +436,7 @@ PageType { headerText: qsTr("I3 - Special junk 3") textField.text: serverSpecialJunk3 + checkEmptyText: false textField.onEditingFinished: { if (textField.text !== serverSpecialJunk3) { @@ -456,6 +459,7 @@ PageType { headerText: qsTr("I4 - Special junk 4") textField.text: serverSpecialJunk4 + checkEmptyText: false textField.onEditingFinished: { if (textField.text !== serverSpecialJunk4) { @@ -524,6 +528,7 @@ PageType { } clickedFunc: function() { + forceActiveFocus() if (delegateItem.isEnabled) { if (AwgConfigModel.isHeadersEqual(underloadPacketMagicHeaderTextField.textField.text, transportPacketMagicHeaderTextField.textField.text, diff --git a/client/ui/qml/Pages2/PageShareConnection.qml b/client/ui/qml/Pages2/PageShareConnection.qml index c6aca230c..7b55d1b9e 100644 --- a/client/ui/qml/Pages2/PageShareConnection.qml +++ b/client/ui/qml/Pages2/PageShareConnection.qml @@ -175,7 +175,7 @@ PageType { id: configContentDrawer parent: pageShareConnection.parent anchors.fill: parent - expandedHeight: parent.height * 0.9 + expandedHeight: parent ? parent.height * 0.9 : 0 expandedStateContent: Item { id: configContentContainer implicitHeight: configContentDrawer.expandedHeight diff --git a/client/ui/qml/Pages2/PageShareFullAccess.qml b/client/ui/qml/Pages2/PageShareFullAccess.qml index 7ec6b6d6e..9cbbc7a8d 100644 --- a/client/ui/qml/Pages2/PageShareFullAccess.qml +++ b/client/ui/qml/Pages2/PageShareFullAccess.qml @@ -109,7 +109,7 @@ PageType { if (serverSelector.currentIndex !== serverSelectorListView.selectedIndex) { serverSelector.currentIndex = serverSelectorListView.selectedIndex - serverSelector.severSelectorIndexChanged() + serverSelector.serverSelectorIndexChanged() } listView.headerText = qsTr("Accessing ") + serverSelector.text