diff options
author | Arne Schwabe <arne@rfc2549.org> | 2012-05-14 23:06:36 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2012-05-14 23:06:36 +0200 |
commit | e445ab7fdc6c3912291eaad7aac209b511bcd245 (patch) | |
tree | b925a150868fb635ab928a2e5e618f5e0bd46f85 /src/de/blinkt/openvpn/Settings_Authentication.java | |
parent | 320e9a6d8f9c5329a163db370c988db4bde011bf (diff) |
- Rework saving state of preferences fragment
- fix state of nobind not loaded (hopefully closes issue #19)
Version 0.5.4
Diffstat (limited to 'src/de/blinkt/openvpn/Settings_Authentication.java')
-rw-r--r-- | src/de/blinkt/openvpn/Settings_Authentication.java | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/de/blinkt/openvpn/Settings_Authentication.java b/src/de/blinkt/openvpn/Settings_Authentication.java index e8740b5d..6d6960e9 100644 --- a/src/de/blinkt/openvpn/Settings_Authentication.java +++ b/src/de/blinkt/openvpn/Settings_Authentication.java @@ -13,12 +13,11 @@ import android.preference.PreferenceFragment; import android.preference.SwitchPreference; -public class Settings_Authentication extends PreferenceFragment implements OnPreferenceChangeListener, OnPreferenceClickListener { +public class Settings_Authentication extends OpenVpnPreferencesFragment implements OnPreferenceChangeListener, OnPreferenceClickListener { private static final int SELECT_TLS_FILE = 23223232; private CheckBoxPreference mExpectTLSCert; private CheckBoxPreference mCheckRemoteCN; private EditTextPreference mRemoteCN; - private VpnProfile mProfile; private ListPreference mTLSAuthDirection; private Preference mTLSAuthFile; private SwitchPreference mUseTLSAuth; @@ -41,8 +40,7 @@ public class Settings_Authentication extends PreferenceFragment implements OnPre mTLSAuthFile = findPreference("tlsAuthFile"); mTLSAuthDirection = (ListPreference) findPreference("tls_direction"); - String profileUUID = getArguments().getString(getActivity().getPackageName() + ".profileUUID"); - mProfile = ProfileManager.get(profileUUID); + mTLSAuthFile.setOnPreferenceClickListener(this); mCipher =(EditTextPreference) findPreference("cipher"); @@ -52,7 +50,8 @@ public class Settings_Authentication extends PreferenceFragment implements OnPre } - private void loadSettings() { + @Override + protected void loadSettings() { mExpectTLSCert.setChecked(mProfile.mExpectTLSCert); mCheckRemoteCN.setChecked(mProfile.mCheckRemoteCN); @@ -67,7 +66,8 @@ public class Settings_Authentication extends PreferenceFragment implements OnPre onPreferenceChange(mCipher, mProfile.mCipher); } - private void saveSettings() { + @Override + protected void saveSettings() { mProfile.mExpectTLSCert=mExpectTLSCert.isChecked(); mProfile.mCheckRemoteCN=mCheckRemoteCN.isChecked(); mProfile.mRemoteCN=mRemoteCN.getText(); @@ -87,11 +87,7 @@ public class Settings_Authentication extends PreferenceFragment implements OnPre } - @Override - public void onPause() { - super.onPause(); - saveSettings(); - } + @Override public boolean onPreferenceChange(Preference preference, Object newValue) { |