mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Fix renaming custom field #709
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
KeePassDX(2.9)
|
KeePassDX(2.9)
|
||||||
* Fix Autofill recognition
|
* Fix Autofill recognition #712
|
||||||
|
* Keep value after renaming custom field #709
|
||||||
|
|
||||||
KeePassDX(2.8.5)
|
KeePassDX(2.8.5)
|
||||||
* Fix Base 64 #708
|
* Fix Base 64 #708
|
||||||
|
|||||||
@@ -413,7 +413,7 @@ class EntryEditFragment: StylishFragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update an extra field or create a new one if doesn't exists
|
* Update an extra field or create a new one if doesn't exists, the old value is lost
|
||||||
*/
|
*/
|
||||||
fun putExtraField(extraField: Field) {
|
fun putExtraField(extraField: Field) {
|
||||||
extraFieldsContainerView.visibility = View.VISIBLE
|
extraFieldsContainerView.visibility = View.VISIBLE
|
||||||
@@ -434,13 +434,24 @@ class EntryEditFragment: StylishFragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update an extra field and keep the old value
|
||||||
|
*/
|
||||||
fun replaceExtraField(oldExtraField: Field, newExtraField: Field) {
|
fun replaceExtraField(oldExtraField: Field, newExtraField: Field) {
|
||||||
extraFieldsContainerView.visibility = View.VISIBLE
|
extraFieldsContainerView.visibility = View.VISIBLE
|
||||||
val index = mExtraFieldsList.indexOf(oldExtraField)
|
val index = mExtraFieldsList.indexOf(oldExtraField)
|
||||||
|
val oldValueEditText: EditText = extraFieldsListView.getChildAt(index)
|
||||||
|
.findViewWithTag("FIELD_VALUE_TAG")
|
||||||
|
val oldValue = oldValueEditText.text.toString()
|
||||||
|
val newExtraFieldWithOldValue = Field(newExtraField).apply {
|
||||||
|
this.protectedValue.stringValue = oldValue
|
||||||
|
}
|
||||||
mExtraFieldsList.removeAt(index)
|
mExtraFieldsList.removeAt(index)
|
||||||
mExtraFieldsList.add(index, newExtraField)
|
mExtraFieldsList.add(index, newExtraFieldWithOldValue)
|
||||||
extraFieldsListView.removeViewAt(index)
|
extraFieldsListView.removeViewAt(index)
|
||||||
extraFieldsListView.addView(buildViewFromField(newExtraField), index)
|
val newView = buildViewFromField(newExtraFieldWithOldValue)
|
||||||
|
extraFieldsListView.addView(newView, index)
|
||||||
|
newView?.requestFocus()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun removeExtraField(oldExtraField: Field) {
|
fun removeExtraField(oldExtraField: Field) {
|
||||||
|
|||||||
@@ -33,6 +33,11 @@ class Field : Parcelable {
|
|||||||
this.protectedValue = value
|
this.protectedValue = value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constructor(fieldToCopy: Field) {
|
||||||
|
this.name = fieldToCopy.name
|
||||||
|
this.protectedValue = fieldToCopy.protectedValue
|
||||||
|
}
|
||||||
|
|
||||||
constructor(parcel: Parcel) {
|
constructor(parcel: Parcel) {
|
||||||
this.name = parcel.readString() ?: name
|
this.name = parcel.readString() ?: name
|
||||||
this.protectedValue = parcel.readParcelable(ProtectedString::class.java.classLoader) ?: protectedValue
|
this.protectedValue = parcel.readParcelable(ProtectedString::class.java.classLoader) ?: protectedValue
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
* Fix Autofill recognition #709
|
* Fix Autofill recognition #712
|
||||||
|
* Keep value after renaming custom field #709
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
* Correction de la reconnaissance de remplissage automatique #709
|
* Correction de la reconnaissance de remplissage automatique #712
|
||||||
|
* La valeur du champ customisé est gardée après son renommage #709
|
||||||
|
|||||||
Reference in New Issue
Block a user