summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/LaunchVPN.java
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-05-24 20:20:05 +0200
committerArne Schwabe <arne@rfc2549.org>2012-05-24 20:20:05 +0200
commit8234db7f3df52024f5059f39f02dd5870d93caee (patch)
tree19633b9e84d3d8c3f5cea57df1420cbbc5306d1b /src/de/blinkt/openvpn/LaunchVPN.java
parent18ce77d054b7cf69df7104f5ace5d41342d65fc1 (diff)
Add querying certificate key password (closes issue #23)
Diffstat (limited to 'src/de/blinkt/openvpn/LaunchVPN.java')
-rw-r--r--src/de/blinkt/openvpn/LaunchVPN.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/de/blinkt/openvpn/LaunchVPN.java b/src/de/blinkt/openvpn/LaunchVPN.java
index 73b1f34d..b031fe2f 100644
--- a/src/de/blinkt/openvpn/LaunchVPN.java
+++ b/src/de/blinkt/openvpn/LaunchVPN.java
@@ -243,7 +243,7 @@ public class LaunchVPN extends ListActivity implements OnItemClickListener {
}
}
- private void askForPW(final String type) {
+ private void askForPW(final int type) {
final EditText entry = new EditText(this);
entry.setSingleLine();
@@ -251,7 +251,7 @@ public class LaunchVPN extends ListActivity implements OnItemClickListener {
entry.setTransformationMethod(new PasswordTransformationMethod());
AlertDialog.Builder dialog = new AlertDialog.Builder(this);
- dialog.setTitle("Need " + type);
+ dialog.setTitle("Need " + getString(type));
dialog.setMessage("Enter the password for profile " + mSelectedProfile.mName);
dialog.setView(entry);
@@ -260,7 +260,7 @@ public class LaunchVPN extends ListActivity implements OnItemClickListener {
@Override
public void onClick(DialogInterface dialog, int which) {
String pw = entry.getText().toString();
- if(type.equals("Password")) {
+ if(type == R.string.password) {
mSelectedProfile.mTransientPW = pw;
} else {
mSelectedProfile.mTransientPCKS12PW = pw;
@@ -287,9 +287,9 @@ public class LaunchVPN extends ListActivity implements OnItemClickListener {
if(requestCode==START_VPN_PROFILE) {
if(resultCode == Activity.RESULT_OK) {
-
- if(mSelectedProfile.needUserPWInput()!=null) {
- askForPW(mSelectedProfile.needUserPWInput());
+ int needpw = mSelectedProfile.needUserPWInput();
+ if(needpw !=0) {
+ askForPW(needpw);
} else {
new startOpenVpnThread().start();
}