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
commita3733e0a42ee9d75d3572d11dc25b0166031313f (patch)
treee0ff36bde7c7d1d0bfc8163cee57409b54f5bb6d /src/de/blinkt/openvpn/LaunchVPN.java
parent7e02edb743934f4040fd1aac1cba4a121b66a228 (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();
}