summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/VPNProfileList.java
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-05-04 00:28:52 +0200
committerArne Schwabe <arne@rfc2549.org>2012-05-04 00:28:52 +0200
commit7bfd830078268c010fdc65ccb2ef4980bf6c8e4d (patch)
tree119750363771382ea684ed0f8cff6ac7c767ca1b /src/de/blinkt/openvpn/VPNProfileList.java
parent2b3ea917b0a830e3ff4817c7240e0f1808ae58bc (diff)
Get vpn list working again, not yet perfect but at least delete works
http://code.google.com/p/android/issues/detail?id=3414 is hunting me :(
Diffstat (limited to 'src/de/blinkt/openvpn/VPNProfileList.java')
-rw-r--r--src/de/blinkt/openvpn/VPNProfileList.java27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/de/blinkt/openvpn/VPNProfileList.java b/src/de/blinkt/openvpn/VPNProfileList.java
index c9ff9805..56cc7ae1 100644
--- a/src/de/blinkt/openvpn/VPNProfileList.java
+++ b/src/de/blinkt/openvpn/VPNProfileList.java
@@ -21,11 +21,22 @@ import android.widget.ListView;
import android.widget.Toast;
public class VPNProfileList extends ListFragment {
+ class VPNArrayAdapter extends ArrayAdapter<VpnProfile> {
+
+ public VPNArrayAdapter(Context context, int resource,
+ int textViewResourceId) {
+ super(context, resource, textViewResourceId);
+
+ }
+
+ }
+
+
+
private static final int MENU_ADD_PROFILE = Menu.FIRST;
private static final int START_VPN_CONFIG = 92;
-
private ArrayAdapter<VpnProfile> mArrayadapter;
protected Object mActionMode;
@@ -78,12 +89,10 @@ public class VPNProfileList extends ListFragment {
});
- if(getPM().getNumberOfProfiles() == 0) {
- getPM().loadVPNList(getActivity());
- }
-
+// mArrayadapter = new ArrayAdapter<VpnProfile>(getActivity(),R.layout.vpn_list_item,R.id.vpn_item_title);
mArrayadapter = new ArrayAdapter<VpnProfile>(getActivity(),android.R.layout.simple_list_item_activated_1);
mArrayadapter.addAll(getPM().getProfiles());
+
setListAdapter(mArrayadapter);
}
@@ -127,7 +136,7 @@ public class VPNProfileList extends ListFragment {
protected void removeProfile(VpnProfile profile) {
mArrayadapter.remove(profile);
-
+ getPM().removeProfile(getActivity(),profile);
}
private void onAddProfileClicked() {
@@ -181,7 +190,7 @@ public class VPNProfileList extends ListFragment {
private ProfileManager getPM() {
- return ProfileManager.getInstance();
+ return ProfileManager.getInstance(getActivity());
}
@@ -240,10 +249,10 @@ public class VPNProfileList extends ListFragment {
askProfileRemoval();
mode.finish(); // Action picked, so close the CAB
return true;
- case R.id.connect_vpn:
+/* case R.id.connect_vpn:
startVPN(mEditProfile);
mode.finish();
- return true;
+ return true; */
case R.id.edit_vpn:
editVPN(mEditProfile);
mode.finish();