summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/FileSelectLayout.java
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-05-11 00:46:33 +0200
committerArne Schwabe <arne@rfc2549.org>2012-05-11 00:46:33 +0200
commitbfb51aa744b09b248daacd3ada8f04e6c6f7d5a5 (patch)
treeaf278c4a7243807df6cf0e7774fd7cc810f7d1a9 /src/de/blinkt/openvpn/FileSelectLayout.java
parentbe5159289c41a525b718363e3f7ab78019928d42 (diff)
Rework FIle selection dialog.
Include possibility to include file content in VPN Profile. Allows safer storage of Certifcates and keys. (closes issue #13) --HG-- rename : src/com/lamerman/FileDialog.java => src/de/blinkt/openvpn/FileSelectionFragment.java
Diffstat (limited to 'src/de/blinkt/openvpn/FileSelectLayout.java')
-rw-r--r--src/de/blinkt/openvpn/FileSelectLayout.java20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/de/blinkt/openvpn/FileSelectLayout.java b/src/de/blinkt/openvpn/FileSelectLayout.java
index 2eba9515..bbaf7778 100644
--- a/src/de/blinkt/openvpn/FileSelectLayout.java
+++ b/src/de/blinkt/openvpn/FileSelectLayout.java
@@ -11,12 +11,11 @@ import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
-import com.lamerman.FileDialog;
-import com.lamerman.SelectionMode;
public class FileSelectLayout extends LinearLayout implements OnClickListener {
- private TextView mData;
+ private TextView mDataView;
+ private String mData;
private Fragment mFragment;
private int mTaskId;
private Button mSelectButton;
@@ -32,7 +31,7 @@ public class FileSelectLayout extends LinearLayout implements OnClickListener {
TextView tview = (TextView) findViewById(R.id.file_title);
tview.setText(title);
- mData = (TextView) findViewById(R.id.file_selected_item);
+ mDataView = (TextView) findViewById(R.id.file_selected_item);
mSelectButton = (Button) findViewById(R.id.file_select_button);
mSelectButton.setOnClickListener(this);
@@ -45,20 +44,23 @@ public class FileSelectLayout extends LinearLayout implements OnClickListener {
}
public void getCertificateFileDialog() {
- Intent startFC = new Intent(getContext(),FileDialog.class);
- startFC.putExtra(FileDialog.START_PATH, "/sdcard");
- startFC.putExtra(FileDialog.SELECTION_MODE, SelectionMode.MODE_OPEN);
+ Intent startFC = new Intent(getContext(),FileSelect.class);
+ startFC.putExtra(FileSelect.START_DATA, mData);
mFragment.startActivityForResult(startFC,mTaskId);
}
public String getData() {
- return mData.getText().toString();
+ return mData;
}
public void setData(String data) {
- mData.setText(data);
+ mData = data;
+ if(mData.startsWith(FileSelect.INLINE_TAG))
+ mDataView.setText(R.string.inline_file_data);
+ else
+ mDataView.setText(data);
}