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_Obscure.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_Obscure.java')
-rw-r--r-- | src/de/blinkt/openvpn/Settings_Obscure.java | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/de/blinkt/openvpn/Settings_Obscure.java b/src/de/blinkt/openvpn/Settings_Obscure.java index fd3b540d..aed61392 100644 --- a/src/de/blinkt/openvpn/Settings_Obscure.java +++ b/src/de/blinkt/openvpn/Settings_Obscure.java @@ -6,10 +6,8 @@ import android.preference.EditTextPreference; import android.preference.ListPreference; import android.preference.Preference; import android.preference.Preference.OnPreferenceChangeListener; -import android.preference.PreferenceFragment; -public class Settings_Obscure extends PreferenceFragment implements OnPreferenceChangeListener { - private VpnProfile mProfile; +public class Settings_Obscure extends OpenVpnPreferencesFragment implements OnPreferenceChangeListener { private CheckBoxPreference mUseRandomHostName; private CheckBoxPreference mUseFloat; private CheckBoxPreference mUseCustomConfig; @@ -22,9 +20,6 @@ public class Settings_Obscure extends PreferenceFragment implements OnPreference // Load the preferences from an XML resource addPreferencesFromResource(R.xml.vpn_obscure); - String profileUUID = getArguments().getString(getActivity().getPackageName() + ".profileUUID"); - mProfile = ProfileManager.get(profileUUID); - mUseRandomHostName = (CheckBoxPreference) findPreference("useRandomHostname"); mUseFloat = (CheckBoxPreference) findPreference("useFloat"); @@ -39,7 +34,7 @@ public class Settings_Obscure extends PreferenceFragment implements OnPreference } - private void loadSettings() { + protected void loadSettings() { mUseRandomHostName.setChecked(mProfile.mUseRandomHostname); mUseFloat.setChecked(mProfile.mUseFloat); mUseCustomConfig.setChecked(mProfile.mUseCustomConfig); @@ -49,13 +44,8 @@ public class Settings_Obscure extends PreferenceFragment implements OnPreference onPreferenceChange(mLogverbosity, mProfile.mVerb); } - @Override - public void onPause() { - saveSettings(); - super.onPause(); - } - private void saveSettings() { + protected void saveSettings() { mProfile.mUseRandomHostname = mUseRandomHostName.isChecked(); mProfile.mUseFloat = mUseFloat.isChecked(); mProfile.mUseCustomConfig = mUseCustomConfig.isChecked(); |