summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/VPNPreferences.java
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-04-23 00:07:02 +0200
committerArne Schwabe <arne@rfc2549.org>2012-04-23 00:07:02 +0200
commitdca67df888680da70235ce402e42e05945f67cb8 (patch)
treeed66e30a6d1acf1fcb68672cb636507e0bd89d2a /src/de/blinkt/openvpn/VPNPreferences.java
parent488a41cc60636298581c2b44b4706b259fc98a36 (diff)
Doing progress on the Preference dialog chaos
--HG-- rename : res/layout/config.xml => res/layout/basic_settings.xml rename : src/de/blinkt/openvpn/AboutActivity.java => src/de/blinkt/openvpn/AboutFragment.java
Diffstat (limited to 'src/de/blinkt/openvpn/VPNPreferences.java')
-rw-r--r--src/de/blinkt/openvpn/VPNPreferences.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/de/blinkt/openvpn/VPNPreferences.java b/src/de/blinkt/openvpn/VPNPreferences.java
index 69485efd..6c68e444 100644
--- a/src/de/blinkt/openvpn/VPNPreferences.java
+++ b/src/de/blinkt/openvpn/VPNPreferences.java
@@ -2,7 +2,9 @@ package de.blinkt.openvpn;
import java.util.List;
+import android.content.Intent;
import android.os.Bundle;
+import android.os.Parcelable;
import android.preference.CheckBoxPreference;
import android.preference.EditTextPreference;
import android.preference.Preference;
@@ -16,6 +18,7 @@ import android.widget.Button;
public class VPNPreferences extends PreferenceActivity {
+ private VpnProfile mProfile;
public VPNPreferences() {
super();
}
@@ -23,6 +26,8 @@ public class VPNPreferences extends PreferenceActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ mProfile = getIntent().getParcelableExtra("VpnProfile");
+
if (hasHeaders()) {
Button button = new Button(this);
button.setText("Some action");
@@ -47,12 +52,13 @@ public class VPNPreferences extends PreferenceActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+
// Make sure default values are applied. In a real app, you would
// want this in a shared function that is used to retrieve the
// SharedPreferences wherever they are needed.
PreferenceManager.setDefaultValues(getActivity(),
R.xml.vpn_ipsettings, false);
-
+
// Load the preferences from an XML resource
addPreferencesFromResource(R.xml.vpn_ipsettings);
mIPv4 = (EditTextPreference) findPreference("ipv4_address");
@@ -69,8 +75,14 @@ public class VPNPreferences extends PreferenceActivity {
mDNS2.setOnPreferenceChangeListener(this);
mUsePull.setOnPreferenceChangeListener(this);
mOverrideDNS.setOnPreferenceChangeListener(this);
+
+
+ VpnProfile vp = ((VPNPreferences) getActivity()).getVPNProfile();
+
+
setDNSState();
+
}
@Override
@@ -134,5 +146,8 @@ public class VPNPreferences extends PreferenceActivity {
addPreferencesFromResource(R.xml.vpn_obscure);
}
}
+ public VpnProfile getVPNProfile() {
+ return mProfile;
+ }
}