summaryrefslogtreecommitdiff
path: root/src/se/leap/leapclient/Dashboard.java
diff options
context:
space:
mode:
authorSean Leonard <meanderingcode@aetherislands.net>2013-07-12 13:35:04 -0600
committerSean Leonard <meanderingcode@aetherislands.net>2013-07-12 14:27:03 -0600
commit1ba2d488737bdb84847bbbc7cf9038610b1f094b (patch)
tree0b30e1136dfbe3a367627cf1cc011f1f6d1fe0b3 /src/se/leap/leapclient/Dashboard.java
parent210b562bd474e7d8c22becf62ea52399f0a6d9f9 (diff)
parent84d3b5f6967c0bac2a740627386ff92b6e283b16 (diff)
Merge branch 'feature/back-button-in-configuration-wizard' into develop
Diffstat (limited to 'src/se/leap/leapclient/Dashboard.java')
-rw-r--r--src/se/leap/leapclient/Dashboard.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/se/leap/leapclient/Dashboard.java b/src/se/leap/leapclient/Dashboard.java
index 59c0f182..a330f9e0 100644
--- a/src/se/leap/leapclient/Dashboard.java
+++ b/src/se/leap/leapclient/Dashboard.java
@@ -102,7 +102,7 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf
buildDashboard();
if(data != null && data.hasExtra(ConfigHelper.LOG_IN)) {
View view = ((ViewGroup)findViewById(android.R.id.content)).getChildAt(0);
- logInDialog(view);
+ logInDialog(view, "");
}
} else if(resultCode == RESULT_CANCELED && data.hasExtra(ConfigHelper.QUIT)) {
finish();
@@ -270,7 +270,7 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf
return true;
case R.id.login_button:
View view = ((ViewGroup)findViewById(android.R.id.content)).getChildAt(0);
- logInDialog(view);
+ logInDialog(view, "");
return true;
case R.id.logout_button:
logOut();
@@ -340,7 +340,7 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf
* Shows the log in dialog.
* @param view from which the dialog is created.
*/
- public void logInDialog(View view) {
+ public void logInDialog(View view, String user_message) {
FragmentTransaction fragment_transaction = getFragmentManager().beginTransaction();
Fragment previous_log_in_dialog = getFragmentManager().findFragmentByTag(ConfigHelper.LOG_IN_DIALOG);
if (previous_log_in_dialog != null) {
@@ -349,6 +349,11 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf
fragment_transaction.addToBackStack(null);
DialogFragment newFragment = LogInDialog.newInstance();
+ if(user_message != null && !user_message.isEmpty()) {
+ Bundle user_message_bundle = new Bundle();
+ user_message_bundle.putString(getResources().getString(R.string.user_message), user_message);
+ newFragment.setArguments(user_message_bundle);
+ }
newFragment.show(fragment_transaction, ConfigHelper.LOG_IN_DIALOG);
}
@@ -384,7 +389,7 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf
Cookie session_id = new BasicClientCookie(session_id_cookie_key, session_id_string);
downloadAuthedUserCertificate(session_id);
} else if(resultCode == ConfigHelper.SRP_AUTHENTICATION_FAILED) {
- logInDialog(getCurrentFocus());
+ logInDialog(getCurrentFocus(), resultData.getString(getResources().getString(R.string.user_message)));
mProgressDialog.dismiss();
} else if(resultCode == ConfigHelper.LOGOUT_SUCCESSFUL) {
setResult(RESULT_OK);