summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/FileSelectLayout.java
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2013-05-20 09:55:50 +0200
committerArne Schwabe <arne@rfc2549.org>2013-05-20 09:55:50 +0200
commit2a9037c749d3395ac65105604ab4936c4af0fc56 (patch)
treeee7672009ac3575f8aeac6c37ac91b7590334f28 /src/de/blinkt/openvpn/FileSelectLayout.java
parentffcd37e623136697da66e0c23bddc92b01ff0e41 (diff)
Add certificate CN print
Need to fix string for email and order --HG-- extra : rebase_source : c3d5858d53d2f8f340b0d4a07434021f194a247a
Diffstat (limited to 'src/de/blinkt/openvpn/FileSelectLayout.java')
-rw-r--r--src/de/blinkt/openvpn/FileSelectLayout.java33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/de/blinkt/openvpn/FileSelectLayout.java b/src/de/blinkt/openvpn/FileSelectLayout.java
index b7e28b5c..d7bcc475 100644
--- a/src/de/blinkt/openvpn/FileSelectLayout.java
+++ b/src/de/blinkt/openvpn/FileSelectLayout.java
@@ -1,5 +1,6 @@
package de.blinkt.openvpn;
+import de.blinkt.openvpn.core.X509Utils;
import android.app.Fragment;
import android.content.Context;
import android.content.Intent;
@@ -22,19 +23,21 @@ public class FileSelectLayout extends LinearLayout implements OnClickListener {
private boolean mBase64Encode;
private String mTitle;
private boolean mShowClear;
+ private TextView mDataDetails;
public FileSelectLayout( Context context,AttributeSet attrset) {
super(context,attrset);
inflate(getContext(), R.layout.file_select, this);
-
+
TypedArray ta = context.obtainStyledAttributes(attrset,R.styleable.FileSelectLayout);
-
+
mTitle = ta.getString(R.styleable.FileSelectLayout_title);
-
+
TextView tview = (TextView) findViewById(R.id.file_title);
tview.setText(mTitle);
-
+
mDataView = (TextView) findViewById(R.id.file_selected_item);
+ mDataDetails = (TextView) findViewById(R.id.file_selected_description);
mSelectButton = (Button) findViewById(R.id.file_select_button);
mSelectButton.setOnClickListener(this);
@@ -46,7 +49,7 @@ public class FileSelectLayout extends LinearLayout implements OnClickListener {
mTaskId = i;
mFragment = fragment;
}
-
+
public void getCertificateFileDialog() {
Intent startFC = new Intent(getContext(),FileSelect.class);
startFC.putExtra(FileSelect.START_DATA, mData);
@@ -58,20 +61,24 @@ public class FileSelectLayout extends LinearLayout implements OnClickListener {
mFragment.startActivityForResult(startFC,mTaskId);
}
-
+
public String getData() {
return mData;
}
public void setData(String data) {
mData = data;
- if(data==null)
+ if(data==null) {
mDataView.setText(mFragment.getString(R.string.no_data));
- else if(mData.startsWith(VpnProfile.INLINE_TAG))
- mDataView.setText(R.string.inline_file_data);
- else
- mDataView.setText(data);
-
+ mDataDetails.setText("");
+ }else {
+ if(mData.startsWith(VpnProfile.INLINE_TAG))
+ mDataView.setText(R.string.inline_file_data);
+ else
+ mDataView.setText(data);
+ mDataDetails.setText(X509Utils.getCertificateFriendlyName(data));
+ }
+
}
@Override
@@ -88,5 +95,5 @@ public class FileSelectLayout extends LinearLayout implements OnClickListener {
public void setShowClear() {
mShowClear=true;
}
-
+
}