Use Android picker for local vaults

This commit is contained in:
Joe Julian
2026-04-07 07:20:39 -07:00
parent a867ac4664
commit e88d1fd875
5 changed files with 83 additions and 4 deletions
+7 -3
View File
@@ -1140,13 +1140,17 @@ func labeledEditorHelp(th *material.Theme, label, help string, editor *widget.Ed
return labeledEditorHelpFocus(th, defaultAccessibilityPreferences(), label, help, editor, sensitive, false)
}
func localVaultPathHelp() string {
if supportsDesktopFilePicker(runtime.GOOS) {
func localVaultPathHelpForRuntime(goos string) string {
if supportsDesktopFilePicker(goos) || supportsSharedVaultImport(goos) {
return "Choose the existing .kdbx file to open."
}
return "Enter the shared-storage path to the existing .kdbx file, for example /sdcard/Download/vault.kdbx."
}
func localVaultPathHelp() string {
return localVaultPathHelpForRuntime(runtime.GOOS)
}
func keyFileHelp() string {
if supportsDesktopFilePicker(runtime.GOOS) {
return "Optional path to a KeePass-compatible key file."
@@ -1155,7 +1159,7 @@ func keyFileHelp() string {
}
func localPathSelector(th *material.Theme, editor *widget.Editor, click *widget.Clickable) layout.Widget {
if supportsDesktopFilePicker(runtime.GOOS) {
if supportsDesktopFilePicker(runtime.GOOS) || supportsSharedVaultImport(runtime.GOOS) {
return selectorEditorHelp(th, "Vault Path", localVaultPathHelp(), editor, click, "Choose File", false)
}
return labeledEditorHelp(th, "Vault Path", localVaultPathHelp(), editor, false)