mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-24 02:00:24 +07:00
fix: fixed cipher selection (#2110)
This commit is contained in:
@@ -140,6 +140,16 @@ PageType {
|
|||||||
ListElement { name : "aes-128-gcm" }
|
ListElement { name : "aes-128-gcm" }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateSelectedIndex() {
|
||||||
|
cipherDropDown.text = cipher
|
||||||
|
for (var i = 0; i < cipherListView.model.count; i++) {
|
||||||
|
if (cipherListView.model.get(i).name === cipher) {
|
||||||
|
selectedIndex = i
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
clickedFunction: function() {
|
clickedFunction: function() {
|
||||||
cipherDropDown.text = selectedText
|
cipherDropDown.text = selectedText
|
||||||
cipher = cipherDropDown.text
|
cipher = cipherDropDown.text
|
||||||
@@ -147,13 +157,14 @@ PageType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
cipherDropDown.text = cipher
|
updateSelectedIndex()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (var i = 0; i < cipherListView.model.count; i++) {
|
Connections {
|
||||||
if (cipherListView.model.get(i).name === cipherDropDown.text) {
|
target: listView.model
|
||||||
selectedIndex = i
|
function onDataChanged() {
|
||||||
}
|
cipherListView.updateSelectedIndex()
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -192,6 +192,16 @@ PageType {
|
|||||||
ListElement { name : qsTr("SHA1") }
|
ListElement { name : qsTr("SHA1") }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateSelectedIndex() {
|
||||||
|
hashDropDown.text = hash
|
||||||
|
for (var i = 0; i < hashListView.model.count; i++) {
|
||||||
|
if (hashListView.model.get(i).name === hash) {
|
||||||
|
selectedIndex = i
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
clickedFunction: function() {
|
clickedFunction: function() {
|
||||||
hashDropDown.text = selectedText
|
hashDropDown.text = selectedText
|
||||||
hash = hashDropDown.text
|
hash = hashDropDown.text
|
||||||
@@ -199,13 +209,14 @@ PageType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
hashDropDown.text = hash
|
updateSelectedIndex()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (var i = 0; i < hashListView.model.count; i++) {
|
Connections {
|
||||||
if (hashListView.model.get(i).name === hashDropDown.text) {
|
target: listView.model
|
||||||
currentIndex = i
|
function onDataChanged() {
|
||||||
}
|
hashListView.updateSelectedIndex()
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -242,6 +253,16 @@ PageType {
|
|||||||
ListElement { name : qsTr("none") }
|
ListElement { name : qsTr("none") }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateSelectedIndex() {
|
||||||
|
cipherDropDown.text = cipher
|
||||||
|
for (var i = 0; i < cipherListView.model.count; i++) {
|
||||||
|
if (cipherListView.model.get(i).name === cipher) {
|
||||||
|
selectedIndex = i
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
clickedFunction: function() {
|
clickedFunction: function() {
|
||||||
cipherDropDown.text = selectedText
|
cipherDropDown.text = selectedText
|
||||||
cipher = cipherDropDown.text
|
cipher = cipherDropDown.text
|
||||||
@@ -249,13 +270,14 @@ PageType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
cipherDropDown.text = cipher
|
updateSelectedIndex()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (var i = 0; i < cipherListView.model.count; i++) {
|
Connections {
|
||||||
if (cipherListView.model.get(i).name === cipherDropDown.text) {
|
target: listView.model
|
||||||
currentIndex = i
|
function onDataChanged() {
|
||||||
}
|
cipherListView.updateSelectedIndex()
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,6 +109,16 @@ PageType {
|
|||||||
ListElement { name : "aes-128-gcm" }
|
ListElement { name : "aes-128-gcm" }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateSelectedIndex() {
|
||||||
|
cipherDropDown.text = cipher
|
||||||
|
for (var i = 0; i < cipherListView.model.count; i++) {
|
||||||
|
if (cipherListView.model.get(i).name === cipher) {
|
||||||
|
selectedIndex = i
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
clickedFunction: function() {
|
clickedFunction: function() {
|
||||||
cipherDropDown.text = selectedText
|
cipherDropDown.text = selectedText
|
||||||
cipher = cipherDropDown.text
|
cipher = cipherDropDown.text
|
||||||
@@ -116,13 +126,14 @@ PageType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
cipherDropDown.text = cipher
|
updateSelectedIndex()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (var i = 0; i < cipherListView.model.count; i++) {
|
Connections {
|
||||||
if (cipherListView.model.get(i).name === cipherDropDown.text) {
|
target: listView.model
|
||||||
currentIndex = i
|
function onDataChanged() {
|
||||||
}
|
cipherListView.updateSelectedIndex()
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user