* #40232: add more traductions (en/fr) to tls settings, better refresh
preferences
There are still some missing traductions in general account settings.
diff --git a/res/values-fr/strings_account.xml b/res/values-fr/strings_account.xml
index 8a9bbee..076293b 100644
--- a/res/values-fr/strings_account.xml
+++ b/res/values-fr/strings_account.xml
@@ -1,3 +1,34 @@
+<!--
+Copyright (C) 2004-2014 Savoir-Faire Linux Inc.
+
+Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Additional permission under GNU GPL version 3 section 7:
+
+If you modify this program, or any covered work, by linking or
+combining it with the OpenSSL project's OpenSSL library (or a
+modified version of that library), containing parts covered by the
+terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
+grants you additional permission to convey the resulting work.
+Corresponding Source for a non-source form of such a combination
+shall include the source code for the parts of OpenSSL used as well
+as that of the covered work.
+-->
+
<resources>
<!-- Strings related to login -->
@@ -65,22 +96,22 @@
<string name="account_display_sas_once_label">Display SAS Once</string>
<!-- TLS Details -->
+ <string name="account_tls_transport_switch_label">Utiliser le transport TLS</string>
<string name="account_tls_enabled_label">TLS activé</string>
<string name="account_tls_disabled_label">TLS désactivé</string>
<string name="account_tls_port_label">Port TLS Global</string>
- <string name="account_tls_certificate_list_label">TLS Certificate List File</string>
- <string name="account_tls_certificate_file_label">TLS Certificate File</string>
- <string name="account_tls_private_key_file_label">TLS Private Key File</string>
- <string name="account_tls_password_label">TLS Private Key Password</string>
+ <string name="account_tls_certificate_list_label">Autorité de certification</string>
+ <string name="account_tls_certificate_file_label">Certificat</string>
+ <string name="account_tls_private_key_file_label">Clé privée</string>
+ <string name="account_tls_password_label">Mot de passe de la clé</string>
<string name="account_tls_method_label">Méthode pour TLS</string>
<string name="account_tls_method_default">Défaut</string>
<string name="account_tls_ciphers_label">Cryptogrammes TLS</string>
- <string name="account_tls_server_name_label">TLS Server Name</string>
- <string name="account_tls_verify_label">TLS Verify Server</string>
+ <string name="account_tls_server_name_label">Serveur pour connections sortantes</string>
+ <string name="account_tls_verify_server_label">TLS Verify Server</string>
<string name="account_tls_verify_client_label">TLS Verify Client</string>
- <string name="account_tls_require_client_certificat_label">TLS Require Client Certificate</string>
- <string name="account_tls_negotiation_timeout_sec">TLS Negotiation Timeout (sec)</string>
- <string name="account_tls_negotiation_timeout_msec">TLS Negotiation Timeout (msec)</string>
+ <string name="account_tls_require_client_certificat_label">Exiger un certificat opur les connexions entrantes</string>
+ <string name="account_tls_negotiation_timeout_sec">Negotiation Timeout (sec)</string>
</resources>
\ No newline at end of file
diff --git a/res/values/strings_account.xml b/res/values/strings_account.xml
index 73bc700..2b14cd6 100644
--- a/res/values/strings_account.xml
+++ b/res/values/strings_account.xml
@@ -1,3 +1,34 @@
+<!--
+Copyright (C) 2004-2014 Savoir-Faire Linux Inc.
+
+Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Additional permission under GNU GPL version 3 section 7:
+
+If you modify this program, or any covered work, by linking or
+combining it with the OpenSSL project's OpenSSL library (or a
+modified version of that library), containing parts covered by the
+terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
+grants you additional permission to convey the resulting work.
+Corresponding Source for a non-source form of such a combination
+shall include the source code for the parts of OpenSSL used as well
+as that of the covered work.
+-->
+
<resources>
<!-- Strings related to login -->
@@ -66,21 +97,21 @@
<!-- TLS Details -->
+ <string name="account_tls_transport_switch_label">Use TLS Transport</string>
<string name="account_tls_enabled_label">TLS enabled</string>
<string name="account_tls_disabled_label">TLS disabled</string>
<string name="account_tls_port_label">TLS Listener Port</string>
- <string name="account_tls_certificate_list_label">TLS Certificate List File</string>
- <string name="account_tls_certificate_file_label">TLS Certificate File</string>
- <string name="account_tls_private_key_file_label">TLS Private Key File</string>
- <string name="account_tls_password_label">TLS Private Key Password</string>
+ <string name="account_tls_certificate_list_label">Certification Authorities</string>
+ <string name="account_tls_certificate_file_label">Certificate File</string>
+ <string name="account_tls_private_key_file_label">Private Key File</string>
+ <string name="account_tls_password_label">Private Key Password</string>
<string name="account_tls_method_label">TLS Method</string>
<string name="account_tls_method_default">Default</string>
<string name="account_tls_ciphers_label">TLS Ciphers</string>
- <string name="account_tls_server_name_label">TLS Server Name</string>
- <string name="account_tls_verify_label">TLS Verify Server</string>
- <string name="account_tls_verify_client_label">TLS Verify Client</string>
- <string name="account_tls_require_client_certificat_label">TLS Require Client Certificate</string>
- <string name="account_tls_negotiation_timeout_sec">TLS Negotiation Timeout (sec)</string>
- <string name="account_tls_negotiation_timeout_msec">TLS Negotiation Timeout (msec)</string>
+ <string name="account_tls_server_name_label">Server Name</string>
+ <string name="account_tls_verify_server_label">Verify Server</string>
+ <string name="account_tls_verify_client_label">Verify Client</string>
+ <string name="account_tls_require_client_certificat_label">Require Client Certificate</string>
+ <string name="account_tls_negotiation_timeout_sec">Negotiation Timeout (sec)</string>
</resources>
\ No newline at end of file
diff --git a/res/xml/account_tls.xml b/res/xml/account_tls.xml
index ac2da3b..456766b 100644
--- a/res/xml/account_tls.xml
+++ b/res/xml/account_tls.xml
@@ -33,15 +33,15 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/org.sflphone" >
<CheckBoxPreference
- android:id="@+id/account_tls_verify_client"
+ android:id="@+id/account_tls_switch_tls"
android:key="TLS.enable"
- android:title="Use TLS Transport" />
+ android:title="@string/account_tls_transport_switch_label" />
<EditTextPreference
android:id="@+id/account_tls_listener_port"
android:key="TLS.listenerPort"
android:persistent="false"
- android:title="Listener Port" />
+ android:title="@string/account_tls_port_label" />
<org.sflphone.views.DoubleNumberPickerPreference
android:id="@+id/account_registration_expire"
@@ -59,68 +59,63 @@
android:id="@+id/account_tls_certificate_list_file"
android:key="TLS.certificateListFile"
android:persistent="false"
- android:title="TLS Certificate List File" />
+ android:title="@string/account_tls_certificate_list_label" />
<Preference
android:id="@+id/account_tls_certificate_file"
android:key="TLS.certificateFile"
android:persistent="false"
- android:title="TLS Certificate File" />
+ android:title="@string/account_tls_certificate_file_label" />
<Preference
android:id="@+id/account_tls_private_key_file"
android:key="TLS.privateKeyFile"
android:persistent="false"
- android:title="TLS Private Key File" />
+ android:title="@string/account_tls_private_key_file_label" />
<EditTextPreference
android:id="@+id/account_tls_password"
android:key="TLS.password"
android:persistent="false"
android:singleLine="true"
- android:title="TLS Password" />
+ android:title="@string/account_tls_password_label" />
<ListPreference
android:id="@+id/account_tls_method"
android:key="TLS.method"
android:entries="@array/tls_methods_entries"
android:entryValues="@array/tls_methods_values"
android:persistent="false"
- android:title="TLS Method" />
+ android:title="@string/account_tls_method_label" />
<EditTextPreference
android:id="@+id/account_tls_ciphers"
android:key="TLS.ciphers"
android:persistent="false"
- android:title="TLS Ciphers" />
+ android:title="@string/account_tls_ciphers_label" />
<EditTextPreference
android:id="@+id/account_tls_server_name"
android:key="TLS.serverName"
android:persistent="false"
android:singleLine="true"
- android:title="TLS Server Name" />
+ android:title="@string/account_tls_server_name_label" />
+
+ <EditTextPreference
+ android:id="@+id/account_tls_timeout_sec"
+ android:key="TLS.negotiationTimeoutSec"
+ android:persistent="false"
+ android:title="@string/account_tls_negotiation_timeout_sec" />
<CheckBoxPreference
android:id="@+id/account_tls_verify_server"
android:key="TLS.verifyServer"
android:persistent="false"
- android:title="TLS Verify Server" />
+ android:title="@string/account_tls_verify_server_label" />
<CheckBoxPreference
android:id="@+id/account_tls_verify_client"
android:key="TLS.verifyClient"
android:persistent="false"
- android:title="TLS Verify Client" />
+ android:title="@string/account_tls_verify_client_label" />
<CheckBoxPreference
android:id="@+id/account_tls_require_client_cert"
android:key="TLS.requireClientCertificate"
android:persistent="false"
android:title="TLS Require Client Certificate" />
- <EditTextPreference
- android:id="@+id/account_tls_timeout_sec"
- android:key="TLS.negotiationTimeoutSec"
- android:persistent="false"
- android:title="TLS Timeout Sec" />
- <EditTextPreference
- android:id="@+id/account_tls_timeout_msec"
- android:key="TLS.negotiationTimeoutMsec"
- android:persistent="false"
- android:title="TLS Timeout Msec" />
-
</PreferenceScreen>
\ No newline at end of file
diff --git a/src/org/sflphone/account/AccountCredentials.java b/src/org/sflphone/account/AccountCredentials.java
index 8d9a62a..e8182ae 100644
--- a/src/org/sflphone/account/AccountCredentials.java
+++ b/src/org/sflphone/account/AccountCredentials.java
@@ -28,6 +28,7 @@
public class AccountCredentials implements AccountDetail {
+ @SuppressWarnings("unused")
private static final String TAG = AccountCredentials.class.getSimpleName();
public static final String CONFIG_ACCOUNT_USERNAME = "Account.username";
diff --git a/src/org/sflphone/account/TLSManager.java b/src/org/sflphone/account/TLSManager.java
index 0fcdb56..b9e6198 100644
--- a/src/org/sflphone/account/TLSManager.java
+++ b/src/org/sflphone/account/TLSManager.java
@@ -66,36 +66,50 @@
for (int i = 0; i < mScreen.getPreferenceCount(); ++i) {
- if (mScreen.getPreference(i) instanceof CheckBoxPreference) {
+ Preference current = mScreen.getPreference(i);
+
+ if (current instanceof CheckBoxPreference) {
((CheckBoxPreference) mScreen.getPreference(i)).setChecked(mAccount.getTlsDetails().getDetailBoolean(
mScreen.getPreference(i).getKey()));
} else {
- mScreen.getPreference(i).setSummary(mAccount.getTlsDetails().getDetailString(mScreen.getPreference(i).getKey()));
+ if (current.getKey().contentEquals(AccountDetailTls.CONFIG_TLS_CA_LIST_FILE)){
+ current.setSummary(new File(mAccount.getTlsDetails().getDetailString(AccountDetailTls.CONFIG_TLS_CA_LIST_FILE)).getName());
+ current.setOnPreferenceClickListener(filePickerListener);
+ } else if(current.getKey().contentEquals(AccountDetailTls.CONFIG_TLS_PRIVATE_KEY_FILE)){
+ current.setSummary(new File(mAccount.getTlsDetails().getDetailString(AccountDetailTls.CONFIG_TLS_PRIVATE_KEY_FILE)).getName());
+ current.setOnPreferenceClickListener(filePickerListener);
+ } else if(current.getKey().contentEquals(AccountDetailTls.CONFIG_TLS_CERTIFICATE_FILE)) {
+ current.setSummary(new File(mAccount.getTlsDetails().getDetailString(AccountDetailTls.CONFIG_TLS_CERTIFICATE_FILE)).getName());
+ current.setOnPreferenceClickListener(filePickerListener);
+ } else {
+ current.setSummary(mAccount.getTlsDetails().getDetailString(mScreen.getPreference(i).getKey()));
+ }
+
}
- // First Preference should remain enabled, it's the actual switch
+ // First Preference should remain enabled, it's the actual switch TLS.enable
if(i > 0)
- mScreen.getPreference(i).setEnabled(activated);
+ current.setEnabled(activated);
- mScreen.getPreference(i).setOnPreferenceClickListener(new OnPreferenceClickListener() {
-
- @Override
- public boolean onPreferenceClick(Preference preference) {
- if (preference.getKey().contentEquals(AccountDetailTls.CONFIG_TLS_CA_LIST_FILE)){
- performFileSearch(SELECT_CA_LIST_RC);
- }
- if(preference.getKey().contentEquals(AccountDetailTls.CONFIG_TLS_PRIVATE_KEY_FILE)){
- performFileSearch(SELECT_PRIVATE_KEY_RC);
- }
- if(preference.getKey().contentEquals(AccountDetailTls.CONFIG_TLS_CERTIFICATE_FILE)) {
- performFileSearch(SELECT_CERTIFICATE_RC);
- }
- return false;
- }
- });
}
}
+ private OnPreferenceClickListener filePickerListener = new OnPreferenceClickListener() {
+ @Override
+ public boolean onPreferenceClick(Preference preference) {
+ if (preference.getKey().contentEquals(AccountDetailTls.CONFIG_TLS_CA_LIST_FILE)) {
+ performFileSearch(SELECT_CA_LIST_RC);
+ }
+ if (preference.getKey().contentEquals(AccountDetailTls.CONFIG_TLS_PRIVATE_KEY_FILE)) {
+ performFileSearch(SELECT_PRIVATE_KEY_RC);
+ }
+ if (preference.getKey().contentEquals(AccountDetailTls.CONFIG_TLS_CERTIFICATE_FILE)) {
+ performFileSearch(SELECT_CERTIFICATE_RC);
+ }
+ return true;
+ }
+ };
+
public void setTLSListener() {
for (int i = 0; i < mScreen.getPreferenceCount(); ++i) {
mScreen.getPreference(i).setOnPreferenceChangeListener(tlsListener);
diff --git a/src/org/sflphone/client/AccountEditionActivity.java b/src/org/sflphone/client/AccountEditionActivity.java
index 2c39ba5..037371d 100644
--- a/src/org/sflphone/client/AccountEditionActivity.java
+++ b/src/org/sflphone/client/AccountEditionActivity.java
@@ -159,7 +159,7 @@
if (toDisplay != null) {
getFragmentManager().beginTransaction().setCustomAnimations(R.animator.slidein_up, R.animator.slideout_down).remove(toDisplay).commit();
- ((SecurityAccountFragment) mPreferencesPagerAdapter.getItem(3)).setCredentialSummary();
+ ((SecurityAccountFragment) mPreferencesPagerAdapter.getItem(3)).updateSummaries();
toDisplay = null;
return;
}
@@ -190,7 +190,7 @@
if (toDisplay != null) {
getFragmentManager().beginTransaction().setCustomAnimations(R.animator.slidein_up, R.animator.slideout_down).remove(toDisplay)
.commit();
- ((SecurityAccountFragment) mPreferencesPagerAdapter.getItem(3)).setCredentialSummary();
+ ((SecurityAccountFragment) mPreferencesPagerAdapter.getItem(3)).updateSummaries();
toDisplay = null;
} else
finish();
diff --git a/src/org/sflphone/fragments/SecurityAccountFragment.java b/src/org/sflphone/fragments/SecurityAccountFragment.java
index e7547b2..b8a804a 100644
--- a/src/org/sflphone/fragments/SecurityAccountFragment.java
+++ b/src/org/sflphone/fragments/SecurityAccountFragment.java
@@ -104,6 +104,11 @@
@Override
public void onResume() {
super.onResume();
+ if(mCallbacks.getAccount().getTlsDetails().getDetailBoolean("TLS.enable")){
+ findPreference("TLS.details").setSummary(getString(R.string.account_tls_enabled_label));
+ } else {
+ findPreference("TLS.details").setSummary(getString(R.string.account_tls_disabled_label));
+ }
}
@@ -113,7 +118,7 @@
// Load the preferences from an XML resource
addPreferencesFromResource(R.xml.account_security_prefs);
- setCredentialSummary();
+ updateSummaries();
findPreference("Credential.count").setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
@@ -127,12 +132,6 @@
setSrtpPreferenceDetails(mCallbacks.getAccount().getSrtpDetails());
addPreferenceListener(mCallbacks.getAccount().getSrtpDetails(), changeSrtpModeListener);
- if(mCallbacks.getAccount().getTlsDetails().getDetailBoolean("TLS.enable")){
- findPreference("TLS.details").setSummary(getString(R.string.account_tls_enabled_label));
- } else {
- findPreference("TLS.details").setSummary(getString(R.string.account_tls_disabled_label));
- }
-
findPreference("TLS.details").setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
@@ -144,18 +143,23 @@
}
- public void setCredentialSummary() {
+ public void updateSummaries() {
findPreference("Credential.count").setSummary("" + mCallbacks.getAccount().getCredentials().size());
+ if(mCallbacks.getAccount().getTlsDetails().getDetailBoolean("TLS.enable")){
+ findPreference("TLS.details").setSummary(getString(R.string.account_tls_enabled_label));
+ } else {
+ findPreference("TLS.details").setSummary(getString(R.string.account_tls_disabled_label));
+ }
}
private void setSrtpPreferenceDetails(AccountDetailSrtp details) {
if (details.getDetailBoolean(AccountDetailSrtp.CONFIG_SRTP_ENABLE)) {
- findPreference("SRTP.enable").setSummary(
+ findPreference(AccountDetailSrtp.CONFIG_SRTP_ENABLE).setSummary(
details.getDetailString(AccountDetailSrtp.CONFIG_SRTP_KEY_EXCHANGE).toUpperCase(Locale.getDefault()));
} else {
- findPreference("SRTP.enable").setSummary(getResources().getString(R.string.account_srtp_deactivated));
+ findPreference(AccountDetailSrtp.CONFIG_SRTP_ENABLE).setSummary(getResources().getString(R.string.account_srtp_deactivated));
}
@@ -164,7 +168,7 @@
private void addPreferenceListener(AccountDetail details, OnPreferenceChangeListener listener) {
- findPreference("SRTP.enable").setOnPreferenceChangeListener(changeSrtpModeListener);
+ findPreference(AccountDetailSrtp.CONFIG_SRTP_ENABLE).setOnPreferenceChangeListener(changeSrtpModeListener);
findPreference("SRTP.details").setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override