diff options
author | Parménides GV <parmegv@sdf.org> | 2014-04-02 17:08:32 +0200 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2014-04-02 17:08:32 +0200 |
commit | 4335ef38d5ce8040eca2a6bace5f2e4ae8a179e5 (patch) | |
tree | 15918e1f56ff9c0d60895da93c135e23065f04a9 /src/se/leap/bitmaskclient/LogInDialog.java | |
parent | 6cb654d169c62653d652009d3c8de51ca877e38b (diff) |
Eip switch turns off accordingly to log in state.
Diffstat (limited to 'src/se/leap/bitmaskclient/LogInDialog.java')
-rw-r--r-- | src/se/leap/bitmaskclient/LogInDialog.java | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/se/leap/bitmaskclient/LogInDialog.java b/src/se/leap/bitmaskclient/LogInDialog.java index 81a3f764..a28c9049 100644 --- a/src/se/leap/bitmaskclient/LogInDialog.java +++ b/src/se/leap/bitmaskclient/LogInDialog.java @@ -51,7 +51,8 @@ public class LogInDialog extends DialogFragment { final public static String PASSWORD = "password"; final public static String USERNAME_MISSING = "username missing"; final public static String PASSWORD_INVALID_LENGTH = "password_invalid_length"; - + + private static boolean is_eip_pending = false; public AlertDialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); @@ -79,8 +80,11 @@ public class LogInDialog extends DialogFragment { password_field.requestFocus(); } if (getArguments() != null && getArguments().containsKey(PASSWORD_INVALID_LENGTH)) { - password_field.setError(getResources().getString(R.string.error_not_valid_password_user_message)); - } + password_field.setError(getResources().getString(R.string.error_not_valid_password_user_message)); + } + if(getArguments() != null && getArguments().getBoolean(EipServiceFragment.IS_EIP_PENDING, false)) { + is_eip_pending = true; + } builder.setView(log_in_dialog_view) @@ -113,7 +117,8 @@ public class LogInDialog extends DialogFragment { * @param username * @param password */ - public void authenticate(String username, String password); + public void authenticate(String username, String password); + public void cancelAuthedEipOn(); } LogInDialogInterface interface_with_Dashboard; @@ -136,4 +141,11 @@ public class LogInDialog extends DialogFragment { + " must implement LogInDialogListener"); } } + + @Override + public void onCancel(DialogInterface dialog) { + if(is_eip_pending) + interface_with_Dashboard.cancelAuthedEipOn(); + super.onCancel(dialog); + } } |