Skip to content
Snippets Groups Projects
Commit 296422d3 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

preferences: add TURN

Tuleap: #468
Change-Id: Ib89c0f37cb1f33e6007be58d791355884898cc3e
parent ff2ec20e
No related branches found
No related tags found
No related merge requests found
Showing
with 216 additions and 255 deletions
......@@ -96,9 +96,9 @@ public class AccountEditionActivity extends AppCompatActivity implements LocalSe
} else {
fragments.add(new Pair<String, Fragment>(getString(R.string.account_preferences_basic_tab), new GeneralAccountFragment()));
fragments.add(new Pair<String, Fragment>(getString(R.string.account_preferences_media_tab), new MediaPreferenceFragment()));
fragments.add(new Pair<String, Fragment>(getString(R.string.account_preferences_advanced_tab), new AdvancedAccountFragment()));
if(acc_selected.isSip())
{
fragments.add(new Pair<String, Fragment>(getString(R.string.account_preferences_advanced_tab), new AdvancedAccountFragment()));
fragments.add(new Pair<String, Fragment>(getString(R.string.account_preferences_security_tab), new SecurityAccountFragment()));
}
}
......@@ -174,17 +174,20 @@ public class AccountEditionActivity extends AppCompatActivity implements LocalSe
}
private void processAccount() {
final Account acc = acc_selected;
final IDRingService remote = getRemoteService();
getSupportActionBar().setTitle(acc.getAlias());;
service.getThreadPool().submit(new Runnable() {
@Override
public void run() {
try {
service.getRemoteService().setCredentials(acc_selected.getAccountID(), acc_selected.getCredentialsHashMapList());
Map<String, String> details = acc_selected.getDetails();
service.getRemoteService().setAccountDetails(acc_selected.getAccountID(), details);
Log.w(TAG, "service.setAccountDetails " + details.get("Account.hostname"));
getSupportActionBar().setTitle(acc_selected.getAlias());;
remote.setCredentials(acc.getAccountID(), acc.getCredentialsHashMapList());
remote.setAccountDetails(acc.getAccountID(), acc.getDetails());
} catch (RemoteException e) {
e.printStackTrace();
}
}
});
}
private AlertDialog createDeleteDialog() {
......
......
......@@ -28,22 +28,21 @@ import cx.ring.R;
import android.app.Activity;
import android.os.Bundle;
import android.support.v14.preference.EditTextPreferenceDialogFragment;
import android.support.v14.preference.PreferenceFragment;
import android.support.v14.preference.SwitchPreference;
import android.support.v7.preference.CheckBoxPreference;
import android.support.v7.preference.EditTextPreference;
import android.support.v7.preference.ListPreference;
import android.support.v7.preference.Preference;
import android.text.InputType;
import android.support.v7.preference.TwoStatePreference;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.view.inputmethod.EditorInfo;
import cx.ring.model.account.AccountDetail;
import cx.ring.model.account.AccountDetailAdvanced;
import cx.ring.model.account.Account;
import cx.ring.views.EditTextIntegerPreference;
import cx.ring.views.EditTextPreferenceDialog;
import cx.ring.views.PasswordPreference;
public class AdvancedAccountFragment extends PreferenceFragment {
......@@ -89,30 +88,17 @@ public class AdvancedAccountFragment extends PreferenceFragment {
}
}
public static class EditTextPreferenceDialog extends EditTextPreferenceDialogFragment {
public static EditTextPreferenceDialog newInstance(String key) {
final EditTextPreferenceDialog fragment = new EditTextPreferenceDialog();
final Bundle b = new Bundle(1);
b.putString(ARG_KEY, key);
fragment.setArguments(b);
return fragment;
}
@Override
protected void onBindDialogView(View view) {
super.onBindDialogView(view);
EditText text = (EditText)view.findViewById(android.R.id.edit);
text.setInputType(InputType.TYPE_CLASS_NUMBER);
}
}
@Override
public void onDisplayPreferenceDialog(Preference preference) {
if (getFragmentManager().findFragmentByTag(DIALOG_FRAGMENT_TAG) != null) {
return;
}
if (preference instanceof EditTextIntegerPreference) {
EditTextPreferenceDialog f = EditTextPreferenceDialog.newInstance(preference.getKey());
EditTextPreferenceDialog f = EditTextPreferenceDialog.newInstance(preference.getKey(), EditorInfo.TYPE_CLASS_NUMBER);
f.setTargetFragment(this, 0);
f.show(getFragmentManager(), DIALOG_FRAGMENT_TAG);
} else if (preference instanceof PasswordPreference) {
EditTextPreferenceDialog f = EditTextPreferenceDialog.newInstance(preference.getKey(), EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_PASSWORD);
f.setTargetFragment(this, 0);
f.show(getFragmentManager(), DIALOG_FRAGMENT_TAG);
} else {
......@@ -139,13 +125,8 @@ public class AdvancedAccountFragment extends PreferenceFragment {
pref.setSummary(p.mValue);
if (pref instanceof EditTextPreference)
((EditTextPreference) pref).setText(p.mValue);
} else if (pref.getKey().contentEquals(AccountDetailAdvanced.CONFIG_STUN_ENABLE)) {
((SwitchPreference) pref).setChecked(p.mValue.contentEquals("true"));
findPreference(AccountDetailAdvanced.CONFIG_STUN_SERVER).setEnabled(p.mValue.contentEquals("true"));
} else if (pref.getKey().contentEquals("Account.publishedSameAsLocal")) {
((CheckBoxPreference) pref).setChecked(p.mValue.contentEquals("true"));
findPreference(AccountDetailAdvanced.CONFIG_PUBLISHED_PORT).setEnabled(!p.mValue.contentEquals("true"));
findPreference(AccountDetailAdvanced.CONFIG_PUBLISHED_ADDRESS).setEnabled(!p.mValue.contentEquals("true"));
} else {
((TwoStatePreference) pref).setChecked(p.mValue.contentEquals("true"));
}
}
}
......@@ -170,7 +151,7 @@ public class AdvancedAccountFragment extends PreferenceFragment {
result.add(i.getDisplayName());
}
} catch (SocketException e) {
Log.e(TAG, e.toString());
Log.e(TAG, "Error enumerating interfaces: ", e);
}
return result;
}
......@@ -178,26 +159,24 @@ public class AdvancedAccountFragment extends PreferenceFragment {
Preference.OnPreferenceChangeListener changeAdvancedPreferenceListener = new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
Account acc = mCallbacks.getAccount();
if (preference instanceof CheckBoxPreference) {
mCallbacks.getAccount().getAdvancedDetails().setDetailString(preference.getKey(), newValue.toString());
if (preference.getKey().contentEquals(AccountDetailAdvanced.CONFIG_STUN_ENABLE)) {
findPreference(AccountDetailAdvanced.CONFIG_STUN_SERVER).setEnabled((Boolean) newValue);
} else if (preference.getKey().contentEquals(AccountDetailAdvanced.CONFIG_PUBLISHED_SAMEAS_LOCAL)) {
findPreference(AccountDetailAdvanced.CONFIG_PUBLISHED_PORT).setEnabled(!(Boolean) newValue);
findPreference(AccountDetailAdvanced.CONFIG_PUBLISHED_ADDRESS).setEnabled(!(Boolean) newValue);
}
} else {
Log.i(TAG, "Changing " + preference.getKey() + " value: " + newValue);
if (preference instanceof TwoStatePreference) {
acc.getAdvancedDetails().setDetailString(preference.getKey(), newValue.toString());
} else if (preference instanceof PasswordPreference) {
acc.getAdvancedDetails().setDetailString(preference.getKey(), newValue.toString());
preference.setSummary(TextUtils.isEmpty(newValue.toString()) ? "" : "******");
} else {
if (preference.getKey().contentEquals(AccountDetailAdvanced.CONFIG_AUDIO_PORT_MAX) ||
preference.getKey().contentEquals(AccountDetailAdvanced.CONFIG_AUDIO_PORT_MIN))
newValue = adjustRtpRange(Integer.valueOf((String) newValue));
preference.setSummary(newValue.toString());
mCallbacks.getAccount().getAdvancedDetails().setDetailString(preference.getKey(), newValue.toString());
acc.getAdvancedDetails().setDetailString(preference.getKey(), newValue.toString());
}
mCallbacks.getAccount().notifyObservers();
acc.notifyObservers();
return true;
}
};
......
......
......@@ -2,7 +2,7 @@
* Copyright (C) 2004-2016 Savoir-faire Linux Inc.
*
* Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
* Author: Adrien Béraud <adrien.beraud@savoirfairelinux.com>
* Adrien Béraud <adrien.beraud@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
......@@ -15,8 +15,7 @@
* 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.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package cx.ring.fragments;
......@@ -24,6 +23,8 @@ import cx.ring.R;
import cx.ring.model.account.AccountDetail;
import cx.ring.model.account.AccountDetailBasic;
import cx.ring.model.account.Account;
import cx.ring.views.EditTextIntegerPreference;
import cx.ring.views.EditTextPreferenceDialog;
import cx.ring.views.PasswordPreference;
import android.app.Activity;
......@@ -33,10 +34,13 @@ import android.support.v7.preference.EditTextPreference;
import android.support.v7.preference.Preference;
import android.support.v7.preference.TwoStatePreference;
import android.util.Log;
import android.view.inputmethod.EditorInfo;
public class GeneralAccountFragment extends PreferenceFragment {
private static final String TAG = GeneralAccountFragment.class.getSimpleName();
private static final String DIALOG_FRAGMENT_TAG = "android.support.v14.preference.PreferenceFragment.DIALOG";
private Callbacks mCallbacks = sDummyCallbacks;
private static final Callbacks sDummyCallbacks = new Callbacks() {
@Override
......@@ -79,6 +83,24 @@ public class GeneralAccountFragment extends PreferenceFragment {
}
}
@Override
public void onDisplayPreferenceDialog(Preference preference) {
if (getFragmentManager().findFragmentByTag(DIALOG_FRAGMENT_TAG) != null) {
return;
}
if (preference instanceof EditTextIntegerPreference) {
EditTextPreferenceDialog f = EditTextPreferenceDialog.newInstance(preference.getKey(), EditorInfo.TYPE_CLASS_NUMBER);
f.setTargetFragment(this, 0);
f.show(getFragmentManager(), DIALOG_FRAGMENT_TAG);
} else if (preference instanceof PasswordPreference) {
EditTextPreferenceDialog f = EditTextPreferenceDialog.newInstance(preference.getKey(), EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_PASSWORD);
f.setTargetFragment(this, 0);
f.show(getFragmentManager(), DIALOG_FRAGMENT_TAG);
} else {
super.onDisplayPreferenceDialog(preference);
}
}
private void setPreferenceDetails(AccountDetail details) {
for (AccountDetail.PreferenceEntry p : details.getDetailValues()) {
Preference pref = findPreference(p.mKey);
......
......
......@@ -51,6 +51,12 @@ public class AccountDetailAdvanced implements AccountDetail {
public static final String CONFIG_STUN_SERVER = "STUN.server";
public static final String CONFIG_STUN_ENABLE = "STUN.enable";
public static final String CONFIG_TURN_ENABLE = "TURN.enable";
public static final String CONFIG_TURN_SERVER = "TURN.server";
public static final String CONFIG_TURN_USERNAME = "TURN.username";
public static final String CONFIG_TURN_PASSWORD = "TURN.password";
public static final String CONFIG_TURN_REALM = "TURN.realm";
public static final String CONFIG_AUDIO_PORT_MIN = "Account.audioPortMin";
public static final String CONFIG_AUDIO_PORT_MAX = "Account.audioPortMax";
......@@ -64,13 +70,14 @@ public class AccountDetailAdvanced implements AccountDetail {
CONFIG_LOCAL_INTERFACE, CONFIG_PUBLISHED_SAMEAS_LOCAL, CONFIG_LOCAL_PORT,
CONFIG_PUBLISHED_PORT, CONFIG_PUBLISHED_ADDRESS,
CONFIG_STUN_SERVER, CONFIG_STUN_ENABLE,
CONFIG_TURN_ENABLE, CONFIG_TURN_SERVER, CONFIG_TURN_USERNAME, CONFIG_TURN_PASSWORD, CONFIG_TURN_REALM,
CONFIG_AUDIO_PORT_MIN, CONFIG_AUDIO_PORT_MAX));
private static final Set<String> TWO_STATES = new HashSet<>(Arrays.asList(
CONFIG_RINGTONE_ENABLED,
CONFIG_KEEP_ALIVE_ENABLED,
CONFIG_PUBLISHED_SAMEAS_LOCAL,
CONFIG_STUN_ENABLE));
CONFIG_STUN_ENABLE, CONFIG_TURN_ENABLE));
private ArrayList<AccountDetail.PreferenceEntry> privateArray;
......
......
/*
* Copyright (C) 2004-2016 Savoir-faire Linux Inc.
*
* Author: Adrien Béraud <adrien.beraud@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, see <http://www.gnu.org/licenses/>.
*/
package cx.ring.views;
import android.content.Context;
......@@ -6,40 +25,19 @@ import android.util.AttributeSet;
public class EditTextIntegerPreference extends EditTextPreference {
//private Integer mInteger;
public EditTextIntegerPreference(Context context, AttributeSet attrs, int defStyleAttr,
int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
public EditTextIntegerPreference(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
//getEditText().setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_SIGNED);
}
public EditTextIntegerPreference(Context context, AttributeSet attrs) {
super(context, attrs);
//getEditText().setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_SIGNED);
}
public EditTextIntegerPreference(Context context) {
super(context);
//getEditText().setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_SIGNED);
}
/*@Override public void setText(String text) {
final boolean wasBlocking = shouldDisableDependents();
mInteger = parseInteger(text);
persistString(mInteger != null ? mInteger.toString() : null);
final boolean isBlocking = shouldDisableDependents();
if (isBlocking != wasBlocking) notifyDependencyChange(isBlocking);
}
@Override public String getText() {
return mInteger != null ? mInteger.toString() : null;
}
private static Integer parseInteger(String text) {
try { return Integer.parseInt(text); }
catch (NumberFormatException e) { return null; }
} */
}
package cx.ring.views;
import android.os.Bundle;
import android.support.v14.preference.EditTextPreferenceDialogFragment;
import android.view.View;
import android.widget.EditText;
public class EditTextPreferenceDialog extends EditTextPreferenceDialogFragment {
private static final String ARG_TYPE = "inputType";
public static EditTextPreferenceDialog newInstance(String key, int type) {
final EditTextPreferenceDialog fragment = new EditTextPreferenceDialog();
final Bundle b = new Bundle(1);
b.putString(ARG_KEY, key);
b.putInt(ARG_TYPE, type);
fragment.setArguments(b);
return fragment;
}
@Override
protected void onBindDialogView(View view) {
super.onBindDialogView(view);
EditText text = (EditText) view.findViewById(android.R.id.edit);
text.setInputType(getArguments().getInt(ARG_TYPE));
}
}
......@@ -2,6 +2,7 @@
* Copyright (C) 2004-2016 Savoir-faire Linux Inc.
*
* Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
* Adrien Béraud <adrien.beraud@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
......@@ -14,37 +15,16 @@
* 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.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package cx.ring.views;
import cx.ring.R;
import cx.ring.utils.Compatibility;
import android.content.Context;
import android.support.v7.preference.EditTextPreference;
import android.support.v7.preference.PreferenceViewHolder;
import android.view.View.OnClickListener;
import android.text.Editable;
import android.text.InputType;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.widget.CheckBox;
public class PasswordPreference extends EditTextPreference implements OnClickListener, TextWatcher {
private static final String THIS_FILE = "PasswordPreference";
private CheckBox showPwdCheckbox;
private boolean canShowPassword = false;
public class PasswordPreference extends EditTextPreference {
public PasswordPreference(Context context) {
this(context, null);
......@@ -54,90 +34,13 @@ public class PasswordPreference extends EditTextPreference implements OnClickLis
super(context, attrs);
}
/*@Override
protected void onAddEditTextToDialogView(View dialogView, EditText editText) {
//super.onAddEditTextToDialogView(dialogView, editText);
editText.addTextChangedListener(this);
}*/
@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
super.onBindViewHolder(holder);
try {
if (showPwdCheckbox == null) {
showPwdCheckbox = new CheckBox(getContext());
showPwdCheckbox.setText(R.string.show_password);
showPwdCheckbox.setOnClickListener(this);
}
canShowPassword = TextUtils.isEmpty(getText());
/*set
setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
updateCanShowPassword();
ViewParent oldParent = showPwdCheckbox.getParent();
if (oldParent != view) {
if (oldParent != null) {
((ViewGroup) oldParent).removeView(showPwdCheckbox);
}
}
ViewGroup container = (ViewGroup) view;
if (Compatibility.isCompatible(8)) {
container = (ViewGroup) container.getChildAt(0);
}
if (container != null) {
container.addView(showPwdCheckbox, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
}*/
} catch (Exception e) {
// Just do nothing in case weird ROM in use
Log.w(THIS_FILE, "Unsupported device for enhanced password", e);
}
}
@Override
public void onClick(View view) {
if (!canShowPassword) {
// Even if not shown, be very very sure we never come here
return;
}
/*getEditText().setInputType(
InputType.TYPE_CLASS_TEXT
| (((CheckBox) view).isChecked() ? InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD : InputType.TYPE_TEXT_VARIATION_PASSWORD));*/
}
@Override
public void setText(String text) {
super.setText(text);
setCanShowPassword(TextUtils.isEmpty(text));
}
private void updateCanShowPassword() {
if (showPwdCheckbox != null) {
showPwdCheckbox.setVisibility(canShowPassword ? View.VISIBLE : View.GONE);
}
}
private void setCanShowPassword(boolean canShow) {
canShowPassword = canShow;
updateCanShowPassword();
}
@Override
public void afterTextChanged(Editable s) {
if (s.length() == 0) {
setCanShowPassword(true);
}
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
// Nothing to do
public PasswordPreference(Context context, AttributeSet attrs, int defStyleAttr,
int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
// Nothing to do
public PasswordPreference(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
}
\ No newline at end of file
......@@ -90,11 +90,17 @@ along with this program; if not, write to the Free Software
<string name="account_local_port_label">Local Port</string>
<string name="account_stun_enable_label">Use Stun</string>
<string name="account_stun_server_label">Stun Server</string>
<string name="account_turn_enable_label">Use TURN</string>
<string name="account_turn_server_label">TURN server</string>
<string name="account_turn_username_label">TURN username</string>
<string name="account_turn_password_label">TURN password</string>
<string name="account_turn_realm_label">TURN realm</string>
<string name="account_published_same_as_local_label">Published same as local</string>
<string name="account_published_port_label">Published Port</string>
<string name="account_published_address_label">Published Address</string>
<!-- Security Details -->
<string name="account_credentials_label">Credentials</string>
<string name="account_credentials_edit">Edit credentials</string>
......
......
......@@ -2,7 +2,7 @@
Copyright (C) 2004-2016 Savoir-faire Linux Inc.
Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
Author: Adrien Béraud <adrien.beraud@savoirfairelinux.com>
Adrien Béraud <adrien.beraud@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
......@@ -17,8 +17,7 @@ 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, see <http://www.gnu.org/licenses/>.
-->
<android.support.v7.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/cx.ring">
<android.support.v7.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<cx.ring.views.EditTextIntegerPreference
android:id="@+id/account_registration_expire"
......@@ -55,12 +54,47 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<android.support.v7.preference.EditTextPreference
android:id="@+id/account_stun_server"
android:defaultValue=""
android:enabled="false"
android:dependency="STUN.enable"
android:key="STUN.server"
android:persistent="false"
android:summary=""
android:title="@string/account_stun_server_label" />
<android.support.v14.preference.SwitchPreference
android:id="@+id/account_turn_enable"
android:key="TURN.enable"
android:persistent="false"
android:summaryOff="Disabled"
android:summaryOn="Enabled"
android:title="@string/account_turn_enable_label" />
<android.support.v7.preference.EditTextPreference
android:id="@+id/account_turn_server"
android:defaultValue=""
android:dependency="TURN.enable"
android:key="TURN.server"
android:persistent="false"
android:summary=""
android:title="@string/account_turn_server_label" />
<android.support.v7.preference.EditTextPreference
android:id="@+id/account_turn_username"
android:defaultValue=""
android:dependency="TURN.enable"
android:key="TURN.username"
android:persistent="false"
android:summary=""
android:title="@string/account_turn_username_label" />
<cx.ring.views.PasswordPreference
android:id="@+id/account_turn_password"
android:defaultValue=""
android:dependency="TURN.enable"
android:key="TURN.password"
android:persistent="false"
android:summary=""
android:title="@string/account_turn_password_label" />
<android.support.v7.preference.CheckBoxPreference
android:id="@+id/account_published_sameas_local"
android:key="Account.publishedSameAsLocal"
......@@ -70,14 +104,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<cx.ring.views.EditTextIntegerPreference
android:id="@+id/account_published_port"
android:defaultValue="5060"
android:enabled="false"
android:dependency="Account.publishedSameAsLocal"
android:key="Account.publishedPort"
android:persistent="false"
android:title="@string/account_published_port_label" />
<android.support.v7.preference.EditTextPreference
android:id="@+id/account_published_address"
android:enabled="false"
android:dependency="Account.publishedSameAsLocal"
android:key="Account.publishedAddress"
android:persistent="false"
android:title="@string/account_published_address_label" />
......
......
......@@ -2,6 +2,7 @@
Copyright (C) 2004-2016 Savoir-faire Linux Inc.
Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
Adrien Béraud <adrien.beraud@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
......@@ -14,27 +15,19 @@ 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.
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<android.support.v7.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<android.support.v7.preference.PreferenceCategory
android:id="@+id/account_credentials_category"
android:key="Account.credentials"
android:title="@string/account_credentials_label">
<!--<android.support.v7.preference.Preference
android:id="@+id/account_credential_number"
android:key="Credential.count"
android:title="@string/account_credentials_label">
</android.support.v7.preference.Preference>-->
<cx.ring.views.CredentialsPreference
android:id="@+id/account_credential_number"
android:icon="@drawable/ic_action_new_dark"
android:key="Add.credentials"
android:title="@string/account_credentials_add" />
</android.support.v7.preference.PreferenceCategory>
<android.support.v7.preference.PreferenceCategory
......@@ -45,104 +38,94 @@ along with this program; if not, write to the Free Software
<android.support.v14.preference.SwitchPreference
android:id="@+id/account_tls_switch_tls"
android:key="TLS.enable"
android:title="@string/account_tls_transport_switch_label"
android:persistent="false" />
android:persistent="false"
android:title="@string/account_tls_transport_switch_label" />
<cx.ring.views.EditTextIntegerPreference
android:id="@+id/account_tls_port"
android:dependency="TLS.enable"
android:key="TLS.listenerPort"
android:persistent="false"
android:title="@string/account_tls_port_label"
android:dependency="TLS.enable"
/>
android:title="@string/account_tls_port_label" />
<android.support.v7.preference.Preference
android:id="@+id/account_tls_certificate_list_file"
android:dependency="TLS.enable"
android:key="TLS.certificateListFile"
android:persistent="false"
android:title="@string/account_tls_certificate_list_label"
android:dependency="TLS.enable"
/>
android:title="@string/account_tls_certificate_list_label" />
<android.support.v7.preference.Preference
android:id="@+id/account_tls_certificate_file"
android:dependency="TLS.enable"
android:key="TLS.certificateFile"
android:persistent="false"
android:title="@string/account_tls_certificate_file_label"
android:dependency="TLS.enable"
/>
android:title="@string/account_tls_certificate_file_label" />
<android.support.v7.preference.Preference
android:id="@+id/account_tls_private_key_file"
android:dependency="TLS.enable"
android:key="TLS.privateKeyFile"
android:persistent="false"
android:title="@string/account_tls_private_key_file_label"
android:dependency="TLS.enable"
/>
android:title="@string/account_tls_private_key_file_label" />
<android.support.v7.preference.EditTextPreference
android:id="@+id/account_tls_password"
android:dependency="TLS.enable"
android:key="TLS.password"
android:persistent="false"
android:singleLine="true"
android:title="@string/account_tls_password_label"
android:dependency="TLS.enable"
/>
android:title="@string/account_tls_password_label" />
<android.support.v7.preference.ListPreference
android:id="@+id/account_tls_method"
android:dependency="TLS.enable"
android:key="TLS.method"
android:persistent="false"
android:title="@string/account_tls_method_label"
android:dependency="TLS.enable"
/>
android:title="@string/account_tls_method_label" />
<android.support.v7.preference.EditTextPreference
android:id="@+id/account_tls_ciphers"
android:dependency="TLS.enable"
android:key="TLS.ciphers"
android:persistent="false"
android:title="@string/account_tls_ciphers_label"
android:dependency="TLS.enable"
/>
android:title="@string/account_tls_ciphers_label" />
<android.support.v7.preference.EditTextPreference
android:id="@+id/account_tls_server_name"
android:dependency="TLS.enable"
android:key="TLS.serverName"
android:persistent="false"
android:singleLine="true"
android:title="@string/account_tls_server_name_label"
android:dependency="TLS.enable"
/>
android:title="@string/account_tls_server_name_label" />
<cx.ring.views.EditTextIntegerPreference
android:id="@+id/account_tls_timeout_sec"
android:dependency="TLS.enable"
android:key="TLS.negotiationTimeoutSec"
android:persistent="false"
android:title="@string/account_tls_negotiation_timeout_sec"
android:dependency="TLS.enable"
/>
android:title="@string/account_tls_negotiation_timeout_sec" />
<android.support.v7.preference.CheckBoxPreference
android:id="@+id/account_tls_verify_server"
android:dependency="TLS.enable"
android:key="TLS.verifyServer"
android:persistent="false"
android:title="@string/account_tls_verify_server_label"
android:dependency="TLS.enable"
/>
android:title="@string/account_tls_verify_server_label" />
<android.support.v7.preference.CheckBoxPreference
android:id="@+id/account_tls_verify_client"
android:dependency="TLS.enable"
android:key="TLS.verifyClient"
android:persistent="false"
android:title="@string/account_tls_verify_client_label"
android:dependency="TLS.enable"
/>
android:title="@string/account_tls_verify_client_label" />
<android.support.v7.preference.CheckBoxPreference
android:id="@+id/account_tls_require_client_cert"
android:dependency="TLS.enable"
android:key="TLS.requireClientCertificate"
android:persistent="false"
android:title="TLS Require Client Certificate"
android:dependency="TLS.enable"
/>
android:title="TLS Require Client Certificate" />
</android.support.v7.preference.PreferenceCategory>
</android.support.v7.preference.PreferenceScreen>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment