From 1705a3d66d5c2bc8b0c59b2e53c56ed7f6003f56 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Tue, 4 Feb 2014 10:03:13 +0100 Subject: Add UI/config parsing for excluded routes --- src/de/blinkt/openvpn/fragments/Settings_Routing.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/de/blinkt/openvpn/fragments') diff --git a/src/de/blinkt/openvpn/fragments/Settings_Routing.java b/src/de/blinkt/openvpn/fragments/Settings_Routing.java index 7216e0ff..c6f0dcf8 100644 --- a/src/de/blinkt/openvpn/fragments/Settings_Routing.java +++ b/src/de/blinkt/openvpn/fragments/Settings_Routing.java @@ -14,17 +14,22 @@ public class Settings_Routing extends OpenVpnPreferencesFragment implements OnPr private CheckBoxPreference mUseDefaultRoutev6; private CheckBoxPreference mRouteNoPull; private CheckBoxPreference mLocalVPNAccess; + private EditTextPreference mExcludedRoutes; + private EditTextPreference mExcludedRoutesv6; - @Override + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Load the preferences from an XML resource addPreferencesFromResource(R.xml.vpn_routing); - mCustomRoutes = (EditTextPreference) findPreference("customRoutes"); + mCustomRoutes = (EditTextPreference) findPreference("customRoutes"); mUseDefaultRoute = (CheckBoxPreference) findPreference("useDefaultRoute"); mCustomRoutesv6 = (EditTextPreference) findPreference("customRoutesv6"); mUseDefaultRoutev6 = (CheckBoxPreference) findPreference("useDefaultRoutev6"); + mExcludedRoutes = (EditTextPreference) findPreference("excludedRoutes"); + mExcludedRoutesv6 = (EditTextPreference) findPreference("excludedRoutesv6"); + mRouteNoPull = (CheckBoxPreference) findPreference("routenopull"); mLocalVPNAccess = (CheckBoxPreference) findPreference("unblockLocal"); @@ -43,6 +48,9 @@ public class Settings_Routing extends OpenVpnPreferencesFragment implements OnPr mCustomRoutes.setText(mProfile.mCustomRoutes); mCustomRoutesv6.setText(mProfile.mCustomRoutesv6); + mExcludedRoutes.setText(mProfile.mExcludedRoutes); + mExcludedRoutes.setText(mProfile.mExcludedRoutesv6); + mRouteNoPull.setChecked(mProfile.mRoutenopull); mLocalVPNAccess.setChecked(mProfile.mAllowLocalLAN); @@ -61,12 +69,15 @@ public class Settings_Routing extends OpenVpnPreferencesFragment implements OnPr mProfile.mCustomRoutesv6 = mCustomRoutesv6.getText(); mProfile.mRoutenopull = mRouteNoPull.isChecked(); mProfile.mAllowLocalLAN =mLocalVPNAccess.isChecked(); + mProfile.mExcludedRoutes = mExcludedRoutes.getText(); + mProfile.mExcludedRoutesv6 = mExcludedRoutesv6.getText(); } @Override public boolean onPreferenceChange(Preference preference, Object newValue) { - if( preference == mCustomRoutes || preference == mCustomRoutesv6 ) + if( preference == mCustomRoutes || preference == mCustomRoutesv6 + || preference == mExcludedRoutes || preference == mExcludedRoutesv6) preference.setSummary((String)newValue); saveSettings(); -- cgit v1.2.3