diff options
author | Arne Schwabe <arne@rfc2549.org> | 2012-07-21 00:23:13 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2012-07-21 00:23:13 +0200 |
commit | 7ef4e9634718245fb2e9e01412119b96ef368441 (patch) | |
tree | 51bf077e670ce17de401255d92f8ea00726bd90e /src/de/blinkt/openvpn/FileSelect.java | |
parent | 10d0c34e8b4a5aa3626b5bbd0d3bcedc12cb8ddb (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.java | 20 |
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(); |