mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Toast when trying to open another database
This commit is contained in:
@@ -34,6 +34,7 @@ import android.view.ViewGroup
|
||||
import android.widget.Button
|
||||
import android.widget.CompoundButton
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.activity.result.ActivityResultLauncher
|
||||
import androidx.activity.viewModels
|
||||
import androidx.annotation.RequiresApi
|
||||
@@ -235,6 +236,15 @@ class MainCredentialActivity : DatabaseModeActivity(), AdvancedUnlockFragment.Bu
|
||||
override fun onDatabaseRetrieved(database: Database?) {
|
||||
super.onDatabaseRetrieved(database)
|
||||
if (database != null) {
|
||||
// Trying to load another database
|
||||
if (mDatabaseFileUri != null
|
||||
&& database.fileUri != null
|
||||
&& mDatabaseFileUri != database.fileUri) {
|
||||
Toast.makeText(this,
|
||||
R.string.warning_database_already_opened,
|
||||
Toast.LENGTH_LONG
|
||||
).show()
|
||||
}
|
||||
launchGroupActivityIfLoaded(database)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -331,6 +331,7 @@
|
||||
<string name="warning_password_encoding">Avoid password characters outside of text encoding format in database file (unrecognized chars are converted to the same letter).</string>
|
||||
<string name="warning_database_read_only">Grant file write access to save database changes</string>
|
||||
<string name="warning_database_link_revoked">Access to the file revoked by the file manager</string>
|
||||
<string name="warning_database_already_opened">A database is already open, close it first to open the new one</string>
|
||||
<string name="warning_empty_password">Continue without password unlocking protection?</string>
|
||||
<string name="warning_no_encryption_key">Continue without encryption key?</string>
|
||||
<string name="warning_permanently_delete_nodes">Permanently delete selected nodes?</string>
|
||||
|
||||
Reference in New Issue
Block a user