Skip to content
Snippets Groups Projects
Commit 2b587a0b authored by Adrien Béraud's avatar Adrien Béraud Committed by Pierre Nicolas
Browse files

account settings: allow to disable proxy list

GitLab: #1720
Change-Id: Ia286ea86dbc7f473370f126db4eba8378b0fb1cf
parent 1a319d03
No related branches found
No related tags found
No related merge requests found
...@@ -145,6 +145,7 @@ along with this program; if not, write to the Free Software ...@@ -145,6 +145,7 @@ along with this program; if not, write to the Free Software
<string name="enabled">Enabled</string> <string name="enabled">Enabled</string>
<string name="account_proxy_label">DHT proxy</string> <string name="account_proxy_label">DHT proxy</string>
<string name="account_proxy_enable_label">Use DHT proxy</string> <string name="account_proxy_enable_label">Use DHT proxy</string>
<string name="account_proxy_list_enable_label">Use DHT proxy list</string>
<string name="account_proxy_server_label">DHT proxy address</string> <string name="account_proxy_server_label">DHT proxy address</string>
<string name="account_proxy_server_list_label">DHT proxy list URL</string> <string name="account_proxy_server_list_label">DHT proxy list URL</string>
<string name="account_proxy_server_used">Using: %1$s</string> <string name="account_proxy_server_used">Using: %1$s</string>
......
...@@ -14,7 +14,8 @@ GNU General Public License for more details. ...@@ -14,7 +14,8 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
--> -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<EditTextPreference <EditTextPreference
android:key="Account.hostname" android:key="Account.hostname"
...@@ -61,13 +62,23 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -61,13 +62,23 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:summary="" android:summary=""
android:title="@string/account_proxy_server_label" /> android:title="@string/account_proxy_server_label" />
<SwitchPreferenceCompat
android:icon="@drawable/baseline_article_24"
android:dependency="Account.proxyEnabled"
android:key="Account.proxyListEnabled"
android:persistent="false"
android:summaryOff="@string/disabled"
android:summaryOn="@string/enabled"
android:title="@string/account_proxy_list_enable_label" />
<EditTextPreference <EditTextPreference
android:defaultValue="" android:defaultValue=""
android:dependency="Account.proxyEnabled" android:dependency="Account.proxyListEnabled"
android:key="Account.dhtProxyListUrl" android:key="Account.dhtProxyListUrl"
android:persistent="false" android:persistent="false"
android:summary="" android:summary=""
android:title="@string/account_proxy_server_list_label"/> android:title="@string/account_proxy_server_list_label"/>
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory android:title="@string/account_peer_discovery_label"> <PreferenceCategory android:title="@string/account_peer_discovery_label">
......
...@@ -94,6 +94,7 @@ enum class ConfigKey(val key: String, val isBool: Boolean = false) { ...@@ -94,6 +94,7 @@ enum class ConfigKey(val key: String, val isBool: Boolean = false) {
DHT_PORT("DHT.port"), DHT_PORT("DHT.port"),
DHT_PUBLIC_IN("DHT.PublicInCalls", true), DHT_PUBLIC_IN("DHT.PublicInCalls", true),
PROXY_ENABLED("Account.proxyEnabled", true), PROXY_ENABLED("Account.proxyEnabled", true),
PROXY_LIST_ENABLED("Account.proxyListEnabled", true),
PROXY_SERVER("Account.proxyServer"), PROXY_SERVER("Account.proxyServer"),
PROXY_SERVER_LIST("Account.dhtProxyListUrl"), PROXY_SERVER_LIST("Account.dhtProxyListUrl"),
PROXY_PUSH_TOKEN("Account.proxyPushToken"), PROXY_PUSH_TOKEN("Account.proxyPushToken"),
...@@ -104,7 +105,7 @@ enum class ConfigKey(val key: String, val isBool: Boolean = false) { ...@@ -104,7 +105,7 @@ enum class ConfigKey(val key: String, val isBool: Boolean = false) {
UI_CUSTOMIZATION("Account.uiCustomization"); UI_CUSTOMIZATION("Account.uiCustomization");
companion object { companion object {
private val keyMap = values().associateByTo(HashMap(values().size)) { it.key } private val keyMap = entries.associateByTo(HashMap(entries.size)) { it.key }
fun fromString(stringKey: String): ConfigKey? = keyMap[stringKey] fun fromString(stringKey: String): ConfigKey? = keyMap[stringKey]
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment