mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Fix show read only warning
This commit is contained in:
@@ -430,12 +430,8 @@ class GroupActivity : LockingActivity(),
|
|||||||
val addGroupEnabled = !mReadOnly && !mCurrentGroupIsASearch
|
val addGroupEnabled = !mReadOnly && !mCurrentGroupIsASearch
|
||||||
var addEntryEnabled = !mReadOnly && !mCurrentGroupIsASearch
|
var addEntryEnabled = !mReadOnly && !mCurrentGroupIsASearch
|
||||||
mCurrentGroup?.let {
|
mCurrentGroup?.let {
|
||||||
val isRoot = it == mRootGroup
|
|
||||||
if (!it.allowAddEntryIfIsRoot())
|
if (!it.allowAddEntryIfIsRoot())
|
||||||
addEntryEnabled = !isRoot && addEntryEnabled
|
addEntryEnabled = it != mRootGroup && addEntryEnabled
|
||||||
if (isRoot) {
|
|
||||||
showWarnings()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
enableAddGroup(addGroupEnabled)
|
enableAddGroup(addGroupEnabled)
|
||||||
enableAddEntry(addEntryEnabled)
|
enableAddEntry(addEntryEnabled)
|
||||||
@@ -854,14 +850,6 @@ class GroupActivity : LockingActivity(),
|
|||||||
.iconPicked(bundle)
|
.iconPicked(bundle)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showWarnings() {
|
|
||||||
if (Database.getInstance().isReadOnly) {
|
|
||||||
if (PreferencesUtil.showReadOnlyWarning(this)) {
|
|
||||||
ReadOnlyDialog().show(supportFragmentManager, "readOnlyDialog")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onSortSelected(sortNodeEnum: SortNodeEnum, ascending: Boolean, groupsBefore: Boolean, recycleBinBottom: Boolean) {
|
override fun onSortSelected(sortNodeEnum: SortNodeEnum, ascending: Boolean, groupsBefore: Boolean, recycleBinBottom: Boolean) {
|
||||||
mListNodesFragment?.onSortSelected(sortNodeEnum, ascending, groupsBefore, recycleBinBottom)
|
mListNodesFragment?.onSortSelected(sortNodeEnum, ascending, groupsBefore, recycleBinBottom)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user