mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Ask confirmation to lock if changes without save #970
This commit is contained in:
@@ -9,6 +9,7 @@ KeePassDX(3.4.0)
|
||||
* Better search implementation #175 #1254
|
||||
* Setting to change keyboard during a search #1267
|
||||
* Manage package name from Magikeyboard #1010
|
||||
* Ask confirmation to lock if changes without save #970
|
||||
|
||||
KeePassDX(3.3.3)
|
||||
* Fix shared otpauth link if database not open #1274
|
||||
|
||||
@@ -29,6 +29,7 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.Toast
|
||||
import androidx.activity.viewModels
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import com.kunzisoft.keepass.R
|
||||
import com.kunzisoft.keepass.activities.dialogs.DeleteNodesDialogFragment
|
||||
import com.kunzisoft.keepass.activities.dialogs.PasswordEncodingDialogFragment
|
||||
@@ -431,7 +432,19 @@ abstract class DatabaseLockActivity : DatabaseModeActivity(),
|
||||
}
|
||||
|
||||
protected fun lockAndExit() {
|
||||
sendBroadcast(Intent(LOCK_ACTION))
|
||||
// Ask confirmation if modification not saved
|
||||
if (mDatabase?.isReadOnly == false
|
||||
&& mDatabase?.dataModifiedSinceLastLoading == true
|
||||
&& !PreferencesUtil.isAutoSaveDatabaseEnabled(this)) {
|
||||
AlertDialog.Builder(this)
|
||||
.setMessage(R.string.discard_changes)
|
||||
.setNegativeButton(android.R.string.cancel, null)
|
||||
.setPositiveButton(R.string.lock) { _, _ ->
|
||||
sendBroadcast(Intent(LOCK_ACTION))
|
||||
}.create().show()
|
||||
} else {
|
||||
sendBroadcast(Intent(LOCK_ACTION))
|
||||
}
|
||||
}
|
||||
|
||||
fun resetAppTimeout() {
|
||||
|
||||
@@ -8,3 +8,4 @@
|
||||
* Better search implementation #175 #1254
|
||||
* Setting to change keyboard during a search #1267
|
||||
* Manage package name from Magikeyboard #1010
|
||||
* Ask confirmation to lock if changes without save #970
|
||||
@@ -8,3 +8,4 @@
|
||||
* Meilleure implémentation de la recherche #175 #1254
|
||||
* Paramètre pour changer de clavier lors d'une recherche #1267
|
||||
* Gestion du nom de package du Magiclavier #1010
|
||||
* Demande de confirmation de verouiller si chanegement sans sauvegarde #970
|
||||
Reference in New Issue
Block a user