add preference option to disable auto-return from queries with only one matching result (closes https://github.com/PhilippC/keepass2android/issues/544)
This commit is contained in:
@@ -48,7 +48,8 @@
|
||||
|
||||
|
||||
<!-- Preference settings -->
|
||||
<string name="algorithm_key">algorithm</string>
|
||||
<string name="AutoReturnFromQuery_key">AutoReturnFromQuery_key</string>
|
||||
<string name="algorithm_key">algorithm</string>
|
||||
<string name="app_key">app</string>
|
||||
<string name="app_timeout_key">app_timeout_key</string>
|
||||
<string name="show_kill_app_key">show_kill_app_key</string>
|
||||
|
||||
@@ -221,6 +221,8 @@
|
||||
<string name="edit">Edit</string>
|
||||
<string name="rijndael">Rijndael (AES)</string>
|
||||
<string name="root">Root</string>
|
||||
<string name="AutoReturnFromQuery_title">Automatically return from query screen</string>
|
||||
<string name="AutoReturnFromQuery_summary">When looking up an entry for an app or website: automatically return from query screen if there is only one matching entry in the database.</string>
|
||||
|
||||
<string name="KeyDerivFunc">Key derivation function</string>
|
||||
|
||||
|
||||
@@ -402,6 +402,14 @@
|
||||
|
||||
</Preference>
|
||||
|
||||
<CheckBoxPreference
|
||||
android:enabled="true"
|
||||
android:persistent="true"
|
||||
android:summary="@string/AutoReturnFromQuery_summary"
|
||||
android:defaultValue="true"
|
||||
android:title="@string/AutoReturnFromQuery_title"
|
||||
android:key="@string/AutoReturnFromQuery_key" />
|
||||
|
||||
</PreferenceScreen>
|
||||
<PreferenceScreen
|
||||
android:key="@string/QuickUnlock_prefs_key"
|
||||
|
||||
@@ -25,6 +25,7 @@ using Android.Runtime;
|
||||
using Android.Views;
|
||||
using Android.Widget;
|
||||
using Android.Content.PM;
|
||||
using Android.Preferences;
|
||||
using KeePassLib.Utility;
|
||||
|
||||
namespace keepass2android
|
||||
@@ -134,7 +135,7 @@ namespace keepass2android
|
||||
}
|
||||
|
||||
//if there is exactly one match: open the entry
|
||||
if ((Group.Entries.Count() == 1) && autoReturnFromQuery)
|
||||
if ((Group.Entries.Count() == 1) && autoReturnFromQuery && PreferenceManager.GetDefaultSharedPreferences(this).GetBoolean(GetString(Resource.String.AutoReturnFromQuery_key),true))
|
||||
{
|
||||
LaunchActivityForEntry(Group.Entries.Single(),0);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user