summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2013-12-11 10:52:38 +0100
committerArne Schwabe <arne@rfc2549.org>2013-12-11 10:52:38 +0100
commita51eda3d7de8387316814cadddc1f5fde3c8b3aa (patch)
tree653cd886a1bb348b7f5acd5ab0a323c4960fed0a
parent49653f7c3811a29afc92b3def7430e962a39fe0b (diff)
Also move VpnPreferences and implement isValidFragment
--HG-- rename : src/de/blinkt/openvpn/VPNPreferences.java => src/de/blinkt/openvpn/activities/VPNPreferences.java
-rw-r--r--AndroidManifest.xml2
-rw-r--r--src/de/blinkt/openvpn/VpnProfile.java2
-rw-r--r--src/de/blinkt/openvpn/activities/VPNPreferences.java (renamed from src/de/blinkt/openvpn/VPNPreferences.java)26
-rw-r--r--src/de/blinkt/openvpn/fragments/LogFragment.java1
-rw-r--r--src/de/blinkt/openvpn/fragments/VPNProfileList.java1
5 files changed, 27 insertions, 5 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index b59c39d7..510bb678 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -32,7 +32,7 @@
android:label="@string/app"
android:supportsRtl="true" >
<activity
- android:name=".VPNPreferences"
+ android:name=".activities.VPNPreferences"
android:windowSoftInputMode="stateHidden" />
<activity
diff --git a/src/de/blinkt/openvpn/VpnProfile.java b/src/de/blinkt/openvpn/VpnProfile.java
index a9232eee..abf8d87c 100644
--- a/src/de/blinkt/openvpn/VpnProfile.java
+++ b/src/de/blinkt/openvpn/VpnProfile.java
@@ -44,7 +44,7 @@ public class VpnProfile implements Serializable {
// The Serializable documentation mentions that class name change are possible
// but the how is unclear
//
- transient static final long MAX_EMBED_FILE_SIZE = 2048*1024; // 2048kB
+ transient public static final long MAX_EMBED_FILE_SIZE = 2048*1024; // 2048kB
// Don't change this, not all parts of the program use this constant
public static final String EXTRA_PROFILEUUID = "de.blinkt.openvpn.profileUUID";
public static final String INLINE_TAG = "[[INLINE]]";
diff --git a/src/de/blinkt/openvpn/VPNPreferences.java b/src/de/blinkt/openvpn/activities/VPNPreferences.java
index 446a4ca7..1ebb16b2 100644
--- a/src/de/blinkt/openvpn/VPNPreferences.java
+++ b/src/de/blinkt/openvpn/activities/VPNPreferences.java
@@ -1,23 +1,39 @@
-package de.blinkt.openvpn;
+package de.blinkt.openvpn.activities;
import java.util.List;
import android.annotation.TargetApi;
import android.app.AlertDialog;
+import android.app.Fragment;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceActivity;
+import android.preference.PreferenceFragment;
import android.view.Menu;
import android.view.MenuItem;
+
+import de.blinkt.openvpn.R;
+import de.blinkt.openvpn.VpnProfile;
import de.blinkt.openvpn.core.ProfileManager;
+import de.blinkt.openvpn.fragments.Settings_Authentication;
+import de.blinkt.openvpn.fragments.Settings_Basic;
+import de.blinkt.openvpn.fragments.Settings_IP;
+import de.blinkt.openvpn.fragments.Settings_Obscure;
+import de.blinkt.openvpn.fragments.Settings_Routing;
+import de.blinkt.openvpn.fragments.ShowConfigFragment;
import de.blinkt.openvpn.fragments.VPNProfileList;
public class VPNPreferences extends PreferenceActivity {
- private String mProfileUUID;
+ static final Class validFragments[] = new Class[] {
+ Settings_Authentication.class, Settings_Basic.class, Settings_IP.class,
+ Settings_Obscure.class, Settings_Routing.class, ShowConfigFragment.class
+ };
+
+ private String mProfileUUID;
private VpnProfile mProfile;
public VPNPreferences() {
@@ -28,7 +44,11 @@ public class VPNPreferences extends PreferenceActivity {
@TargetApi(Build.VERSION_CODES.KITKAT)
@Override
protected boolean isValidFragment(String fragmentName) {
- return true;
+ for (Class c: validFragments)
+ if (c.getName().equals(fragmentName))
+ return true;
+ return false;
+
}
@Override
diff --git a/src/de/blinkt/openvpn/fragments/LogFragment.java b/src/de/blinkt/openvpn/fragments/LogFragment.java
index 9aaf15b7..8530be34 100644
--- a/src/de/blinkt/openvpn/fragments/LogFragment.java
+++ b/src/de/blinkt/openvpn/fragments/LogFragment.java
@@ -21,6 +21,7 @@ import android.widget.AdapterView.OnItemLongClickListener;
import de.blinkt.openvpn.*;
import de.blinkt.openvpn.activities.DisconnectVPN;
import de.blinkt.openvpn.activities.MainActivity;
+import de.blinkt.openvpn.activities.VPNPreferences;
import de.blinkt.openvpn.core.OpenVPNManagement;
import de.blinkt.openvpn.core.VpnStatus;
import de.blinkt.openvpn.core.VpnStatus.ConnectionStatus;
diff --git a/src/de/blinkt/openvpn/fragments/VPNProfileList.java b/src/de/blinkt/openvpn/fragments/VPNProfileList.java
index 3c031595..866aea25 100644
--- a/src/de/blinkt/openvpn/fragments/VPNProfileList.java
+++ b/src/de/blinkt/openvpn/fragments/VPNProfileList.java
@@ -23,6 +23,7 @@ import android.widget.Toast;
import de.blinkt.openvpn.*;
import de.blinkt.openvpn.activities.ConfigConverter;
import de.blinkt.openvpn.activities.FileSelect;
+import de.blinkt.openvpn.activities.VPNPreferences;
import de.blinkt.openvpn.core.ProfileManager;
import java.util.Collection;