summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/FileSelect.java
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-07-21 00:23:13 +0200
committerArne Schwabe <arne@rfc2549.org>2012-07-21 00:23:13 +0200
commite8261bbc90f46dad1a7c0bb8bd998ebf9107f0f9 (patch)
tree715cdfe0ce50b6d33372cd8462c8a0b8c8f28028 /src/de/blinkt/openvpn/FileSelect.java
parent1f5ea346167406d4d2e734b4595786bbb8ad1089 (diff)
Allow clearing of the CA Cert (closes issue #57)
Diffstat (limited to 'src/de/blinkt/openvpn/FileSelect.java')
-rw-r--r--src/de/blinkt/openvpn/FileSelect.java20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/de/blinkt/openvpn/FileSelect.java b/src/de/blinkt/openvpn/FileSelect.java
index bbad5cfd..30d6628e 100644
--- a/src/de/blinkt/openvpn/FileSelect.java
+++ b/src/de/blinkt/openvpn/FileSelect.java
@@ -22,12 +22,14 @@ public class FileSelect extends Activity {
public static final String START_DATA = "START_DATA";
public static final String WINDOW_TITLE = "WINDOW_TILE";
public static final String NO_INLINE_SELECTION = "de.blinkt.openvpn.NO_INLINE_SELECTION";
+ public static final String SHOW_CLEAR_BUTTON = "de.blinkt.openvpn.SHOW_CLEAR_BUTTON";
private FileSelectionFragment mFSFragment;
private InlineFileTab mInlineFragment;
private String mData;
private Tab inlineFileTab;
private Tab fileExplorerTab;
private boolean mNoInline;
+ private boolean mShowClear;
public void onCreate(Bundle savedInstanceState)
@@ -47,6 +49,7 @@ public class FileSelect extends Activity {
setTitle(title);
mNoInline = getIntent().getBooleanExtra(NO_INLINE_SELECTION, false);
+ mShowClear = getIntent().getBooleanExtra(SHOW_CLEAR_BUTTON, false);
ActionBar bar = getActionBar();
bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
@@ -67,6 +70,13 @@ public class FileSelect extends Activity {
}
+
+ protected boolean showClear() {
+ if(mData == null || mData.equals(""))
+ return false;
+ else
+ return mShowClear;
+ }
protected class MyTabsListener<T extends Fragment> implements ActionBar.TabListener
{
@@ -139,7 +149,7 @@ public class FileSelect extends Activity {
}
public String getSelectPath() {
- if(mData.startsWith(VpnProfile.INLINE_TAG))
+ if(!mData.startsWith(VpnProfile.INLINE_TAG))
return mData;
else
return "/mnt/sdcard";
@@ -151,6 +161,14 @@ public class FileSelect extends Activity {
else
return "";
}
+
+ public void clearData() {
+ Intent intent = new Intent();
+ intent.putExtra(RESULT_DATA, (String)null);
+ setResult(Activity.RESULT_OK,intent);
+ finish();
+
+ }
public void saveInlineData(String string) {
Intent intent = new Intent();