mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-08-29 13:27:46 +00:00
chore: extract hard-coded preference strings
This commit is contained in:
parent
309d220bef
commit
4e178883f7
@ -6,6 +6,7 @@
|
|||||||
package app.passwordstore.ui.settings
|
package app.passwordstore.ui.settings
|
||||||
|
|
||||||
import androidx.fragment.app.FragmentActivity
|
import androidx.fragment.app.FragmentActivity
|
||||||
|
import app.passwordstore.R
|
||||||
import app.passwordstore.ui.pgp.PGPKeyImportActivity
|
import app.passwordstore.ui.pgp.PGPKeyImportActivity
|
||||||
import app.passwordstore.ui.pgp.PGPKeyListActivity
|
import app.passwordstore.ui.pgp.PGPKeyListActivity
|
||||||
import app.passwordstore.util.extensions.launchActivity
|
import app.passwordstore.util.extensions.launchActivity
|
||||||
@ -20,7 +21,7 @@ class PGPSettings(private val activity: FragmentActivity) : SettingsProvider {
|
|||||||
override fun provideSettings(builder: PreferenceScreen.Builder) {
|
override fun provideSettings(builder: PreferenceScreen.Builder) {
|
||||||
builder.apply {
|
builder.apply {
|
||||||
pref("_") {
|
pref("_") {
|
||||||
title = "Import PGP key"
|
titleRes = R.string.pref_import_pgp_key_title
|
||||||
persistent = false
|
persistent = false
|
||||||
onClick {
|
onClick {
|
||||||
activity.launchActivity(PGPKeyImportActivity::class.java)
|
activity.launchActivity(PGPKeyImportActivity::class.java)
|
||||||
@ -28,7 +29,7 @@ class PGPSettings(private val activity: FragmentActivity) : SettingsProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
pref("__") {
|
pref("__") {
|
||||||
title = "Key manager"
|
titleRes = R.string.pref_pgp_key_manager_title
|
||||||
persistent = false
|
persistent = false
|
||||||
onClick {
|
onClick {
|
||||||
activity.launchActivity(PGPKeyListActivity::class.java)
|
activity.launchActivity(PGPKeyListActivity::class.java)
|
||||||
@ -36,7 +37,7 @@ class PGPSettings(private val activity: FragmentActivity) : SettingsProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
switch(PreferenceKeys.ASCII_ARMOR) {
|
switch(PreferenceKeys.ASCII_ARMOR) {
|
||||||
title = "Encrypt in ASCII armor mode"
|
titleRes = R.string.pref_pgp_ascii_armor_title
|
||||||
persistent = true
|
persistent = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -126,10 +126,11 @@ class RepositorySettings(private val activity: FragmentActivity) : SettingsProvi
|
|||||||
visible = false
|
visible = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
when {
|
titleRes =
|
||||||
httpsPass != null -> titleRes = R.string.clear_saved_passphrase_https
|
when {
|
||||||
sshPass != null -> titleRes = R.string.clear_saved_passphrase_ssh
|
httpsPass != null -> R.string.clear_saved_passphrase_https
|
||||||
}
|
else -> R.string.clear_saved_passphrase_ssh
|
||||||
|
}
|
||||||
visible = true
|
visible = true
|
||||||
requestRebind()
|
requestRebind()
|
||||||
}
|
}
|
||||||
|
@ -131,6 +131,9 @@
|
|||||||
<string name="pref_rebase_on_pull_summary_on">When pulling or syncing, rebase commits that are not present in the remote repository</string>
|
<string name="pref_rebase_on_pull_summary_on">When pulling or syncing, rebase commits that are not present in the remote repository</string>
|
||||||
<string name="pref_disable_sync_on_pull_title">Disable pull to sync action</string>
|
<string name="pref_disable_sync_on_pull_title">Disable pull to sync action</string>
|
||||||
<string name="pref_disable_sync_on_pull_summary">Prevent pulling down on the password list from triggering a Git sync</string>
|
<string name="pref_disable_sync_on_pull_summary">Prevent pulling down on the password list from triggering a Git sync</string>
|
||||||
|
<string name="pref_import_pgp_key_title">Import PGP key</string>
|
||||||
|
<string name="pref_pgp_key_manager_title">Key manager</string>
|
||||||
|
<string name="pref_pgp_ascii_armor_title">Encrypt in ASCII armor mode</string>
|
||||||
|
|
||||||
<!-- PasswordGenerator fragment -->
|
<!-- PasswordGenerator fragment -->
|
||||||
<string name="pwgen_title">Generate Password</string>
|
<string name="pwgen_title">Generate Password</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user