From 4de7b0c3db7ae6435f7860e31b28af346fe1a79e Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Wed, 26 Sep 2012 11:16:39 +0200 Subject: Implement reading/writing persist-tun setting --- src/de/blinkt/openvpn/Settings_Obscure.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/de/blinkt') diff --git a/src/de/blinkt/openvpn/Settings_Obscure.java b/src/de/blinkt/openvpn/Settings_Obscure.java index aed61392..f7a63043 100644 --- a/src/de/blinkt/openvpn/Settings_Obscure.java +++ b/src/de/blinkt/openvpn/Settings_Obscure.java @@ -13,6 +13,7 @@ public class Settings_Obscure extends OpenVpnPreferencesFragment implements OnPr private CheckBoxPreference mUseCustomConfig; private EditTextPreference mCustomConfig; private ListPreference mLogverbosity; + private CheckBoxPreference mPersistent; @Override public void onCreate(Bundle savedInstanceState) { @@ -26,10 +27,12 @@ public class Settings_Obscure extends OpenVpnPreferencesFragment implements OnPr mUseCustomConfig = (CheckBoxPreference) findPreference("enableCustomOptions"); mCustomConfig = (EditTextPreference) findPreference("customOptions"); mLogverbosity = (ListPreference) findPreference("verblevel"); - + mPersistent = (CheckBoxPreference) findPreference("usePersistTun"); + mLogverbosity.setOnPreferenceChangeListener(this); mLogverbosity.setSummary("%s"); + loadSettings(); } @@ -39,6 +42,7 @@ public class Settings_Obscure extends OpenVpnPreferencesFragment implements OnPr mUseFloat.setChecked(mProfile.mUseFloat); mUseCustomConfig.setChecked(mProfile.mUseCustomConfig); mCustomConfig.setText(mProfile.mCustomConfigOptions); + mPersistent.setChecked(mProfile.mPersistTun); mLogverbosity.setValue(mProfile.mVerb); onPreferenceChange(mLogverbosity, mProfile.mVerb); @@ -51,6 +55,7 @@ public class Settings_Obscure extends OpenVpnPreferencesFragment implements OnPr mProfile.mUseCustomConfig = mUseCustomConfig.isChecked(); mProfile.mCustomConfigOptions = mCustomConfig.getText(); mProfile.mVerb = mLogverbosity.getValue(); + mProfile.mPersistTun = mPersistent.isChecked(); } -- cgit v1.2.3